Commit 51830c7a by 王军业

【更改导入模板相关】

1 parent 573d464b
......@@ -5,6 +5,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import com.vion.financial.handler.DownLoad;
......@@ -14,6 +15,7 @@ import com.vion.financial.handler.ImportHandle;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.servlet.http.HttpServletResponse;
......@@ -26,6 +28,7 @@ import org.springframework.web.multipart.MultipartFile;
import com.vion.financial.config.FinanceConfig;
import com.vion.financial.entity.Appendix;
import com.vion.financial.entity.Contract;
import com.vion.financial.entity.Customer;
import com.vion.financial.entity.DeliverGoods;
import com.vion.financial.entity.PaymentAgree;
......@@ -89,7 +92,7 @@ public class ContractServiceImpl implements ContractService {
ReceiptMapper receiptMapper;
@Autowired
ProjectAcceptancMapper ProjectAcceptancMapper;
ProjectAcceptancMapper projectAcceptancMapper;
@Autowired
DeliverGoodsMapper deliverGoodsMapper;
......@@ -623,7 +626,7 @@ public class ContractServiceImpl implements ContractService {
}
boolean is_repeat=true;
String authorization="";
List<String> repeatListId=new ArrayList<String>();
Set<String> repeatListId=new HashSet<String>();
if(list.get(1).size()==0) {
List<Map> list_data = null;
String url = financeConfig.getAuthurl();
......@@ -885,20 +888,21 @@ public class ContractServiceImpl implements ContractService {
projectAcceptanc_end.setAcceptanc_date(importModel.getEnd_acceptanc_date());
projectAcceptanc_end.setAcceptanc_note(importModel.getEnd_acceptanc_note());
}
if(contractMapper.queryOne(contractVo.getContract_unid())==null && importModel.getSalesperson_name()!=null) {
ContractVo contracto=contractMapper.queryOne(contractVo.getContract_unid());
if(contracto==null ) {
contractMapper.addOne(contractVo);
if(paymentAgreeMapper.queryPaymentAgree(importModel.getContract_unid()).size()==0 ) {
//if(paymentAgreeMapper.queryPaymentAgree(importModel.getContract_unid()).size()==0 ) {
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) {
ProjectAcceptancMapper.addProjectAcceptanc(projectAcceptanc_pre);
if(projectAcceptanc_pre.getContract_unid() != null && (projectAcceptanc_pre.getAcceptanc_date()!=null ||projectAcceptanc_pre.getAcceptanc_note()!=null ||projectAcceptanc_pre.getAcceptanc_type()!=null)) {
projectAcceptancMapper.addProjectAcceptanc(projectAcceptanc_pre);
}
if(projectAcceptanc_end.getContract_unid() != null) {
ProjectAcceptancMapper.addProjectAcceptanc(projectAcceptanc_end);
if(projectAcceptanc_end.getContract_unid() != null && (projectAcceptanc_end.getAcceptanc_date()!=null ||projectAcceptanc_end.getAcceptanc_note()!=null ||projectAcceptanc_end.getAcceptanc_type()!=null)) {
projectAcceptancMapper.addProjectAcceptanc(projectAcceptanc_end);
}
if(pre_aymentAgree.getPayment_propority()!=null ||pre_aymentAgree.getPayment_requirement()!=null||pre_aymentAgree.getDays()!=null) {
paymentAgreeMapper.addPaymentAgree(pre_aymentAgree);
......@@ -915,20 +919,53 @@ public class ContractServiceImpl implements ContractService {
if(deliverGoods.getDeliver_goods_date()!=null || deliverGoods.getGoods_acceptanc_date()!=null) {
deliverGoodsMapper.addDeliverGoods(deliverGoods);
}
continue;
//}
}else {
if(importModel.getSalesperson_name()!=null && contracto!=null) {
is_repeat=false;
repeatListId.add(contractVo.getContract_unid());
}
}else if(paymentAgreeMapper.queryPaymentAgree(importModel.getContract_unid()).size()==0 ){
}
//else {} if(paymentAgreeMapper.queryPaymentAgree(importModel.getContract_unid()).size()==0 ){
if( returnInfoMapper.queryReturnInfo(importModel.getContract_unid()).size()==0) {
if(returnInfo.getReback_date()!=null ||returnInfo.getActual_reback_amount()!=null ||returnInfo.getReback_note()!=null) {
returnInfoMapper.addReturnInfo(returnInfo);
}
}else {
if(importModel.getReback_date()!=null ||importModel.getReback_amount()!=null ||importModel.getReback_note()!=null) {
is_repeat=false;
repeatListId.add(contractVo.getContract_unid());
}
}
if( receiptMapper.queryReceipt(importModel.getContract_unid()).size()==0) {
if(receipt.getReceipt_amount()!=null||receipt.getOa_flow_id()!=null||receipt.getReceipt_note()!=null) {
receiptMapper.addReceipt(receipt);
}
if(projectAcceptanc_pre.getContract_unid() != null) {
ProjectAcceptancMapper.addProjectAcceptanc(projectAcceptanc_pre);
}else {
if(importModel.getReceipt_amount()!=null||importModel.getOa_flow_id()!=null||importModel.getReceipt_note()!=null) {
is_repeat=false;
repeatListId.add(contractVo.getContract_unid());
}
if(projectAcceptanc_end.getContract_unid() != null) {
ProjectAcceptancMapper.addProjectAcceptanc(projectAcceptanc_end);
}
if(/*projectAcceptanc_pre.getContract_unid() != null && projectAcceptanc_end.getContract_unid() != null &&*/ projectAcceptancMapper.queryProjectAcceptanc(importModel.getContract_unid()).size()==0) {
if(projectAcceptanc_pre.getAcceptanc_date()!=null ||projectAcceptanc_pre.getAcceptanc_note()!=null ||projectAcceptanc_pre.getAcceptanc_type()!=null) {
projectAcceptancMapper.addProjectAcceptanc(projectAcceptanc_pre);
}
if(projectAcceptanc_end.getAcceptanc_date()!=null ||projectAcceptanc_end.getAcceptanc_note()!=null ||projectAcceptanc_end.getAcceptanc_type()!=null) {
projectAcceptancMapper.addProjectAcceptanc(projectAcceptanc_end);
}
}else {
if(importModel.getPre_acceptanc_date()!=null ||importModel.getPre_acceptanc_note()!=null ||importModel.getPre_acceptanc()!=null ||
importModel.getEnd_acceptanc_date()!=null ||importModel.getEnd_acceptanc_note()!=null ||importModel.getEnd_acceptanc()!=null) {
is_repeat=false;
repeatListId.add(contractVo.getContract_unid());
}
}
/* if(projectAcceptanc_end.getContract_unid() != null && projectAcceptancMapper.queryProjectAcceptanc(importModel.getContract_unid()).size()==0) {
projectAcceptancMapper.addProjectAcceptanc(projectAcceptanc_end);
}*/
if(paymentAgreeMapper.queryPaymentAgree(importModel.getContract_unid()).size()==0) {
if(pre_aymentAgree.getPayment_propority()!=null ||pre_aymentAgree.getPayment_requirement()!=null||pre_aymentAgree.getDays()!=null) {
paymentAgreeMapper.addPaymentAgree(pre_aymentAgree);
}
......@@ -941,14 +978,45 @@ public class ContractServiceImpl implements ContractService {
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);
}else {
if(importModel.getAdvance_payment_propority()!=null ||importModel.getAdvance_payment_requirement()!=null||importModel.getAdvance_payment_days()!=null
|| importModel.getArrival_payment_propority()!=null ||importModel.getArrival_payment_requirement()!=null||importModel.getArrival_payment_days()!=null
||importModel.getAcceptanc_payment_propority()!=null ||importModel.getAcceptanc_payment_requirement()!=null||importModel.getAcceptanc_payment_days()!=null
||importModel.getMainten_payment_propority()!=null ||importModel.getMainten_payment_requirement()!=null||importModel.getMainten_payment_days()!=null) {
is_repeat=false;
repeatListId.add(contractVo.getContract_unid());
}
}
/* if(pre_aymentAgree.getPayment_propority()!=null ||pre_aymentAgree.getPayment_requirement()!=null||pre_aymentAgree.getDays()!=null) {
paymentAgreeMapper.addPaymentAgree(pre_aymentAgree);
}
if(arrival_aymentAgree.getPayment_propority()!=null ||arrival_aymentAgree.getPayment_requirement()!=null||arrival_aymentAgree.getDays()!=null) {
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);
}*/
if(deliverGoodsMapper.queryDeliverGoods(importModel.getContract_unid()).size()==0) {
if(deliverGoods.getDeliver_goods_date()!=null ||deliverGoods.getGoods_acceptanc_date()!=null) {
deliverGoodsMapper.addDeliverGoods(deliverGoods);
}
else {
}else {
if(importModel.getDeliver_date()!=null || importModel.getGoods_acceptanc_date()!=null) {
is_repeat=false;
repeatListId.add(contractVo.getContract_unid());
}
}
//}
/* else {
is_repeat=false;
repeatListId.add(contractVo.getContract_unid());
}*/
}if(!is_repeat) {
return repeatListId;
}else {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!