Commit f2dc7ec6 by 王军业

1121412041

1 parent 3889f5bf
......@@ -2,6 +2,8 @@ package com.vion.financial.excel;
import java.util.Date;
import javax.validation.constraints.Max;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.ExceptionHandler;
......@@ -98,6 +100,7 @@ public class ImportModel {
@Excel(name="合同备注")
private String contract_note;
@Excel(name="预付款天数")
@Max(value=30)
private Integer advance_payment_days;
@Excel(name="预付款比例")
private Double advance_payment_propority;
......
/*package com.vion.financial.handler;
package com.vion.financial.handler;
import java.io.IOException;
import java.util.ArrayList;
......@@ -17,6 +17,7 @@ import cn.afterturn.easypoi.handler.inter.IExcelDataHandler;
public class ImportExcel {
private static final Logger log=LoggerFactory.getLogger(ImportExcel.class);
public Boolean flag=true;
public List<ImportModel> Import(MultipartFile file) throws IOException, Exception {
ImportParams importParams = new ImportParams();
IExcelDataHandler<ImportModel> handle=new ImportHandle();
......@@ -30,6 +31,9 @@ public class ImportExcel {
log.info("是否存在验证未通过的数据:"+result.isVerfiyFail());
log.info("验证通过的数量:"+successList.size());
log.info("验证未通过的数量"+failList.size());
if(failList.size()!=0) {
flag=false;
}
for(ImportModel importModel:successList) {
log.info("导入成功数据,编号="+importModel.getContract_unid()+";签订时间="+importModel.getSign_date());
......@@ -38,12 +42,12 @@ public class ImportExcel {
log.info("导入失败数据,编号"+importModel.getContract_unid());
}
if(failList.size()==0) {
/* if(failList.size()==0) {
return successList;
}
ImportModel flag=new ImportModel();
flag.setContract_unid("数据格式出错");
successList.add(flag);
successList.add(flag);*/
return successList;
}
}*/
}
......@@ -391,13 +391,16 @@
and
contract_amount <![CDATA[<=]]> #{amount_end_point}
</if>
<if test="overdays_start_point !=null">
<if test="overdays_start_point !=null and overdays_end_point == null">
and
<!--逾期天数-->contract_unid in (select over_days_view.contract_unid from over_days_view where over_days <![CDATA[>=]]> #{overdays_start_point})
</if>
<if test="overdays_end_point !=null ">
<if test="overdays_start_point !=null and overdays_end_point !=null ">
and
<!--逾期天数-->contract_unid in (select over_days_view.contract_unid from over_days_view where over_days <![CDATA[<=]]> #{overdays_end_point})
<!--逾期天数-->contract_unid in (select over_days_view.contract_unid from over_days_view where over_days <![CDATA[>=]]> #{overdays_start_point} and over_days <![CDATA[<=]]> #{overdays_end_point})
</if>
<if test="overdays_start_point ==null and overdays_end_point !=null">
contract_unid in (select over_days_view.contract_unid from over_days_view where over_days <![CDATA[<=]]> #{overdays_end_point})
</if>
<if test="leave_amount_start_point !=null ">
<!--应收款余额-->and
......@@ -678,13 +681,24 @@
and
contract_amount <![CDATA[<=]]> #{amount_end_point}
</if>
<if test="overdays_start_point !=null ">
<!-- <if test="overdays_start_point !=null ">
and
<!--逾期天数-->contract_unid in (select over_days_view.contract_unid from over_days_view where over_days <![CDATA[>=]]> #{overdays_start_point})
逾期天数contract_unid in (select over_days_view.contract_unid from over_days_view where over_days <![CDATA[>=]]> #{overdays_start_point})
</if>
<if test="overdays_end_point !=null ">
and
<!--逾期天数-->contract_unid in (select over_days_view.contract_unid from over_days_view where over_days <![CDATA[<=]]> #{overdays_end_point})
逾期天数contract_unid in (select over_days_view.contract_unid from over_days_view where over_days <![CDATA[<=]]> #{overdays_end_point})
</if> -->
<if test="overdays_start_point !=null and overdays_end_point == null">
and
<!--逾期天数-->contract_unid in (select over_days_view.contract_unid from over_days_view where over_days <![CDATA[>=]]> #{overdays_start_point})
</if>
<if test="overdays_start_point !=null and overdays_end_point !=null ">
and
<!--逾期天数-->contract_unid in (select over_days_view.contract_unid from over_days_view where over_days <![CDATA[>=]]> #{overdays_start_point} and over_days <![CDATA[<=]]> #{overdays_end_point})
</if>
<if test="overdays_start_point ==null and overdays_end_point !=null">
contract_unid in (select over_days_view.contract_unid from over_days_view where over_days <![CDATA[<=]]> #{overdays_end_point})
</if>
<if test="leave_amount_start_point !=null ">
<!--应收款余额-->and
......
......@@ -7,6 +7,7 @@ import java.util.Date;
import java.util.Iterator;
import com.vion.financial.handler.DownLoad;
import com.vion.financial.handler.ImportExcel;
//import com.vion.financial.handler.ImportExcel;
import com.vion.financial.handler.ImportHandle;
......@@ -577,7 +578,7 @@ public class ContractServiceImpl implements ContractService {
public Object importExcel(MultipartFile file) {
//ImportExcel importExcel = new ImportExcel();
try {
ImportParams importParams = new ImportParams();
/* ImportParams importParams = new ImportParams();
IExcelDataHandler<ImportModel> handle=new ImportHandle();
handle.setNeedHandlerFields(new String[] {"合同编号"});
importParams.setDataHanlder(handle);
......@@ -595,13 +596,15 @@ public class ContractServiceImpl implements ContractService {
}
for(ImportModel importModel:failList) {
logger.info("导入失败数据,编号"+importModel.getContract_unid());
}
}*/
/* List<ImportModel> successList=importExcel.Import(file);
ImportModel impor=null;*/
Boolean flag=true;
if(failList.size()==0) {
ImportExcel importExcel = new ImportExcel();
List<ImportModel> successList=importExcel.Import(file);
/* Boolean flag=true;
if(importExcel.flag) {
flag=false;
}
}*/
/* Iterator iterator=successList.iterator();
while(iterator.hasNext()) {
impor= (ImportModel) iterator.next();
......@@ -609,7 +612,12 @@ public class ContractServiceImpl implements ContractService {
flag = false;
}
}*/
if(flag) {
String s="s";
if(importExcel.flag) {
s=s+"!";
logger.info(s);
}
if(importExcel.flag) {
ContractVo contractVo = null;
ReturnInfo returnInfo=null;
Receipt receipt=null;
......@@ -675,6 +683,7 @@ public class ContractServiceImpl implements ContractService {
contractVo.setProvince_name(importModel.getProvince_name());
contractVo.setCity_name(importModel.getCity_name());
contractVo.setCounty_name(importModel.getCounty_name());
if(importModel.getProject_name()!=null) {
if(projectMapper.selectByName(importModel.getProject_name())!=null) {
contractVo.setProject_unid(projectMapper.selectByName(importModel.getProject_name()).getProject_unid());
}else {
......@@ -682,6 +691,8 @@ public class ContractServiceImpl implements ContractService {
projectMapper.addProject(project);
contractVo.setProject_unid(projectMapper.selectByName(importModel.getProject_name()).getProject_unid());
}
}
if(importModel.getCustomer_name()!=null) {
if(customerMapper.selectByName(importModel.getCustomer_name())!=null) {
contractVo.setCustomer_unid(customerMapper.selectByName(importModel.getCustomer_name()).getCustomer_unid());
}else {
......@@ -689,6 +700,7 @@ public class ContractServiceImpl implements ContractService {
customerMapper.addCustomer(customer);
contractVo.setCustomer_unid(customerMapper.selectByName(importModel.getCustomer_name()).getCustomer_unid());
}
}
contractVo.setContract_amount(importModel.getContract_amount());
contractVo.setStop_amount(importModel.getStop_amount());
contractVo.setBad_amount(importModel.getBad_amount());
......@@ -824,9 +836,9 @@ public class ContractServiceImpl implements ContractService {
deliverGoods.setContract_unid(importModel.getContract_unid());
mainten_aymentAgree.setContract_unid(importModel.getContract_unid());
if(importModel.getMainten_payment_type().equals("1")) {
if("1".equals(importModel.getMainten_payment_type())) {
mainten_aymentAgree.setPayment_type("100004");
}else if(importModel.getMainten_payment_type().equals("2")) {
}else if("2".equals(importModel.getMainten_payment_type())) {
mainten_aymentAgree.setPayment_type("100005");
}
mainten_aymentAgree.setPayment_progress(4);
......@@ -891,7 +903,7 @@ public class ContractServiceImpl implements ContractService {
}
return successCode;
}
return failList;
return successList;
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
......
......@@ -37,9 +37,9 @@ mybatis:
logging:
level:
root: DEBUG
root: INFO
pattern:
level: DEBUG
level: INFO
console: "[financial_serv]-[%d{yyyy-MM-dd HH:mm:ss.SSS}]-%m%n"
path: F:\LOG\
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!