Commit 3889f5bf by 谢明辉

Merge branch 'develop' of http://192.168.9.26/platform/finance_serv into develop

2 parents 2a5c58e5 c8523f6d
package com.vion.financial.entity; package com.vion.financial.entity;
public class PaymentAgree { public class PaymentAgree {
private int payment_unid; private int payment_unid;
private String contract_unid; private String contract_unid;
private String payment_type; private String payment_type;
private int payment_progress; private int payment_progress;
private int days; private Integer days;
private double payment_propority; private Double payment_propority;
private String payment_requirement; private String payment_requirement;
public int getPayment_unid() { public int getPayment_unid() {
return payment_unid; return payment_unid;
} }
public void setPayment_unid(int payment_unid) { public void setPayment_unid(int payment_unid) {
this.payment_unid = payment_unid; this.payment_unid = payment_unid;
} }
public String getContract_unid() { public String getContract_unid() {
return contract_unid; return contract_unid;
} }
public void setContract_unid(String contract_unid) { public void setContract_unid(String contract_unid) {
this.contract_unid = contract_unid; this.contract_unid = contract_unid;
} }
public String getPayment_type() { public String getPayment_type() {
return payment_type; return payment_type;
} }
public void setPayment_type(String payment_type) { public void setPayment_type(String payment_type) {
this.payment_type = payment_type; this.payment_type = payment_type;
} }
public int getPayment_progress() { public int getPayment_progress() {
return payment_progress; return payment_progress;
} }
public void setPayment_progress(int payment_progress) { public void setPayment_progress(int payment_progress) {
this.payment_progress = payment_progress; this.payment_progress = payment_progress;
} }
public int getDays() {
return days; public Integer getDays() {
} return days;
public void setDays(int days) { }
this.days = days; public void setDays(Integer days) {
} this.days = days;
public double getPayment_propority() { }
return payment_propority; public Double getPayment_propority() {
} return payment_propority;
public void setPayment_propority(double payment_propority) { }
this.payment_propority = payment_propority; public void setPayment_propority(Double payment_propority) {
} this.payment_propority = payment_propority;
public String getPayment_requirement() { }
return payment_requirement; public String getPayment_requirement() {
} return payment_requirement;
public void setPayment_requirement(String payment_requirement) { }
this.payment_requirement = payment_requirement; public void setPayment_requirement(String payment_requirement) {
} this.payment_requirement = payment_requirement;
}
}
}
package com.vion.financial.entity; package com.vion.financial.entity;
import java.util.Date; import java.util.Date;
public class Receipt { public class Receipt {
private int receipt_unid; private int receipt_unid;
private String contract_unid; private String contract_unid;
private int receipt_progress; private int receipt_progress;
private double receipt_amount; private Double receipt_amount;
private String oa_flow_id; private String oa_flow_id;
private String receipt_note; private String receipt_note;
private Date create_date; private Date create_date;
public int getReceipt_unid() { public int getReceipt_unid() {
return receipt_unid; return receipt_unid;
} }
public void setReceipt_unid(int receipt_unid) { public void setReceipt_unid(int receipt_unid) {
this.receipt_unid = receipt_unid; this.receipt_unid = receipt_unid;
} }
public String getContract_unid() { public String getContract_unid() {
return contract_unid; return contract_unid;
} }
public void setContract_unid(String contract_unid) { public void setContract_unid(String contract_unid) {
this.contract_unid = contract_unid; this.contract_unid = contract_unid;
} }
public int getReceipt_progress() { public int getReceipt_progress() {
return receipt_progress; return receipt_progress;
} }
public void setReceipt_progress(int receipt_progress) { public void setReceipt_progress(int receipt_progress) {
this.receipt_progress = receipt_progress; this.receipt_progress = receipt_progress;
} }
public double getReceipt_amount() {
return receipt_amount; public Double getReceipt_amount() {
} return receipt_amount;
public void setReceipt_amount(double receipt_amount) { }
this.receipt_amount = receipt_amount; public void setReceipt_amount(Double receipt_amount) {
} this.receipt_amount = receipt_amount;
public String getOa_flow_id() { }
return oa_flow_id; public String getOa_flow_id() {
} return oa_flow_id;
public void setOa_flow_id(String oa_flow_id) { }
this.oa_flow_id = oa_flow_id; public void setOa_flow_id(String oa_flow_id) {
} this.oa_flow_id = oa_flow_id;
public String getReceipt_note() { }
return receipt_note; public String getReceipt_note() {
} return receipt_note;
public void setReceipt_note(String receipt_note) { }
this.receipt_note = receipt_note; public void setReceipt_note(String receipt_note) {
} this.receipt_note = receipt_note;
public Date getCreate_date() { }
return create_date; public Date getCreate_date() {
} return create_date;
public void setCreate_date(Date create_date) { }
this.create_date = create_date; public void setCreate_date(Date create_date) {
} this.create_date = create_date;
}
}
}
...@@ -10,7 +10,7 @@ public class ReturnInfo { ...@@ -10,7 +10,7 @@ public class ReturnInfo {
private String contract_unid; private String contract_unid;
private int reback_progress; private int reback_progress;
private Date reback_date; private Date reback_date;
private double actual_reback_amount; private Double actual_reback_amount;
private String reback_note; private String reback_note;
public int getReback_unid() { public int getReback_unid() {
return reback_unid; return reback_unid;
...@@ -37,10 +37,11 @@ public class ReturnInfo { ...@@ -37,10 +37,11 @@ public class ReturnInfo {
public void setReback_date(Date reback_date) { public void setReback_date(Date reback_date) {
this.reback_date = reback_date; this.reback_date = reback_date;
} }
public double getActual_reback_amount() {
public Double getActual_reback_amount() {
return actual_reback_amount; return actual_reback_amount;
} }
public void setActual_reback_amount(double actual_reback_amount) { public void setActual_reback_amount(Double actual_reback_amount) {
this.actual_reback_amount = actual_reback_amount; this.actual_reback_amount = actual_reback_amount;
} }
public String getReback_note() { public String getReback_note() {
......
package com.vion.financial.handler; /*package com.vion.financial.handler;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -26,17 +26,24 @@ public class ImportExcel { ...@@ -26,17 +26,24 @@ public class ImportExcel {
ExcelImportResult<ImportModel> result=ExcelImportUtil.importExcelMore(file.getInputStream(), ImportModel.class, importParams); ExcelImportResult<ImportModel> result=ExcelImportUtil.importExcelMore(file.getInputStream(), ImportModel.class, importParams);
List<ImportModel> successList=result.getList(); List<ImportModel> successList=result.getList();
List<ImportModel> failList=result.getFailList(); List<ImportModel> failList=result.getFailList();
log.info("是否存在验证未通过的数据:"+result.isVerfiyFail()); log.info("是否存在验证未通过的数据:"+result.isVerfiyFail());
log.info("验证通过的数量:"+successList.size()); log.info("验证通过的数量:"+successList.size());
log.info("验证未通过的数量"+failList.size()); log.info("验证未通过的数量"+failList.size());
for(ImportModel importModel:successList) { for(ImportModel importModel:successList) {
log.info("导入成功数据,编号="+importModel.getContract_unid()+";签订时间="+importModel.getSign_date()); log.info("导入成功数据,编号="+importModel.getContract_unid()+";签订时间="+importModel.getSign_date());
} }
for(ImportModel importModel:failList) { for(ImportModel importModel:failList) {
log.info("导入失败数据,编号"+importModel.getContract_unid()); log.info("导入失败数据,编号"+importModel.getContract_unid());
} }
if(failList.size()==0) {
return successList;
}
ImportModel flag=new ImportModel();
flag.setContract_unid("数据格式出错");
successList.add(flag);
return successList; return successList;
} }
} }*/
...@@ -526,13 +526,16 @@ ...@@ -526,13 +526,16 @@
and and
contract_amount <![CDATA[<=]]> #{amount_end_point} contract_amount <![CDATA[<=]]> #{amount_end_point}
</if> </if>
<if test="overdays_start_point !=null "> <if test="overdays_start_point !=null and overdays_end_point == null">
and 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>
<if test="overdays_end_point !=null "> <if test="overdays_start_point !=null and overdays_end_point !=null ">
and 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>
<if test="leave_amount_start_point !=null "> <if test="leave_amount_start_point !=null ">
<!--应收款余额-->and <!--应收款余额-->and
......
...@@ -4,9 +4,11 @@ import java.io.IOException; ...@@ -4,9 +4,11 @@ import java.io.IOException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.Iterator;
import com.vion.financial.handler.DownLoad; import com.vion.financial.handler.DownLoad;
import com.vion.financial.handler.ImportExcel; //import com.vion.financial.handler.ImportExcel;
import com.vion.financial.handler.ImportHandle;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -50,6 +52,11 @@ import com.vion.financial.vo.ResultVo; ...@@ -50,6 +52,11 @@ import com.vion.financial.vo.ResultVo;
import com.vion.financial.vo.SelectVo; import com.vion.financial.vo.SelectVo;
import com.vion.financial.vo.SuccessCode; import com.vion.financial.vo.SuccessCode;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
import cn.afterturn.easypoi.excel.entity.ImportParams;
import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
import cn.afterturn.easypoi.handler.inter.IExcelDataHandler;
@Service @Service
public class ContractServiceImpl implements ContractService { public class ContractServiceImpl implements ContractService {
Logger logger = LoggerFactory.getLogger(ContractServiceImpl.class); Logger logger = LoggerFactory.getLogger(ContractServiceImpl.class);
...@@ -507,7 +514,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -507,7 +514,7 @@ public class ContractServiceImpl implements ContractService {
exportModel.setProduct_line_type_name("智慧商业"); exportModel.setProduct_line_type_name("智慧商业");
break; break;
case "20003" : case "20003" :
exportModel.setProduct_line_type_name("其"); exportModel.setProduct_line_type_name("其");
break; break;
/* case "20004" : /* case "20004" :
exportModel.setProduct_line_type_name("维保"); exportModel.setProduct_line_type_name("维保");
...@@ -568,9 +575,41 @@ public class ContractServiceImpl implements ContractService { ...@@ -568,9 +575,41 @@ public class ContractServiceImpl implements ContractService {
@Override @Override
public Object importExcel(MultipartFile file) { public Object importExcel(MultipartFile file) {
ImportExcel importExcel = new ImportExcel(); //ImportExcel importExcel = new ImportExcel();
try { try {
List<ImportModel> successList=importExcel.Import(file); ImportParams importParams = new ImportParams();
IExcelDataHandler<ImportModel> handle=new ImportHandle();
handle.setNeedHandlerFields(new String[] {"合同编号"});
importParams.setDataHanlder(handle);
importParams.setNeedVerfiy(true);
ExcelImportResult<ImportModel> resultList=ExcelImportUtil.importExcelMore(file.getInputStream(), ImportModel.class, importParams);
List<ImportModel> successList=resultList.getList();
List<ImportModel> failList=resultList.getFailList();
logger.info("是否存在验证未通过的数据:"+resultList.isVerfiyFail());
logger.info("验证通过的数量:"+successList.size());
logger.info("验证未通过的数量"+failList.size());
for(ImportModel importModel:successList) {
logger.info("导入成功数据,编号="+importModel.getContract_unid()+";签订时间="+importModel.getSign_date());
}
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) {
flag=false;
}
/* Iterator iterator=successList.iterator();
while(iterator.hasNext()) {
impor= (ImportModel) iterator.next();
if(impor.getContract_unid().equals("数据格式出错")) {
flag = false;
}
}*/
if(flag) {
ContractVo contractVo = null; ContractVo contractVo = null;
ReturnInfo returnInfo=null; ReturnInfo returnInfo=null;
Receipt receipt=null; Receipt receipt=null;
...@@ -584,9 +623,9 @@ public class ContractServiceImpl implements ContractService { ...@@ -584,9 +623,9 @@ public class ContractServiceImpl implements ContractService {
PaymentAgree mainten_aymentAgree=null; PaymentAgree mainten_aymentAgree=null;
DeliverGoods deliverGoods=null; DeliverGoods deliverGoods=null;
for(ImportModel importModel:successList) { for(ImportModel importModel:successList) {
if(contractMapper.queryOne(importModel.getContract_unid())!=null) { /*if(contractMapper.queryOne(importModel.getContract_unid())!=null) {
contractMapper.actualDeleteOne(importModel.getContract_unid()); contractMapper.actualDeleteOne(importModel.getContract_unid());
} }*/
contractVo=new ContractVo(); contractVo=new ContractVo();
returnInfo=new ReturnInfo(); returnInfo=new ReturnInfo();
receipt=new Receipt(); receipt=new Receipt();
...@@ -611,7 +650,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -611,7 +650,7 @@ public class ContractServiceImpl implements ContractService {
case "智慧商业" : case "智慧商业" :
contractVo.setProduct_line_type("20002"); contractVo.setProduct_line_type("20002");
break; break;
case "其" : case "其" :
contractVo.setProduct_line_type("20003"); contractVo.setProduct_line_type("20003");
break; break;
/* case "维保" : /* case "维保" :
...@@ -628,7 +667,7 @@ public class ContractServiceImpl implements ContractService { ...@@ -628,7 +667,7 @@ public class ContractServiceImpl implements ContractService {
list_data = (List<Map>) map.get("list_data"); list_data = (List<Map>) map.get("list_data");
if(list_data != null && list_data.size() > 0) { if(list_data != null && list_data.size() > 0) {
for(Map _map:list_data) { for(Map _map:list_data) {
if(importModel.getSalesperson_name().equals(_map.get("name"))) { if(importModel.getSalesperson_name()!=null && importModel.getSalesperson_name().equals(_map.get("name"))) {
contractVo.setSalesperson_unid(_map.get("user_unid").toString()); contractVo.setSalesperson_unid(_map.get("user_unid").toString());
} }
} }
...@@ -817,22 +856,42 @@ public class ContractServiceImpl implements ContractService { ...@@ -817,22 +856,42 @@ public class ContractServiceImpl implements ContractService {
projectAcceptanc_end.setAcceptanc_date(importModel.getEnd_acceptanc_date()); projectAcceptanc_end.setAcceptanc_date(importModel.getEnd_acceptanc_date());
projectAcceptanc_end.setAcceptanc_note(importModel.getEnd_acceptanc_note()); projectAcceptanc_end.setAcceptanc_note(importModel.getEnd_acceptanc_note());
} }
contractMapper.addOne(contractVo); if(contractMapper.queryOne(contractVo.getContract_unid())==null) {
returnInfoMapper.addReturnInfo(returnInfo); contractMapper.addOne(contractVo);
receiptMapper.addReceipt(receipt); }else {
contractMapper.updateOne(contractVo);
}
if(returnInfo.getReback_date()!=null ||returnInfo.getActual_reback_amount()!=null ||returnInfo.getReback_note()!=null) {
returnInfoMapper.addReturnInfo(returnInfo);
}
if(receipt.getReceipt_amount()!=null||receipt.getOa_flow_id()!=null||receipt.getReceipt_note()!=null) {
receiptMapper.addReceipt(receipt);
}
if(projectAcceptanc_pre.getContract_unid() != null) { if(projectAcceptanc_pre.getContract_unid() != null) {
ProjectAcceptancMapper.addProjectAcceptanc(projectAcceptanc_pre); ProjectAcceptancMapper.addProjectAcceptanc(projectAcceptanc_pre);
} }
if(projectAcceptanc_end.getContract_unid() != null) { if(projectAcceptanc_end.getContract_unid() != null) {
ProjectAcceptancMapper.addProjectAcceptanc(projectAcceptanc_end); ProjectAcceptancMapper.addProjectAcceptanc(projectAcceptanc_end);
} }
paymentAgreeMapper.addPaymentAgree(pre_aymentAgree); if(pre_aymentAgree.getPayment_propority()!=null ||pre_aymentAgree.getPayment_requirement()!=null||pre_aymentAgree.getDays()!=null) {
paymentAgreeMapper.addPaymentAgree(arrival_aymentAgree); paymentAgreeMapper.addPaymentAgree(pre_aymentAgree);
paymentAgreeMapper.addPaymentAgree(acceptanc_aymentAgree); }
paymentAgreeMapper.addPaymentAgree(mainten_aymentAgree); if(arrival_aymentAgree.getPayment_propority()!=null ||arrival_aymentAgree.getPayment_requirement()!=null||arrival_aymentAgree.getDays()!=null) {
deliverGoodsMapper.addDeliverGoods(deliverGoods); paymentAgreeMapper.addPaymentAgree(arrival_aymentAgree);
}
if(acceptanc_aymentAgree.getPayment_propority()!=null ||acceptanc_aymentAgree.getPayment_requirement()!=null||acceptanc_aymentAgree.getDays()!=null) {
paymentAgreeMapper.addPaymentAgree(acceptanc_aymentAgree);
}
if(mainten_aymentAgree.getPayment_propority()!=null ||mainten_aymentAgree.getPayment_requirement()!=null||mainten_aymentAgree.getDays()!=null) {
paymentAgreeMapper.addPaymentAgree(mainten_aymentAgree);
}
if(deliverGoods.getDeliver_goods_date()!=null || deliverGoods.getGoods_acceptanc_date()!=null) {
deliverGoodsMapper.addDeliverGoods(deliverGoods);
}
} }
return successList; return successCode;
}
return failList;
} catch (IOException e) { } catch (IOException e) {
// TODO Auto-generated catch block // TODO Auto-generated catch block
e.printStackTrace(); e.printStackTrace();
...@@ -844,5 +903,4 @@ public class ContractServiceImpl implements ContractService { ...@@ -844,5 +903,4 @@ public class ContractServiceImpl implements ContractService {
failCode.setEnote("导入异常"); failCode.setEnote("导入异常");
return failCode; return failCode;
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!