diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/controller/ContractMobileController.java b/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/controller/ContractMobileController.java index 1e6abdc1..859cb230 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/controller/ContractMobileController.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/controller/ContractMobileController.java @@ -6,10 +6,9 @@ import jnpf.base.ActionResult; import jnpf.base.vo.PageListVO; import jnpf.base.vo.PaginationVO; import jnpf.contractMobile.entity.ContractItem0MobileEntity; +import jnpf.contractMobile.entity.ContractItem1MobileEntity; import jnpf.contractMobile.entity.ContractMobileEntity; -import jnpf.contractMobile.model.contractMobile.ContractMobileInfoVO; -import jnpf.contractMobile.model.contractMobile.ContractMobileListVO; -import jnpf.contractMobile.model.contractMobile.ContractMobilePagination; +import jnpf.contractMobile.model.contractMobile.*; import jnpf.contractMobile.service.ContractMobileService; import jnpf.util.JsonUtil; import lombok.extern.slf4j.Slf4j; @@ -48,8 +47,15 @@ public class ContractMobileController { //子表 List contractItem0MobileList = contractMobileService.getContractItem0MobileList(id); - System.out.println(contractItem0MobileList); - //vo.getContractItem0List(JsonUtil.getJsonToList(contractItem0MobileList, ContractItem0MobileListVO.class)); + for (ContractItem0MobileEntity contractItem0MobileEntity : contractItem0MobileList) { + //System.out.println(contractItem0MobileEntity); + } + vo.setContractItem0List(JsonUtil.getJsonToList(contractItem0MobileList, ContractItem0MobileListVO.class)); + List contractItem1MobileList = contractMobileService.getContractItem1MobileList(id); + for (ContractItem1MobileEntity contractItem1MobileEntity : contractItem1MobileList) { + //System.out.println(contractItem1MobileEntity); + } + vo.setContractItem1List(JsonUtil.getJsonToList(contractItem1MobileList, ContractItem1MobileListVO.class)); return ActionResult.success(vo); } diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/service/ContractMobileService.java b/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/service/ContractMobileService.java index 74cbd15b..88feaa39 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/service/ContractMobileService.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/service/ContractMobileService.java @@ -2,6 +2,7 @@ package jnpf.contractMobile.service; import com.baomidou.mybatisplus.extension.service.IService; import jnpf.contractMobile.entity.ContractItem0MobileEntity; +import jnpf.contractMobile.entity.ContractItem1MobileEntity; import jnpf.contractMobile.entity.ContractMobileEntity; import jnpf.contractMobile.model.contractMobile.ContractMobilePagination; @@ -14,4 +15,6 @@ public interface ContractMobileService extends IService { ContractMobileEntity getInfo(String id); List getContractItem0MobileList(String id); + + List getContractItem1MobileList(String id); } diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/service/impl/ContractMobileServiceImpl.java b/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/service/impl/ContractMobileServiceImpl.java index 21618baa..5c99fa04 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/service/impl/ContractMobileServiceImpl.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/contractMobile/service/impl/ContractMobileServiceImpl.java @@ -5,10 +5,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import jnpf.contractMobile.entity.ContractItem0MobileEntity; +import jnpf.contractMobile.entity.ContractItem1MobileEntity; import jnpf.contractMobile.entity.ContractMobileEntity; import jnpf.contractMobile.mapper.ContractMobileMapper; import jnpf.contractMobile.model.contractMobile.ContractMobilePagination; import jnpf.contractMobile.service.ContractItem0MobileService; +import jnpf.contractMobile.service.ContractItem1MobileService; import jnpf.contractMobile.service.ContractMobileService; import jnpf.util.ServletUtil; import jnpf.util.UserProvider; @@ -68,6 +70,9 @@ public class ContractMobileServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); @@ -80,4 +85,10 @@ public class ContractMobileServiceImpl extends ServiceImpl getContractItem1MobileList(String id) { + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.lambda().eq(ContractItem1MobileEntity::getContractId, id); + return contractItem1MobileService.list(queryWrapper); + } } diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/contractfile/service/impl/ContractFileServiceImpl.java b/SC-boot/linkage-scm/src/main/java/jnpf/contractfile/service/impl/ContractFileServiceImpl.java index 2134837c..b23d6828 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/contractfile/service/impl/ContractFileServiceImpl.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/contractfile/service/impl/ContractFileServiceImpl.java @@ -12,7 +12,9 @@ import jnpf.customer.entity.CustomerEntity; import jnpf.permission.model.authorize.AuthorizeConditionModel; import jnpf.contractfile.model.contractfile.ContractFilePagination; import jnpf.permission.service.AuthorizeService; + import java.lang.reflect.Field; + import com.baomidou.mybatisplus.annotation.TableField; @@ -57,6 +59,9 @@ public class ContractFileServiceImpl extends ServiceImpl getList(ContractFilePagination contractFilePagination) { @@ -284,22 +289,35 @@ public class ContractFileServiceImpl extends ServiceImpl dataRowMap = new HashMap<>(); ContractFileModel model = personList.get(i); - dataRowMap.put("contractCode", model.getContractCode()); - dataRowMap.put("contractName", model.getContractName()); - dataRowMap.put("contractNo", model.getContractNo()); - dataRowMap.put("contractType", model.getContractType()); - dataRowMap.put("classification", model.getClassification()); - dataRowMap.put("declarationDate", model.getDeclarationDate()); - dataRowMap.put("name", model.getName()); - dataRowMap.put("num", model.getNum()); - dataRowMap.put("amount", model.getAmount()); - dataRowMap.put("deptName", model.getDeptName()); - dataRowMap.put("remark", model.getRemark()); - dataRowMap.put("creatorusername", model.getCreatorusername()); - dataRowMap.put("status", model.getStatus()); - dataRowMap.put("approval", model.getApproval()); - dataRow.add(dataRowMap); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper + .eq("contract_name", model.getContractName()) + .eq("contract_code", model.getContractCode()) + .eq("name", model.getName()); + List list = contractFileMapper.selectList(queryWrapper); + if (list.size() > 0) { + System.out.println(list); + } else { + dataRowMap.put("contractCode", model.getContractCode()); + dataRowMap.put("contractName", model.getContractName()); + dataRowMap.put("contractNo", model.getContractNo()); + dataRowMap.put("contractType", model.getContractType()); + dataRowMap.put("classification", model.getClassification()); + dataRowMap.put("declarationDate", model.getDeclarationDate()); + dataRowMap.put("name", model.getName()); + dataRowMap.put("num", model.getNum()); + dataRowMap.put("amount", model.getAmount()); + dataRowMap.put("deptName", model.getDeptName()); + dataRowMap.put("remark", model.getRemark()); + dataRowMap.put("creatorusername", model.getCreatorusername()); + dataRowMap.put("status", model.getStatus()); + dataRowMap.put("approval", model.getApproval()); + dataRow.add(dataRowMap); + } } + + for (int i = 1; i < 15; i++) { Map columnsMap = new HashMap<>(); columnsMap.put("AllowDBNull", true); @@ -337,47 +355,49 @@ public class ContractFileServiceImpl extends ServiceImpl dt) { for (ContractFileModel model : dt) { - model.setCreatorTime(DateUtil.cstFormat(model.getCreatorTime())); - model.setNum(DateUtil.cstFormat(model.getNum())); - if (model.getContractType() != null) { - if (model.getContractType().equals("采购合同")) { - model.setContractType("0"); - if (model.getName()!= null) { - QueryWrapper queryWrappers = new QueryWrapper(); - queryWrappers.eq("supplier_name",model.getName()); - List list = supplierMapper.selectList(queryWrappers); - if (list.size()>0){ - model.setCode(list.get(0).getId()); + + model.setCreatorTime(DateUtil.cstFormat(model.getCreatorTime())); + model.setNum(DateUtil.cstFormat(model.getNum())); + if (model.getContractType() != null) { + if (model.getContractType().equals("采购合同")) { + model.setContractType("0"); + if (model.getName() != null) { + QueryWrapper queryWrappers = new QueryWrapper(); + queryWrappers.eq("supplier_name", model.getName()); + List list = supplierMapper.selectList(queryWrappers); + if (list.size() > 0) { + model.setCode(list.get(0).getId()); + } } - } - } else if (model.getContractType().equals("销售合同")) { - model.setContractType("1"); - if (model.getName()!=null){ - QueryWrapper queryWrappers = new QueryWrapper(); - queryWrappers.eq("supplier_nm",model.getName()); - List list = customerMapper.selectList(queryWrappers); - if (list.size()>0){ - model.setCode(list.get(0).getId()); + } else if (model.getContractType().equals("销售合同")) { + model.setContractType("1"); + if (model.getName() != null) { + QueryWrapper queryWrappers = new QueryWrapper(); + queryWrappers.eq("supplier_nm", model.getName()); + List list = customerMapper.selectList(queryWrappers); + if (list.size() > 0) { + model.setCode(list.get(0).getId()); + } } } } - } - if (model.getClassification() != null) { - if (model.getClassification().equals("采购类")) { - model.setClassification("0"); - } else if (model.getClassification().equals("销售类")) { - model.setClassification("1"); + if (model.getClassification() != null) { + if (model.getClassification().equals("采购类")) { + model.setClassification("0"); + } else if (model.getClassification().equals("销售类")) { + model.setClassification("1"); + } } - } - if (model.getStatus() != null) { - if (model.getStatus().equals("合同进行中")) { - model.setStatus("0"); - } else if (model.getStatus().equals("合同审批中")) { - model.setStatus("1"); - } else if (model.getStatus().equals("合同审批结束")) { - model.setStatus("2"); + if (model.getStatus() != null) { + if (model.getStatus().equals("合同进行中")) { + model.setStatus("0"); + } else if (model.getStatus().equals("合同审批中")) { + model.setStatus("1"); + } else if (model.getStatus().equals("合同审批结束")) { + model.setStatus("2"); + } } - } + } List entitys = JsonUtil.getJsonToList(dt, ContractFileEntity.class); //记录成功了几条 diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/payment/controller/PaymentController.java b/SC-boot/linkage-scm/src/main/java/jnpf/payment/controller/PaymentController.java index c8300d30..983add67 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/payment/controller/PaymentController.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/payment/controller/PaymentController.java @@ -213,7 +213,7 @@ public class PaymentController { List list = paymentdocService.list(paymentdocEntityWrapper); for (PaymentdocEntity paymentdocEntity: list) { paymentdocEntity.setDocStatus("3");//已付款 - paymentdocEntity.setRamount(new BigDecimal(entity.getPaymentaccount())); + paymentdocEntity.setRamount(entity.getPaymentamount()); paymentdocService.updateById(paymentdocEntity); } List Payment_item0List = JsonUtil.getJsonToList(paymentCrForm.getPayment_item0List(),Payment_item0Entity.class); diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/poundlist/entity/PoundlistSEntity.java b/SC-boot/linkage-scm/src/main/java/jnpf/poundlist/entity/PoundlistSEntity.java index e307d759..c1461cde 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/poundlist/entity/PoundlistSEntity.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/poundlist/entity/PoundlistSEntity.java @@ -3,6 +3,7 @@ package jnpf.poundlist.entity; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; +import jnpf.base.Pagination; import lombok.Data; import java.math.BigDecimal; @@ -18,8 +19,8 @@ import java.util.Date; * @日期: 2023-02-21 */ @Data -@TableName("jg_poundlist") -public class PoundlistSEntity { +//@TableName("jg_poundlist") +public class PoundlistSEntity extends Pagination { @TableId("ID") private String id; @@ -218,4 +219,9 @@ public class PoundlistSEntity { @TableField(exist = false) private String contractName; + /** + * 菜单id + */ + private String menuId; + } diff --git a/SC-boot/linkage-scm/src/main/java/jnpf/poundlist/service/impl/PoundlistServiceImpl.java b/SC-boot/linkage-scm/src/main/java/jnpf/poundlist/service/impl/PoundlistServiceImpl.java index 576ea707..fcf9dda0 100644 --- a/SC-boot/linkage-scm/src/main/java/jnpf/poundlist/service/impl/PoundlistServiceImpl.java +++ b/SC-boot/linkage-scm/src/main/java/jnpf/poundlist/service/impl/PoundlistServiceImpl.java @@ -73,32 +73,32 @@ public class PoundlistServiceImpl extends ServiceImpl AllIdList =new ArrayList(); int total=0; - int poundlistNum =0; + int poundlistNum =0; QueryWrapper poundlistQueryWrapper=new QueryWrapper<>(); poundlistQueryWrapper.lambda().eq(PoundlistEntity::getIsExamine,"1"); - boolean pcPermission = true; - boolean appPermission = true; - boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); - if(isPc && pcPermission){ - if (!userProvider.get().getIsAdministrator()){ - Object poundlistObj=authorizeService.getCondition(new AuthorizeConditionModel(poundlistQueryWrapper,poundlistPagination.getMenuId(),"jg_poundlist")); - if (ObjectUtil.isEmpty(poundlistObj)){ - return new ArrayList<>(); - } else { - poundlistQueryWrapper = (QueryWrapper)poundlistObj; - poundlistNum++; + boolean pcPermission = true; + boolean appPermission = true; + boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); + if(isPc && pcPermission){ + if (!userProvider.get().getIsAdministrator()){ + Object poundlistObj=authorizeService.getCondition(new AuthorizeConditionModel(poundlistQueryWrapper,poundlistPagination.getMenuId(),"jg_poundlist")); + if (ObjectUtil.isEmpty(poundlistObj)){ + return new ArrayList<>(); + } else { + poundlistQueryWrapper = (QueryWrapper)poundlistObj; + poundlistNum++; + } } } - } - if(!isPc && appPermission){ - if (!userProvider.get().getIsAdministrator()){ - Object poundlistObj=authorizeService.getCondition(new AuthorizeConditionModel(poundlistQueryWrapper,poundlistPagination.getMenuId(),"jg_poundlist")); - if (ObjectUtil.isEmpty(poundlistObj)){ - return new ArrayList<>(); - } else { - poundlistQueryWrapper = (QueryWrapper)poundlistObj; - poundlistNum++; - } + if(!isPc && appPermission){ + if (!userProvider.get().getIsAdministrator()){ + Object poundlistObj=authorizeService.getCondition(new AuthorizeConditionModel(poundlistQueryWrapper,poundlistPagination.getMenuId(),"jg_poundlist")); + if (ObjectUtil.isEmpty(poundlistObj)){ + return new ArrayList<>(); + } else { + poundlistQueryWrapper = (QueryWrapper)poundlistObj; + poundlistNum++; + } } @@ -109,12 +109,12 @@ public class PoundlistServiceImpl extends ServiceImpl0 && AllIdList.size()>0) || total==0){ - Page page=new Page<>(poundlistPagination.getCurrentPage(), poundlistPagination.getPageSize()); - IPage userIPage=this.page(page, poundlistQueryWrapper); - return poundlistPagination.setData(userIPage.getRecords(),userIPage.getTotal()); + Page page=new Page<>(poundlistPagination.getCurrentPage(), poundlistPagination.getPageSize()); + IPage userIPage=this.page(page, poundlistQueryWrapper); + return poundlistPagination.setData(userIPage.getRecords(),userIPage.getTotal()); }else{ List list = new ArrayList(); return poundlistPagination.setData(list, list.size()); @@ -237,66 +237,66 @@ public class PoundlistServiceImpl extends ServiceImpl getTypeList(PoundlistPagination poundlistPagination,String dataType){ String userId=userProvider.get().getUserId(); List AllIdList =new ArrayList(); - int total=0; - int poundlistNum =0; + int total=0; + int poundlistNum =0; QueryWrapper poundlistQueryWrapper=new QueryWrapper<>(); - boolean pcPermission = true; - boolean appPermission = true; - boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); - if(isPc && pcPermission){ - if (!userProvider.get().getIsAdministrator()){ - Object poundlistObj=authorizeService.getCondition(new AuthorizeConditionModel(poundlistQueryWrapper,poundlistPagination.getMenuId(),"jg_poundlist")); - if (ObjectUtil.isEmpty(poundlistObj)){ - return new ArrayList<>(); - } else { - poundlistQueryWrapper = (QueryWrapper)poundlistObj; - poundlistNum++; + boolean pcPermission = true; + boolean appPermission = true; + boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc"); + if(isPc && pcPermission){ + if (!userProvider.get().getIsAdministrator()){ + Object poundlistObj=authorizeService.getCondition(new AuthorizeConditionModel(poundlistQueryWrapper,poundlistPagination.getMenuId(),"jg_poundlist")); + if (ObjectUtil.isEmpty(poundlistObj)){ + return new ArrayList<>(); + } else { + poundlistQueryWrapper = (QueryWrapper)poundlistObj; + poundlistNum++; + } } } - } - if(!isPc && appPermission){ - if (!userProvider.get().getIsAdministrator()){ - Object poundlistObj=authorizeService.getCondition(new AuthorizeConditionModel(poundlistQueryWrapper,poundlistPagination.getMenuId(),"jg_poundlist")); - if (ObjectUtil.isEmpty(poundlistObj)){ - return new ArrayList<>(); - } else { - poundlistQueryWrapper = (QueryWrapper)poundlistObj; - poundlistNum++; - } + if(!isPc && appPermission){ + if (!userProvider.get().getIsAdministrator()){ + Object poundlistObj=authorizeService.getCondition(new AuthorizeConditionModel(poundlistQueryWrapper,poundlistPagination.getMenuId(),"jg_poundlist")); + if (ObjectUtil.isEmpty(poundlistObj)){ + return new ArrayList<>(); + } else { + poundlistQueryWrapper = (QueryWrapper)poundlistObj; + poundlistNum++; + } - } - } - if(StringUtil.isNotEmpty(poundlistPagination.getPoundDate())){ + } + } + if(StringUtil.isNotEmpty(poundlistPagination.getPoundDate())){ poundlistNum++; List PoundDateList = poundlistPagination.getPoundDate(); Long fir = Long.valueOf(PoundDateList.get(0)); Long sec = Long.valueOf(PoundDateList.get(1)); - poundlistQueryWrapper.lambda().ge(PoundlistEntity::getPoundDate, new Date(fir)) - .le(PoundlistEntity::getPoundDate, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59")); + poundlistQueryWrapper.lambda().ge(PoundlistEntity::getPoundDate, new Date(fir)) + .le(PoundlistEntity::getPoundDate, DateUtil.stringToDate(DateUtil.daFormatYmd(sec) + " 23:59:59")); - } + } - if(StringUtil.isNotEmpty(poundlistPagination.getPoundlistNo())){ + if(StringUtil.isNotEmpty(poundlistPagination.getPoundlistNo())){ poundlistNum++; poundlistQueryWrapper.lambda().like(PoundlistEntity::getPoundlistNo,poundlistPagination.getPoundlistNo()); - } + } - if(AllIdList.size()>0){ - poundlistQueryWrapper.lambda().in(PoundlistEntity::getId, AllIdList); - } + if(AllIdList.size()>0){ + poundlistQueryWrapper.lambda().in(PoundlistEntity::getId, AllIdList); + } //排序 if(StringUtil.isEmpty(poundlistPagination.getSidx())){ - poundlistQueryWrapper.lambda().orderByDesc(PoundlistEntity::getId); + poundlistQueryWrapper.lambda().orderByDesc(PoundlistEntity::getId); }else{ try { - String sidx = poundlistPagination.getSidx(); + String sidx = poundlistPagination.getSidx(); PoundlistEntity poundlistEntity = new PoundlistEntity(); - Field declaredField = poundlistEntity.getClass().getDeclaredField(sidx); - declaredField.setAccessible(true); - String value = declaredField.getAnnotation(TableField.class).value(); - poundlistQueryWrapper="asc".equals(poundlistPagination.getSort().toLowerCase())?poundlistQueryWrapper.orderByAsc(value):poundlistQueryWrapper.orderByDesc(value); + Field declaredField = poundlistEntity.getClass().getDeclaredField(sidx); + declaredField.setAccessible(true); + String value = declaredField.getAnnotation(TableField.class).value(); + poundlistQueryWrapper="asc".equals(poundlistPagination.getSort().toLowerCase())?poundlistQueryWrapper.orderByAsc(value):poundlistQueryWrapper.orderByDesc(value); } catch (NoSuchFieldException e) { e.printStackTrace(); } @@ -336,8 +336,8 @@ public class PoundlistServiceImpl extends ServiceImpl qureylist(PoundlistSEntity poundlistSEntity) { - List list= poundlistMapper.qureylist(poundlistSEntity); - return list; + List list= poundlistMapper.qureylist(poundlistSEntity); + return list; } @Override diff --git a/SC-web/src/views/scm/basicInformation/contractfile/ImportForm.vue b/SC-web/src/views/scm/basicInformation/contractfile/ImportForm.vue index 21fc10b5..f6b9d1e0 100644 --- a/SC-web/src/views/scm/basicInformation/contractfile/ImportForm.vue +++ b/SC-web/src/views/scm/basicInformation/contractfile/ImportForm.vue @@ -35,6 +35,7 @@
+

批量导入自动去重在合同档案中已经存在的合同数据