|
@@ -4,6 +4,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
+import com.zjugis.business.bean.entity.ContractApply;
|
|
|
import com.zjugis.business.bean.entity.ContractSub;
|
|
|
import com.zjugis.business.bean.entity.Project;
|
|
|
import com.zjugis.business.bean.entity.Supplier;
|
|
@@ -22,6 +23,7 @@ import com.zjugis.business.flow.Asset.entity.AssetProcureDetailDO;
|
|
|
import com.zjugis.business.flow.Asset.service.AssetProcureDetailService;
|
|
|
import com.zjugis.business.flow.Asset.service.AssetProcureService;
|
|
|
import com.zjugis.business.flow.commoncost.entity.CommonCostDO;
|
|
|
+import com.zjugis.business.flow.contractApply.service.FlowContractApplyService;
|
|
|
import com.zjugis.business.flow.contractSub.service.FlowContractSubService;
|
|
|
import com.zjugis.business.flow.loan.controller.vo.LoanRespVO;
|
|
|
import com.zjugis.business.flow.outsourcePurchase.controller.vo.OutsourcePurchaseDetRespVO;
|
|
@@ -35,6 +37,7 @@ import com.zjugis.business.flow.usemoney.dao.UseMoneyDao;
|
|
|
import com.zjugis.business.flow.usemoney.dao.UseMoneyDetailDao;
|
|
|
import com.zjugis.business.flow.usemoney.entity.UseMoneyDO;
|
|
|
import com.zjugis.business.flow.usemoney.entity.UseMoneyDetailDO;
|
|
|
+import com.zjugis.business.mapper.ContractApplyMapper;
|
|
|
import com.zjugis.business.mapper.SupplierMapper;
|
|
|
import com.zjugis.business.service.CommonService;
|
|
|
import com.zjugis.business.service.ProjectService;
|
|
@@ -58,6 +61,7 @@ import com.zjugis.module.system.api.dict.dto.DictDataRespDTO;
|
|
|
import com.zjugis.module.system.api.user.AdminUserApi;
|
|
|
import com.zjugis.module.system.api.user.dto.AdminUserRespDTO;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -129,6 +133,9 @@ public class UseMoneyServiceImpl implements UseMoneyService {
|
|
|
|
|
|
@Resource
|
|
|
private FlowContractSubService flowContractSubService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ ContractApplyMapper subcontractApplyMapper;
|
|
|
@Resource
|
|
|
private CommonService commonService;
|
|
|
|
|
@@ -386,13 +393,17 @@ public class UseMoneyServiceImpl implements UseMoneyService {
|
|
|
map.put("projectZrbm", project.getZrbm());
|
|
|
map.put("hth", project.getContractNumber());
|
|
|
}
|
|
|
+ ContractSub flowContractSub=null;
|
|
|
if (StringUtils.isNotBlank(entity.getContractId())) {
|
|
|
- ContractSub flowContractSub = flowContractSubService.selectById(entity.getContractId());
|
|
|
- map.put("contractType", flowContractSub.getContractType());
|
|
|
- map.put("name", flowContractSub.getName());
|
|
|
- map.put("contractAmount", flowContractSub.getContractAmount());
|
|
|
- map.put("payAmount", flowContractSub.getPayAmount());
|
|
|
- map.put("paymentTerms", flowContractSub.getPaymentTerms());
|
|
|
+ flowContractSub = flowContractSubService.selectByApplyId(entity.getContractId());
|
|
|
+ if(flowContractSub!=null){
|
|
|
+ ContractApply apply=subcontractApplyMapper.selectById(entity.getContractId());
|
|
|
+ map.put("contractType", flowContractSub.getContractType());
|
|
|
+ map.put("name", flowContractSub.getName());
|
|
|
+ map.put("contractAmount", flowContractSub.getContractAmount());
|
|
|
+ map.put("payAmount", apply.getPayAmount());
|
|
|
+ map.put("paymentTerms", flowContractSub.getPaymentTerms());
|
|
|
+ }
|
|
|
}
|
|
|
map.put("formEntity", entity);
|
|
|
map.put("sqd", sqd);
|
|
@@ -421,7 +432,7 @@ public class UseMoneyServiceImpl implements UseMoneyService {
|
|
|
}
|
|
|
List<zTree> zTrees = getCostTypezTrees();
|
|
|
map.put("costTypeJSON", JSON.toJSONString(zTrees));
|
|
|
- if(entity.getContractId()==null){
|
|
|
+ if(flowContractSub==null){
|
|
|
map.put("contractId", "notContract");
|
|
|
}else{
|
|
|
map.put("contractId", "contract");
|
|
@@ -569,9 +580,11 @@ public class UseMoneyServiceImpl implements UseMoneyService {
|
|
|
UseMoneyDO entity = new UseMoneyDO();
|
|
|
if(supplierId!=null){
|
|
|
Supplier supplier=supplierService.queryById(supplierId);
|
|
|
- entity.setCollectionCompany(supplier.getCustomerName());
|
|
|
- entity.setCollectionCompanyAccount(supplier.getBankaccount());
|
|
|
- entity.setCollectionCompanyBank(supplier.getBank());
|
|
|
+ if(supplier!=null){
|
|
|
+ entity.setCollectionCompany(supplier.getCustomerName());
|
|
|
+ entity.setCollectionCompanyAccount(supplier.getBankaccount());
|
|
|
+ entity.setCollectionCompanyBank(supplier.getBank());
|
|
|
+ }
|
|
|
}
|
|
|
entity.setInstanceId(UrlUtils.getParam(returnUrl, "flowInstanceId"));
|
|
|
entity.setUserId(userId);
|
|
@@ -679,24 +692,6 @@ public class UseMoneyServiceImpl implements UseMoneyService {
|
|
|
if (flowResult.isSuccess()) {
|
|
|
IFlowInstance flowInstance = flowResult.getData();
|
|
|
UseMoneyDO entity = findByInstanceId(flowInstanceId);
|
|
|
- if (Objects.isNull(entity)) {
|
|
|
- entity = new UseMoneyDO();
|
|
|
- entity.setInstanceId(flowInstanceId);
|
|
|
- entity.setUserId(userId);
|
|
|
- entity.setUseMoneyNo(flowInstance.getCode());
|
|
|
- entity.setApplyTime(LocalDateTime.now());
|
|
|
- entity.setCreateTime(LocalDateTime.now());
|
|
|
- entity.setFlowStatus(FlowStatusConstants.FLOW_NOT_START);
|
|
|
- entity.setPaymentCompanyId("4e99393c-c0ea-4146-a7fb-56fb8019c477");
|
|
|
- entity.setPaymentMethod(1);
|
|
|
- CommonResult<AdminUserRespDTO> result = adminUserApi.getUser(userId);
|
|
|
- if (result.isSuccess()) {
|
|
|
- entity.setUserNickname(result.getData().getNickname());
|
|
|
- entity.setDeptId(result.getData().getDeptId());
|
|
|
- entity.setDeptName(result.getData().getDeptName());
|
|
|
- }
|
|
|
- useMoneyDao.insert(entity);
|
|
|
- }
|
|
|
|
|
|
UseMoneyRespVO respVO = UseMoneyConvert.INSTANCE.convert01(entity);
|
|
|
if (StringUtils.isNotBlank(entity.getProjectId())) {
|
|
@@ -706,13 +701,17 @@ public class UseMoneyServiceImpl implements UseMoneyService {
|
|
|
respVO.setProjectZrbm(project.getZrbm());
|
|
|
respVO.setHth(project.getContractNumber());
|
|
|
}
|
|
|
+ ContractSub flowContractSub=null;
|
|
|
if (StringUtils.isNotBlank(entity.getContractId())) {
|
|
|
- ContractSub flowContractSub = flowContractSubService.selectById(entity.getContractId());
|
|
|
- respVO.setContractType(flowContractSub.getContractType());
|
|
|
- respVO.setName(flowContractSub.getName());
|
|
|
- respVO.setContractAmount(flowContractSub.getContractAmount());
|
|
|
- respVO.setPayAmount(flowContractSub.getPayAmount());
|
|
|
- respVO.setPaymentTerms(flowContractSub.getPaymentTerms());
|
|
|
+ flowContractSub = flowContractSubService.selectByApplyId(entity.getContractId());
|
|
|
+ if(flowContractSub!=null){
|
|
|
+ ContractApply apply=subcontractApplyMapper.selectById(entity.getContractId());
|
|
|
+ respVO.setContractType(flowContractSub.getContractType());
|
|
|
+ respVO.setName(flowContractSub.getName());
|
|
|
+ respVO.setContractAmount(flowContractSub.getContractAmount());
|
|
|
+ respVO.setPayAmount(apply.getPayAmount());
|
|
|
+ respVO.setPaymentTerms(flowContractSub.getPaymentTerms());
|
|
|
+ }
|
|
|
}
|
|
|
List<UseMoneyDetailDO> detailList= useMoneyDetailService.getListByUseMoeneyId(entity.getId());
|
|
|
List<UseMoneyDetailRespVO> detailRespVOS = UseMoneyDetailConvert.INSTANCE.convertList01(detailList);
|