Commit 3abddfdb authored by chase's avatar chase

Merge branch 'dev_mysql' of http://code.tech.tax.asia.pwcinternal.com/root/atms into dev_mysql

parents 97d38aa0 328eff2f
......@@ -494,12 +494,20 @@
<targetPath>${basedir}/target/classes/userTemplate</targetPath>
</resource>
<resource>
<directory>src/main/resources/vat_excel_template</directory>
<directory>src/main/resources/vat_excel_template</directory>
<includes>
<include>**/*.xls</include>
<include>**/*.xlsx</include>
</includes>
<targetPath>${basedir}/target/classes/vat_excel_template</targetPath>
</resource>
<resource>
<directory>src/main/resources/cit_excel_template</directory>
<includes>
<include>**/*.xls</include>
<include>**/*.xlsx</include>
</includes>
<targetPath>${basedir}/target/classes/vat_excel_template</targetPath>
<targetPath>${basedir}/target/classes/cit_excel_template</targetPath>
</resource>
</resources>
<plugins>
......
package pwc.taxtech.atms.common.util;
import org.jxls.area.Area;
import org.jxls.builder.AreaBuilder;
import org.jxls.builder.xls.XlsCommentAreaBuilder;
import org.jxls.common.CellRef;
import org.jxls.common.Context;
import org.jxls.expression.JexlExpressionEvaluator;
import org.jxls.transform.Transformer;
import org.jxls.transform.poi.WritableCellValue;
import org.jxls.transform.poi.WritableHyperlink;
import org.jxls.util.TransformerFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource;
import pwc.taxtech.atms.dto.export.ExportDto;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;
/**
* Jxls导出Excel工具
* author kevin
*/
public class JxlsUtils {
private static final Logger log = LoggerFactory.getLogger(JxlsUtils.class);
public static void toPackageOs(HttpServletResponse response , String fileName) {
ResponseUtil.response(response, fileName, null);
}
/**
* 生成模板输入流
* @param temPath
* @return
* @throws Exception
*/
public static InputStream toPackageIn(String temPath){
try {
return new ClassPathResource((temPath)).getInputStream();
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public static <T> void export(ExportDto exportDto){
toPackageOs(exportDto.getResponse(), exportDto.getFileName());
try {
exportExcel(exportDto.getList(), exportDto.getResponse().getOutputStream(), toPackageIn(exportDto.getTemplateUrl()), exportDto.getRelation());
} catch (IOException e) {
e.printStackTrace();
}
}
public static <T> void exportExcel(List<T> list, ServletOutputStream os ,
InputStream in, Object relation ){
long exportExcelBegin = System.currentTimeMillis();
log.warn("exportExcel begin: " + exportExcelBegin);
Context context = new Context();
context.putVar("list", list);
if(relation != null)
context.putVar("relation", relation);
Map<String , Object> myFunction = new HashMap<String , Object>();
myFunction.put("util", new JxlsUtils());
Transformer trans = TransformerFactory.createTransformer(in, os);
JexlExpressionEvaluator evaluator = (JexlExpressionEvaluator) trans.getTransformationConfig().getExpressionEvaluator();
evaluator.getJexlEngine().setFunctions(myFunction);
//载入模板、处理导出
AreaBuilder areaBuilder = new XlsCommentAreaBuilder(trans);
List<Area> areaList = areaBuilder.build();
areaList.get(0).applyAt(new CellRef("汇总表!A1"), context);
try {
trans.write();
//释放资源
os.flush();
os.close();
in.close();
long endExcel = System.currentTimeMillis();
log.warn("exportExcel begin: " + endExcel);
} catch (IOException e) {
e.printStackTrace();
}
}
//返回大的数
public Integer max(Integer x , Integer y){
return x > y ? x : y;
}
//给金额前面显示个货币符号
public Object formatMoney(Object a){
Object result = null;
if(a != null){
return "¥" + a;
}
return result;
}
//超链接
public WritableCellValue myHyperlink(String address, String title) {
return new WritableHyperlink(address, title);
}
private Map<String,Integer> countMap = new HashMap<>(); //用于jxls的foreach循环计数
//为Excel添加序号
public Integer count(String var){
if (var == null) return null;
if(countMap.containsKey(var)){
Integer t = countMap.get(var);
t += 1;
countMap.replace(var,t);
return t;
}else{
countMap.put(var,1);
}
return 1;
}
}
......@@ -15,7 +15,7 @@ public class ResponseUtil {
response.addHeader("Access-Control-Expose-Headers", "Content-Type,Content-Disposition,x-file-name");
response.setCharacterEncoding("UTF-8");
response.addHeader("Content-Disposition", "attachment;filename="
+ UUID.randomUUID() + ".xls");
+ UUID.randomUUID() + ".xlsx");
response.addHeader("x-file-name", fileName);
try {
return response.getOutputStream();
......
......@@ -34,8 +34,10 @@ public final class Constant {
public static final String FILE_NAME = "filename";
public static final String TEMP_FILE_NAME = "tempFileName";
public static final String vatTemplateUrl = "vat_excel_template";
public static final String citTemplateUrl = "cit_excel_template";
public static final boolean DEFAULT_RESULT = true;
public static final int FIRST_OR_DEFAULT = 0;
......
......@@ -46,16 +46,22 @@ public class CitPreviewDataController extends BaseController {
@RequestMapping("getCitPreviewEamDisposalDataList")
@ResponseBody
public CamelPagingResultDto<CitEAMAssetsDisposal> getCitPreviewEamDisposalDataList(@RequestBody CitEAMAssetsDisposalDto citSalaryDataDto){
return new CamelPagingResultDto<>(citPreviewDataService.getCitPreviewEamDisposalDataList(citSalaryDataDto));
return new CamelPagingResultDto<>(citPreviewDataService.getCitPreviewEamDisposalDataList(citSalaryDataDto));
}
//eam资产处置记录表导出
@RequestMapping(value = "exportDataEAM", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void exportDataEAM(@RequestBody CitEAMAssetsDisposal citEAMAssetsDisposal, HttpServletResponse response) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat( "yyyy-MM-dd hh:MM:ss");
String format = simpleDateFormat.format(new Date());
String fileName = "EAM资产处理金额记录表"+ format;
int count = citPreviewDataService.exportDataEAM(citEAMAssetsDisposal, ResponseUtil.response(response, fileName));
public void exportDataEAM(@RequestBody CitEAMAssetsDisposalDto citEAMAssetsDisposalDto, HttpServletResponse response) {
int count = citPreviewDataService.exportDataEAM(citEAMAssetsDisposalDto, response);
if (count == 0) {
response.setStatus(SC_NO_CONTENT);
} else {
response.setStatus(SC_OK);
}
}
//预提重分类数据源
@RequestMapping(value = "exportDataSalaryAdvance", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public void exportDataSalaryAdvance(@RequestBody CitEAMAssetsDisposalDto citEAMAssetsDisposalDto, HttpServletResponse response) {
int count = citPreviewDataService.exportDataSalaryAdvance(citEAMAssetsDisposalDto, response);
if (count == 0) {
response.setStatus(SC_NO_CONTENT);
} else {
......
package pwc.taxtech.atms.dto.export;
import pwc.taxtech.atms.entity.CitEAMAssetsDisposal;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
public class ExportDto<T> {
private HttpServletResponse response = null;
private ServletOutputStream outputStream;
private List<T> list;
private Object relation;
private String templateUrl;
private String fileName;
public HttpServletResponse getResponse() {
return response;
}
public void setResponse(HttpServletResponse response) {
this.response = response;
}
public ServletOutputStream getOutputStream() {
return outputStream;
}
public void setOutputStream(ServletOutputStream outputStream) {
this.outputStream = outputStream;
}
public List<T> getList() {
return list;
}
public void setList(List<T> list) {
this.list = list;
}
public Object getRelation() {
return relation;
}
public void setRelation(Object relation) {
this.relation = relation;
}
public String getTemplateUrl() {
return templateUrl;
}
public void setTemplateUrl(String templateUrl) {
this.templateUrl = templateUrl;
}
public String getFileName() {
return fileName;
}
public void setFileName(String fileName) {
this.fileName = fileName;
}
@Override
public String toString() {
return "ExportDto{" +
"response=" + response +
", outputStream=" + outputStream +
", list=" + list +
", relation=" + relation +
", templateUrl='" + templateUrl + '\'' +
", fileName='" + fileName + '\'' +
'}';
}
}
......@@ -14,4 +14,22 @@ public class CitEAMAssetsDisposalDto extends CitEAMAssetsDisposal {
public void setPageInfo(CamelPagingDto pageInfo) {
this.pageInfo = pageInfo;
}
private String periodStart;
private String periodEnd;
public String getPeriodStart() {
return periodStart;
}
public void setPeriodStart(String periodStart) {
this.periodStart = periodStart;
}
public String getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(String periodEnd) {
this.periodEnd = periodEnd;
}
}
......@@ -6,6 +6,8 @@ import pwc.taxtech.atms.entity.CitSalaryAdvance;
public class CitSalaryDataDto extends CitSalaryAdvance {
private CamelPagingDto pageInfo;
private Integer periodEnd;
private Integer periodStart;
public CamelPagingDto getPageInfo() {
return this.pageInfo;
......@@ -14,4 +16,21 @@ public class CitSalaryDataDto extends CitSalaryAdvance {
public void setPageInfo(CamelPagingDto pageInfo) {
this.pageInfo = pageInfo;
}
public Integer getPeriodEnd() {
return periodEnd;
}
public void setPeriodEnd(Integer periodEnd) {
this.periodEnd = periodEnd;
}
public Integer getPeriodStart() {
return periodStart;
}
public void setPeriodStart(Integer periodStart) {
this.periodStart = periodStart;
}
}
......@@ -5,30 +5,19 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pwc.taxtech.atms.common.util.JxlsUtils;
import pwc.taxtech.atms.constant.Constant;
import pwc.taxtech.atms.dao.CitEAMAssetsDisposalMapper;
import pwc.taxtech.atms.dao.CitSalaryAdvanceMapper;
import pwc.taxtech.atms.dto.input.CamelPagingResultDto;
import pwc.taxtech.atms.dto.export.ExportDto;
import pwc.taxtech.atms.dto.previewData.CitEAMAssetsDisposalDto;
import pwc.taxtech.atms.dto.previewData.CitSalaryDataDto;
import pwc.taxtech.atms.dto.vatdto.TrialBalanceParam;
import pwc.taxtech.atms.dto.vatdto.dd.BalanceSheetDto;
import pwc.taxtech.atms.dto.vatdto.dd.TrialBalanceExportDto;
import pwc.taxtech.atms.entity.CitEAMAssetsDisposal;
import pwc.taxtech.atms.entity.CitEAMAssetsDisposalExample;
import pwc.taxtech.atms.entity.CitSalaryAdvance;
import pwc.taxtech.atms.entity.CitSalaryAdvanceExample;
import pwc.taxtech.atms.thirdparty.ExcelUtil;
import pwc.taxtech.atms.vat.dpo.TrialBalanceCondition;
import pwc.taxtech.atms.vat.entity.TrialBalance;
import javax.servlet.ServletOutputStream;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import static pwc.taxtech.atms.common.util.SpringContextUtil.trialBalanceMapper;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
@Service
public class CitPreviewDataServiceImpl extends BaseService {
......@@ -41,6 +30,23 @@ public class CitPreviewDataServiceImpl extends BaseService {
if(!"".equals(citSalaryDataDto.getPoSubjectName()) && citSalaryDataDto.getPoSubjectName() != null){//根据PO主体名称进行查询
criteria.andPoSubjectNameEqualTo(citSalaryDataDto.getPoSubjectName());
}
Integer periodStart = null;
Integer periodEnd = null;
if(citSalaryDataDto.getPeriodStart() != null && !"".equals(citSalaryDataDto.getPeriodStart())){
periodStart = citSalaryDataDto.getPeriodStart();
}
if(citSalaryDataDto.getPeriodEnd() != null &&!"".equals(citSalaryDataDto.getPeriodEnd())){
periodEnd = citSalaryDataDto.getPeriodEnd();
}
if(periodEnd != null && periodStart!= null){
criteria.andPeriodBetween(periodStart, periodEnd);
}
if(periodStart == null && periodEnd!= null){
criteria.andPeriodLessThanOrEqualTo(periodEnd);
}
if(periodStart != null && periodEnd == null ){
criteria.andPeriodGreaterThanOrEqualTo(periodStart);
}
Page page = PageHelper.startPage(citSalaryDataDto.getPageInfo().getPageIndex(), citSalaryDataDto.getPageInfo().getPageSize());
List<CitSalaryAdvance> citSalaryAdvances = citSalaryAdvanceMapper.selectByExample(example);
PageInfo<CitSalaryAdvance> pageInfo =new PageInfo<CitSalaryAdvance>(citSalaryAdvances);
......@@ -54,6 +60,40 @@ public class CitPreviewDataServiceImpl extends BaseService {
public PageInfo<CitEAMAssetsDisposal> getCitPreviewEamDisposalDataList(CitEAMAssetsDisposalDto citEAMAssetsDisposalDto) {
CitEAMAssetsDisposalExample example = new CitEAMAssetsDisposalExample();
CitEAMAssetsDisposalExample.Criteria criteria = example.createCriteria();
Integer periodStart = null;
Integer periodEnd = null;
if(citEAMAssetsDisposalDto.getPeriodStart() != null && !"".equals(citEAMAssetsDisposalDto.getPeriodStart())){
periodStart = Integer.parseInt(citEAMAssetsDisposalDto.getPeriodStart());
}
if(citEAMAssetsDisposalDto.getPeriodEnd() != null &&!"".equals(citEAMAssetsDisposalDto.getPeriodEnd())){
periodEnd = Integer.parseInt(citEAMAssetsDisposalDto.getPeriodEnd());
}
if(citEAMAssetsDisposalDto.getAssetLabelNumber() != null && !"".equals(citEAMAssetsDisposalDto.getAssetLabelNumber())){
criteria.andAssetLabelNumberEqualTo(citEAMAssetsDisposalDto.getAssetLabelNumber());
}
if(citEAMAssetsDisposalDto.getCompensationSaleAmount() != null && !"".equals(citEAMAssetsDisposalDto.getCompensationSaleAmount())){
criteria.andCompensationSaleAmountEqualTo(citEAMAssetsDisposalDto.getCompensationSaleAmount());
}
if(periodEnd != null && periodStart!= null){
criteria.andPeriodBetween(periodStart, periodEnd);
}
if(periodStart == null && periodEnd!= null){
criteria.andPeriodLessThanOrEqualTo(periodEnd);
}
if(periodStart != null && periodEnd == null ){
criteria.andPeriodGreaterThanOrEqualTo(periodStart);
}
/*if(citEAMAssetsDisposalDto.getOrganizationId() != null){
criteria.andOrganizationIdEqualTo(citEAMAssetsDisposalDto.getOrganizationId());
}
*/
if(citEAMAssetsDisposalDto.getPeriod() != null && !"".equals(citEAMAssetsDisposalDto.getPeriod())){
criteria.andPeriodEqualTo(citEAMAssetsDisposalDto.getPeriod());
}
Page page = PageHelper.startPage(citEAMAssetsDisposalDto.getPageInfo().getPageIndex(), citEAMAssetsDisposalDto.getPageInfo().getPageSize());
List<CitEAMAssetsDisposal> citSalaryAdvances = citEAMAssetsDisposalMapper.selectByExample(example);
PageInfo<CitEAMAssetsDisposal> pageInfo =new PageInfo<CitEAMAssetsDisposal>(citSalaryAdvances);
......@@ -63,39 +103,64 @@ public class CitPreviewDataServiceImpl extends BaseService {
private Map<String, String> generalEAMHeader() {
Map<String, String> header = new LinkedHashMap<>();
header.put("Date","数据日期");
/*header.put("Date","数据日期");*/
header.put("Source","来源");
header.put("Period","期间");
header.put("LedgerId","账套ID");
header.put("OccurPeriod","发生期间");
header.put("AssetLabelNumber","资产标签号");
header.put("CompensationSaleAmount","赔偿/变卖金额");
header.put("CreatedBy","主体性质");
header.put("CreatedBy","创建人");
return header;
}
public int exportDataEAM(CitEAMAssetsDisposal citEAMAssetsDisposal, ServletOutputStream response) {
try {
public int exportDataEAM(CitEAMAssetsDisposalDto citEAMAssetsDisposalDto, HttpServletResponse response) {
/* try {
CitEAMAssetsDisposalExample example = new CitEAMAssetsDisposalExample();
List<CitEAMAssetsDisposal> list = citEAMAssetsDisposalMapper.selectByCondition(citEAMAssetsDisposal);
List<CitEAMAssetsDisposal> list = citEAMAssetsDisposalMapper.selectByCondition(citEAMAssetsDisposalDto);
Map<String, String> header = generalEAMHeader();
/*
TrialBalanceCondition condition = new TrialBalanceCondition();
beanUtil.copyProperties(param, condition);
List<TrialBalance> trialBalances = trialBalanceMapper.selectByCondition(condition);*/
/*
Map<String, String> header = generalTBHeader();
List<TrialBalanceExportDto> cellList = new ArrayList<>();
trialBalances.forEach(tb -> {
TrialBalanceExportDto d = new TrialBalanceExportDto();
List<CitEAMAssetsDisposalExport> cellList = new ArrayList<>();
list.forEach(tb -> {
CitEAMAssetsDisposalExport d = new CitEAMAssetsDisposalExport();
d = beanUtil.copyProperties(tb, d);
cellList.add(d);
});*/
ExcelUtil.exportExcel(header, list, response);
});
ExcelUtil.exportExcel(header, cellList, response);
return list.size();
} catch (Exception e) {
e.printStackTrace();
logger.error("EAM资产处理金额记录表: %s", e.getMessage());
return 0;
}*/
//第二种导出方式
CitEAMAssetsDisposalExample example = new CitEAMAssetsDisposalExample();
List<CitEAMAssetsDisposal> list = citEAMAssetsDisposalMapper.selectByCondition(citEAMAssetsDisposalDto);
if(list.size()==0){
return 0;
}
ExportDto exportDto = new ExportDto();
exportDto.setFileName("EAM资产处置金额");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/eamDispoal.xlsx");
exportDto.setResponse(response);
exportDto.setList(list);
exportDto.setRelation(null);
JxlsUtils.export(exportDto);
return 1;
}
public int exportDataSalaryAdvance(CitEAMAssetsDisposalDto citEAMAssetsDisposalDto, HttpServletResponse response) {
CitEAMAssetsDisposalExample example = new CitEAMAssetsDisposalExample();
List<CitEAMAssetsDisposal> list = citEAMAssetsDisposalMapper.selectByCondition(citEAMAssetsDisposalDto);
if(list.size()==0){
return 0;
}
ExportDto exportDto = new ExportDto();
exportDto.setFileName("预提重分类数据源");
exportDto.setTemplateUrl(Constant.citTemplateUrl + "/salaryAdvance.xlsx");
exportDto.setResponse(response);
exportDto.setList(list);
exportDto.setRelation(null);
JxlsUtils.export(exportDto);
return 1;
}
}
......@@ -10,7 +10,6 @@ import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import pwc.taxtech.atms.CommonIT;
import pwc.taxtech.atms.OrgKV;
import pwc.taxtech.atms.common.message.LogMessage;
......
......@@ -7,6 +7,7 @@ import org.apache.ibatis.session.RowBounds;
import pwc.taxtech.atms.MyMapper;
import pwc.taxtech.atms.entity.CitEAMAssetsDisposal;
import pwc.taxtech.atms.entity.CitEAMAssetsDisposalExample;
import pwc.taxtech.atms.entity.CitSalaryAdvance;
@Mapper
public interface CitEAMAssetsDisposalMapper extends MyMapper {
......@@ -109,4 +110,5 @@ public interface CitEAMAssetsDisposalMapper extends MyMapper {
int insertBatch(List<CitEAMAssetsDisposal> citEAMAssetsDisposalList);
List<CitEAMAssetsDisposal> selectByCondition(@Param("citEAMAssetsDisposal") CitEAMAssetsDisposal citEAMAssetsDisposal);
List<CitSalaryAdvance> selectByCondition(@Param("citPreviewSalaryAdvance") CitSalaryAdvance citEAMAssetsDisposal);
}
\ No newline at end of file
......@@ -35,6 +35,7 @@ public class CitEAMAssetsDisposal extends BaseEntity implements Serializable {
*
* @mbg.generated
*/
private String organizationId;
/**
......
......@@ -90,7 +90,7 @@
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, organization_id, project_id, period, source, occur_period, asset_label_number,
id, organization_id, project_id, period, source, occur_period, asset_label_number,
compensation_sale_amount, created_by, updated_by, create_time, update_time
</sql>
<select id="selectByExample" parameterType="pwc.taxtech.atms.entity.CitEAMAssetsDisposalExample" resultMap="BaseResultMap">
......
......@@ -3,16 +3,26 @@
<mapper namespace="pwc.taxtech.atms.dao.CitEAMAssetsDisposalMapper">
<sql id="QueryCondition">
1 = 1
<if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(citEAMAssetsDisposal.period)">
<!-- <if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(citEAMAssetsDisposal.period)">
AND period= #{citEAMAssetsDisposal.period,jdbcType=VARCHAR}
</if>
<if test="citEAMAssetsDisposal.compensationSaleAmount!=null">
</if>-->
<if test="citEAMAssetsDisposal.compensationSaleAmount!=null and citEAMAssetsDisposal.compensationSaleAmount != '' ">
AND compensation_sale_amount &gt;= #{citEAMAssetsDisposal.compensationSaleAmount,jdbcType=INTEGER}
</if>
<if test="citEAMAssetsDisposal.assetLabelNumber!=null">
<if test="citEAMAssetsDisposal.assetLabelNumber!=null and citEAMAssetsDisposal.assetLabelNumber!='' ">
AND asset_label_number &lt;= #{citEAMAssetsDisposal.assetLabelNumber,jdbcType=INTEGER}
</if>
<if test="citEAMAssetsDisposal.periodStart!=null and citEAMAssetsDisposal.periodStart!= '' and citEAMAssetsDisposal.periodEnd!= null and citEAMAssetsDisposal.periodEnd!= ''">
AND period between ${citEAMAssetsDisposal.periodStart} and ${citEAMAssetsDisposal.periodEnd}
</if>
<if test="citEAMAssetsDisposal.periodStart == null and citEAMAssetsDisposal.periodStart != '' and citEAMAssetsDisposal.periodEnd != null and citEAMAssetsDisposal.periodEnd != ''">
AND period &lt; ${citEAMAssetsDisposal.periodEnd} or period = ${citEAMAssetsDisposal.periodEnd}
</if>
<if test="citEAMAssetsDisposal.periodStart != null and citEAMAssetsDisposal.periodStart != '' and citEAMAssetsDisposal.periodEnd == null and citEAMAssetsDisposal.periodEnd != '' ">
AND period &gt; ${citEAMAssetsDisposal.periodStart} or period = ${citEAMAssetsDisposal.periodStart}
</if>
</sql>
<insert id="insertBatch" parameterType="java.util.List">
insert into cit_eam_assets_disposal
(<include refid="Base_Column_List"/>)
......@@ -72,8 +82,11 @@
SELECT 1 FROM DUAL;
</insert>
<select id ="selectByCondition" parameterType="pwc.taxtech.atms.entity.CitEAMAssetsDisposal">
select * from cit_eam_assets_disposal
<select id ="selectByCondition" parameterType="pwc.taxtech.atms.entity.CitEAMAssetsDisposal" resultType="pwc.taxtech.atms.entity.CitEAMAssetsDisposal">
select
id, organization_id as organizationId, project_id as projectId, period, source, occur_period as occurPeriod, asset_label_number as assetLabelNumber,
compensation_sale_amount as compensationSaleAmount, created_by as createBy, updated_by as updateBy, create_time as createTime, update_time as updateTime
from cit_eam_assets_disposal
WHERE
<include refid="QueryCondition"/>
</select>
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="pwc.taxtech.atms.dao.CitSalaryAdvanceMapper">
<sql id="QueryCondition">
1 = 1
<!-- <if test="@com.github.pagehelper.util.StringUtil@isNotEmpty(citEAMAssetsDisposal.period)">
AND period= #{citEAMAssetsDisposal.period,jdbcType=VARCHAR}
</if>-->
<if test="citPreviewSalaryAdvance.compensationSaleAmount!=null and citPreviewSalaryAdvance.compensationSaleAmount != '' ">
AND compensation_sale_amount &gt;= #{citEAMAssetsDisposal.compensationSaleAmount,jdbcType=INTEGER}
</if>
<if test="citPreviewSalaryAdvance.assetLabelNumber!=null and citPreviewSalaryAdvance.assetLabelNumber!='' ">
AND asset_label_number &lt;= #{citEAMAssetsDisposal.assetLabelNumber,jdbcType=INTEGER}
</if>
<if test="citPreviewSalaryAdvance.periodStart!=null and citPreviewSalaryAdvance.periodStart!= '' and citPreviewSalaryAdvance.periodEnd!= null and citPreviewSalaryAdvance.periodEnd!= ''">
AND period between ${citEAMAssetsDisposal.periodStart} and ${citEAMAssetsDisposal.periodEnd}
</if>
<if test="citEAMAssetsDisposal.periodStart == null and citEAMAssetsDisposal.periodStart != '' and citEAMAssetsDisposal.periodEnd != null and citEAMAssetsDisposal.periodEnd != ''">
AND period &lt; ${citEAMAssetsDisposal.periodEnd} or period = ${citEAMAssetsDisposal.periodEnd}
</if>
<if test="citEAMAssetsDisposal.periodStart != null and citEAMAssetsDisposal.periodStart != '' and citEAMAssetsDisposal.periodEnd == null and citEAMAssetsDisposal.periodEnd != '' ">
AND period &gt; ${citEAMAssetsDisposal.periodStart} or period = ${citEAMAssetsDisposal.periodStart}
</if>
</sql>
<insert id="insertBatch" parameterType="java.util.List">
insert into cit_salary_advance
......@@ -69,4 +90,12 @@
SELECT 1 FROM DUAL;
</insert>
<select id ="selectByCondition" parameterType="pwc.taxtech.atms.entity.CitSalaryAdvance" resultType="pwc.taxtech.atms.entity.CitSalaryAdvance">
select
*
WHERE
<include refid="QueryCondition"/>
</select>
</mapper>
\ No newline at end of file
citModule.controller('citPreviewEamDisposalController', ['$scope', '$log', '$translate', '$timeout', '$compile', '$uibModal', 'apiInterceptor',
'SweetAlert', '$q', 'uiGridConstants', '$interval', 'vatSessionService', 'citSessionService', 'vatImportService', 'loginContext',
'browserService', 'enums', 'vatOperationLogService', 'citPreviewDataService', 'vatCommonService', 'ackMessageBox','commonWebService',
'browserService', 'enums', 'vatOperationLogService', 'citPreviewDataService', 'vatCommonService', 'ackMessageBox','commonWebService','vatExportService',
function ($scope, $log, $translate, $timeout, $compile, $uibModal, apiInterceptor, SweetAlert, $q, uiGridConstants,
$interval, vatSessionService, citSessionService, vatImportService, loginContext, browserService, enums, vatOperationLogService, citPreviewDataService,
vatCommonService, ackMessageBox, commonWebService) {
vatCommonService, ackMessageBox, commonWebService, vatExportService) {
'use strict';
$scope.listData = [];
var minDate = [1, vatSessionService.project.year];
var minDate = [1, 2010];
// var minDate = moment().startOf('month').subtract(0, 'months');
var maxDate = [12, vatSessionService.project.year];
var setDate = [
[vatSessionService.month, vatSessionService.project.year],
[vatSessionService.month, vatSessionService.project.year]];
var maxDate = [12, 2019];
var setDate = [[1, 2010], [12, 2019]];
$scope.monthList = [$translate.instant('Month01'),
$translate.instant('Month02'),
$translate.instant('Month03'),
......@@ -27,32 +24,6 @@
$translate.instant('Month11'),
$translate.instant('Month12')
];
/* $scope.formOptions = {
formData: salaryData,
colCount: 2,
items: [{
dataField: "FirstName",
editorOptions: {
value: ""
}
},
{
itemType: "button",
horizontalAlignment: "left",
buttonOptions: {
text: "查询",
type: "success",
useSubmitBehavior: true
}
}]
};*/
/* $scope.onFormSubmit = function(e) {//执行查询
e.preventDefault();
};*/
//初始化dx控件
function initAssetResultDxGrid() {
var dupColumns = [
......@@ -72,7 +43,7 @@
},
editing: {
mode: "batch",
allowUpdating:true,
allowUpdating:false,
},
onInitialized: function (e) {
$scope.dataGridInstance = e.component;
......@@ -102,21 +73,21 @@
},
onRowUpdating: function (e) {
},
}/*,
onToolbarPreparing: function (e) {
}
}*/
}
}
//导出数据
$scope.downloadTB = function () {
citPreviewDataService.exportData($scope.queryParams).success(function (data, status, headers) {
citPreviewDataService.exportData( $scope.queryParams).success(function (data, status, headers) {
if(status===204){
SweetAlert.warning("没有数据可以下载");
return;
}
vatExportService.exportToExcel(data, status, headers, 'EAM资产处置金额记录表.xls');
vatExportService.exportToExcel(data, status, headers, 'EAM资产处置金额记录表.xlsx', true);
}).error(function (error) {
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
});
......@@ -124,9 +95,10 @@
$scope.doDataReset = function () {
$scope.queryParams.period = "";
$scope.queryParams.compensationSaleAmount = "";
$scope.queryParams.assetLabelNumber = "";
$scope.queryParams.period = null;
$scope.queryParams.compensationSaleAmount = null;
$scope.queryParams.assetLabelNumber = null;
$scope.refreshConfigGrid();
}
$scope.doSearch = function () {
$scope.refreshConfigGrid();
......@@ -173,7 +145,18 @@
months: $scope.monthList,//['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
ConfirmBtnText: $translate.instant('Confirm'),
CancelBtnText: $translate.instant('ButtonCancel')
})
}) .on('datePicker.done', function (e, result) {
//对日期进行封装
var start = result[0][1].toString() + result[0][0];
var end =result[1][1].toString() + result[1][0];
commonWebService._dateByPicker(start, end);//转换日期
//开始月份
$scope.queryParams.periodStart = commonWebService._dateByPicker(start, end).start;
//结束月份
$scope.queryParams.periodEnd = commonWebService._dateByPicker(start, end).end;
$scope.refreshConfigGrid();
// loadCertifiedInvoicesListDataFromDB(1);
});
$scope.queryParams = {};
//分页的设置
......@@ -182,9 +165,6 @@
totalItems: 0, //总数据
pageSize: 20, //每页多少条数据
};
/* $scope.$watch('queryParams.pagingOptions',function (newValue, oldValue) {
$scope.pagingOptions = newValue;
});*/
initAssetResultDxGrid();
initListData();
......
......@@ -11,87 +11,14 @@
<span translate="EAMDisposal" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;<span class="text-bold" translate="InvoiceQJ"></span>
<input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 180px; width: 200px;" id="input-invoice-period-picker" />
<span ng-click="downloadTB()" style="position: relative; top: -61px; left: 95%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
</div>
<!-- <div class="widget-container">
<div>查询条件:</div>
<div id="form" dx-form="formOptions"></div>
</div>-->
<div class="dt-init-wrapper">
<div id="gridContainer" dx-data-grid="assetsResultGridOptions"></div>
<div class="page-footer">
<ack-pagination page-options="queryParams.pagingOptions"
refresh-table="refreshConfigGrid()"></ack-pagination>
</div>
</div>
<!-- <div class="error-list-modal">
<div class="modal fade" id="errorListModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width: 720px; height: 200px;" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
{{'ImportErrorPopUpTitle' | translate}}
</div>
</div>
<div class="modal-body">
{{'ImportErrorPopUpErrorDetail' | translate}}:
<br/>
<table>
<thead>
<tr>
<th width="10%" style="text-align:center;">{{'ImportErrorPopUpNoCol' | translate}}</th>
<th width="20%">{{'ImportErrorPopUpErrorTypeCol' | translate}}</th>
<th width="10%" style="text-align:center;">{{'ImportErrorPopUpErrorCountCol' |
translate}}
</th>
<th width="60%">{{'ImportErrorPopUpErrorDescCol' | translate}}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="error in errorMsgMap track by $index">
<td width="10%" style="text-align:center;">{{$index + 1}}</td>
<td width="20%">{{error.errorType}}</td>
<td width="10%" style="text-align:center;">{{error.errorCount}}</td>
<td width="60%" ng-bind-html="error.errorContent"></td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" translate="Confirm" data-dismiss="modal"></button>
</div>
</div>
<div class="dt-init-wrapper" style=" position: relative; top: -41px;">
<div id="gridContainer" dx-data-grid="assetsResultGridOptions"></div>
<div class="page-footer">
<ack-pagination page-options="queryParams.pagingOptions"
refresh-table="refreshConfigGrid()"></ack-pagination>
</div>
</div>
</div>-->
<!--资产分类设置界面-->
<!--<script type="text/ng-template" id="set-asset-group-modal.html">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
{{'SetAssetGroup' | translate}}
</div>
</div>
<div class="modal-body">
<div class="grid-container">
<div id="assetsGroupGrid" dx-data-grid="assetsGridOptions"
style="max-width: 760px; margin-top: -40px;">
</div>
</div>
</div>
<div class="modal-footer">
<button style="margin-left: 22px;" type="button" class="btn btn-primary" ng-click="saveAssetGroupInfo()"
ng-disabled="!hasEditPermission">{{'Confirm' | translate }}
</button>
<button type="button" class="btn btn-third" ng-click="cancelAsset()" ng-if="!isDisabled"
ng-disabled="isDisabled">{{'ButtonCancel' | translate }}
</button>
</div>
</div>
</script>-->
</div>
<vat-operate-log period="period" module-type="moduleid" is-show="isShowLog"></vat-operate-log>
</div>
\ No newline at end of file
citModule.controller('citPreviewSalaryAdvanceController', ['$scope', '$log', '$translate', '$timeout', '$compile', '$uibModal', 'apiInterceptor',
'SweetAlert', '$q', 'uiGridConstants', '$interval', 'vatSessionService', 'citSessionService', 'vatImportService', 'loginContext',
'browserService', 'enums', 'vatOperationLogService', 'citPreviewDataService', 'vatCommonService', 'ackMessageBox','commonWebService',
'browserService', 'enums', 'vatOperationLogService', 'citPreviewDataService', 'vatCommonService', 'ackMessageBox','commonWebService','vatExportService',
function ($scope, $log, $translate, $timeout, $compile, $uibModal, apiInterceptor, SweetAlert, $q, uiGridConstants,
$interval, vatSessionService, citSessionService, vatImportService, loginContext, browserService, enums, vatOperationLogService, citPreviewDataService,
vatCommonService, ackMessageBox, commonWebService) {
vatCommonService, ackMessageBox, commonWebService, vatExportService) {
'use strict';
$scope.listData = [];
/* $scope.formOptions = {
formData: salaryData,
colCount: 2,
items: [{
dataField: "FirstName",
editorOptions: {
value: ""
}
},
{
itemType: "button",
horizontalAlignment: "left",
buttonOptions: {
text: "查询",
type: "success",
useSubmitBehavior: true
}
}]
};*/
/* $scope.onFormSubmit = function(e) {//执行查询
e.preventDefault();
};*/
var minDate = [1, 2010];
// var minDate = moment().startOf('month').subtract(0, 'months');
var maxDate = [12, 2019];
var setDate = [[1, 2010], [12, 2019]];
$scope.monthList = [$translate.instant('Month01'),
$translate.instant('Month02'),
$translate.instant('Month03'),
$translate.instant('Month04'),
$translate.instant('Month05'),
$translate.instant('Month06'),
$translate.instant('Month07'),
$translate.instant('Month08'),
$translate.instant('Month09'),
$translate.instant('Month10'),
$translate.instant('Month11'),
$translate.instant('Month12')
];
//初始化dx控件
function initAssetResultDxGrid() {
......@@ -54,7 +48,7 @@
},
editing: {
mode: "batch",
allowUpdating:true,
allowUpdating:false,
},
onInitialized: function (e) {
$scope.dataGridInstance = e.component;
......@@ -91,11 +85,35 @@
}
}
//导出数据
$scope.downloadTB = function () {
citPreviewDataService.exportData( $scope.queryParams).success(function (data, status, headers) {
if(status===204){
SweetAlert.warning("没有数据可以下载");
return;
}
vatExportService.exportToExcel(data, status, headers, '预提重分类数据源.xlsx', true);
}).error(function (error) {
SweetAlert.error($translate.instant('PleaseContactAdministrator'));
});
}
$scope.doDataReset = function () {
$scope.queryParams.period = null;
$scope.queryParams.compensationSaleAmount = null;
$scope.queryParams.assetLabelNumber = null;
$scope.refreshConfigGrid();
}
$scope.doSearch = function () {
$scope.refreshConfigGrid();
}
var initListData = function(){
citPreviewDataService.getCitPreviewSalaryAdvanceDataList($scope).success(function (res) {
$scope.listData = commonWebService._index(res.list);
$scope.pagingOptions.totalItems = res.pageInfo.totalCount;
$scope.queryParams.pagingOptions.totalItems = res.pageInfo.totalCount;
//$scope.$apply();
}).error(function (error) {
swal({
......@@ -109,11 +127,11 @@
//刷新页面
$scope.refreshConfigGrid = function () {
citPreviewDataService.getCitPreviewSalaryAdvanceDataList($scope)
citPreviewDataService.getCitPreviewSalaryAdvanceDataList($scope.queryParams)
.success(function (res) {
if (res && res.list) {
$scope.listData =commonWebService._index(res.list);
$scope.pagingOptions.totalItems = res.pageInfo.totalCount;
$scope.queryParams.pagingOptions.totalItems = res.pageInfo.totalCount;
}else {
SweetAlert.error($translate.instant('SystemError'));
}
......@@ -123,9 +141,30 @@
//开始
(function initialize() {
$('#input-invoice-period-picker').focus(function () {
$('.filter-button').popover("hide");
});
//初始化month-picker
$('#input-invoice-period-picker').rangePicker({
minDate: minDate,
maxDate: maxDate,
setDate: setDate,
months: $scope.monthList,//['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
ConfirmBtnText: $translate.instant('Confirm'),
CancelBtnText: $translate.instant('ButtonCancel')
}) .on('datePicker.done', function (e, result) {
//对日期进行封装
var start = result[0][1].toString() + result[0][0];
var end =result[1][1].toString() + result[1][0];
commonWebService._dateByPicker(start, end);//转换日期
//开始月份
$scope.queryParams.periodStart = commonWebService._dateByPicker(start, end).start;
//结束月份
$scope.queryParams.periodEnd = commonWebService._dateByPicker(start, end).end;
$scope.refreshConfigGrid();
});
//分页的设置
$scope.pagingOptions = {
$scope.queryParams.pagingOptions = {
pageIndex: 1, //当前页码
totalItems: 0, //总数据
pageSize: 20, //每页多少条数据
......
<div class="cit-import-asset-list">
<div class="nav-wrapper">
<div class="nav-header">{{'citSalaryAdvance' | translate}}</div>
</div>
<!-- <div class="widget-container">
<div>查询条件:</div>
<div id="form" dx-form="formOptions"></div>
</div>-->
<div class="dx-viewport grid-container">
<div class="top-area-wrapper" style="margin-top: 10px">
<button class="filter-button"
atms-popover ng-mouseenter="prepareSummary()" ng-click="showPopover()"
popover-container="body" popover-auto-hide="true" data-overwrite="true"
use-optimized-placement-algorithm="true"
data-placement="bottom"
data-templateurl="app/cit/preview/cit-preview-salaryAdvance-list/vat-preview-salaryAdvance-search.html">
<i class="fa fa-filter" aria-hidden="true"></i>
</button>
<span translate="EAMDisposal" class="text-bold"></span> &nbsp;&nbsp;|&nbsp;&nbsp;<span class="text-bold" translate="InvoiceQJ"></span>:-->
<input type="text" class="form-control input-width-middle periodInput" style="position: relative; top: -30px; left: 180px; width: 200px;" id="input-invoice-period-picker" />
<span ng-click="downloadTB()" style=" position: absolute; z-index: 99999999; top: 14px; right: 2%;"><i class="fa fa-file-excel-o" aria-hidden="true"></i>{{'ExportBtn' | translate}}</span>
<div class="dt-init-wrapper" style=" position: relative; top: -20px;">
<div id="gridContainer" dx-data-grid="assetsResultGridOptions"></div>
<div class="page-footer">
<ack-pagination page-options="pagingOptions"
refresh-table="refreshConfigGrid()"></ack-pagination>
</div>
</div>
<!-- <div class="error-list-modal">
<div class="modal fade" id="errorListModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
data-backdrop="static" data-keyboard="false">
<div class="modal-dialog" style="width: 720px; height: 200px;" role="document">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
{{'ImportErrorPopUpTitle' | translate}}
</div>
</div>
<div class="modal-body">
{{'ImportErrorPopUpErrorDetail' | translate}}:
<br/>
<table>
<thead>
<tr>
<th width="10%" style="text-align:center;">{{'ImportErrorPopUpNoCol' | translate}}</th>
<th width="20%">{{'ImportErrorPopUpErrorTypeCol' | translate}}</th>
<th width="10%" style="text-align:center;">{{'ImportErrorPopUpErrorCountCol' |
translate}}
</th>
<th width="60%">{{'ImportErrorPopUpErrorDescCol' | translate}}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="error in errorMsgMap track by $index">
<td width="10%" style="text-align:center;">{{$index + 1}}</td>
<td width="20%">{{error.errorType}}</td>
<td width="10%" style="text-align:center;">{{error.errorCount}}</td>
<td width="60%" ng-bind-html="error.errorContent"></td>
</tr>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" translate="Confirm" data-dismiss="modal"></button>
</div>
</div>
</div>
</div>
</div>-->
<!--资产分类设置界面-->
<!--<script type="text/ng-template" id="set-asset-group-modal.html">
<div class="modal-content">
<div class="modal-header">
<div class="modal-title">
{{'SetAssetGroup' | translate}}
</div>
</div>
<div class="modal-body">
<div class="grid-container">
<div id="assetsGroupGrid" dx-data-grid="assetsGridOptions"
style="max-width: 760px; margin-top: -40px;">
</div>
</div>
</div>
<div class="modal-footer">
<button style="margin-left: 22px;" type="button" class="btn btn-primary" ng-click="saveAssetGroupInfo()"
ng-disabled="!hasEditPermission">{{'Confirm' | translate }}
</button>
<button type="button" class="btn btn-third" ng-click="cancelAsset()" ng-if="!isDisabled"
ng-disabled="isDisabled">{{'ButtonCancel' | translate }}
</button>
</div>
</div>
</script>-->
</div>
<vat-operate-log period="period" module-type="moduleid" is-show="isShowLog"></vat-operate-log>
</div>
\ No newline at end of file
<div class="popover">
<div class="arrow"></div>
<div class="popover-content">
<div>
<table class="table table-responsive">
<tr>
<td>
<span translate="period"></span>
<input class="form-control input-width-middle" placeholder="{{'period' | translate}}" type="text" id="segment3" ng-model="queryParams.period" />
</td>
</tr>
<tr>
<td>
<span translate="compensationSaleAmount"></span>
<input class="form-control input-width-middle" type="text" placeholder="{{'poSubjectName' | translate}}"id="segment3Name" ng-model="queryParams.poSubjectName" />
</td>
</tr>
</table>
</div>
<div class="row">
<div style="float:right;margin-right:10px;">
<button class="btn btn-default btn-primary" ng-click="doSearch()">
<span class="fa fa-chevron-down" aria-hidden="true"> </span> <span translate="Confirm"></span>
</button>
<button class="btn btn-default margin-right10" ng-click="doDataReset()">
<span class="fa fa-times" aria-hidden="true"> </span> <span translate="Reset"></span>
</button>
</div>
</div>
</div>
</div>
......@@ -3,7 +3,7 @@
$log.debug('vatExportService.ctor()...');
//下载服务器上的xls文件
var exportToExcel = function (data, status, headers, defaultFileName) {
var exportToExcel = function (data, status, headers, defaultFileName, noExtendFileName) {
$('#busy-indicator-container').show();
......@@ -15,7 +15,13 @@
headers = headers();
// Get the filename from the x-filename header or default to "download.bin"
var filename = decodeURI(headers['x-file-name']) + defaultFileName;
var filename = null;
if(noExtendFileName){
filename = defaultFileName
}else{
filename = decodeURI(headers['x-file-name']) + defaultFileName
}
// Determine the content type from the header or default to "application/octet-stream"
var contentType = headers['content-type'] || octetStreamMime;
......
......@@ -4,13 +4,16 @@ webservices.factory('citPreviewDataService', ['$http', 'apiConfig', function ($h
return {
//获取 预提分类数据源列表数据
getCitPreviewSalaryAdvanceDataList : function(params){
return $http.post('/citPreviewDataController/getSalaryAdvaceListData', {pageInfo: params.pagingOptions, poSubjectName : params.poSubjectName }, apiConfig.createVat());
return $http.post('/citPreviewDataController/getSalaryAdvaceListData',{pageInfo : params.pagingOptions, periodStart : params.periodStart, periodEnd : params.periodEnd, period : params.period}, apiConfig.createVat());
},
getCitPreviewEamDisposalDataList : function (params) {
return $http.post('/citPreviewDataController/getCitPreviewEamDisposalDataList', {pageInfo: params.pagingOptions}, apiConfig.createVat());
return $http.post('/citPreviewDataController/getCitPreviewEamDisposalDataList', {pageInfo : params.pagingOptions, periodStart : params.periodStart, periodEnd : params.periodEnd, organizationId : params.organizationId, period : params.period, compensationSaleAmount: params.compensationSaleAmount, assetLabelNumber : params.assetLabelNumber}, apiConfig.createVat());
},
exportData: function (params) {
return $http.post('/citPreviewDataController/exportDataEAM', params, apiConfig.create({ responseType: 'arraybuffer' }));
},
exportDataSalaryAdvance : function (params) {
return $http.post('/citPreviewDataController/exportDataSalaryAdvance', params, apiConfig.create({ responseType: 'arraybuffer' }));
}
};
}]);
\ No newline at end of file
......@@ -359,10 +359,32 @@ webservices.factory('commonWebService', ['$http', 'apiConfig', 'loginContext', '
_index :function (data) {
var index = 1;
for(var i in data){
i.index = index;
data[i].index = index;
index++;
}
return data;
},
_dateByPicker : function (start, end) {
if(end){
var _sp = end.toString().slice(4);
if(_sp.length != 2){
_sp = "0" + _sp;
};
end = end.toString().substring(0, 4) +_sp;
}
if(start){
var _sp = start.toString().slice(4);
if(start.length != 2){
_sp = "0" + _sp;
};
start = start.toString().substring(0, 4) +_sp;
}
return {
start : start,
end : end
}
}
};
}]);
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment