|
@@ -316,7 +316,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public HttpRespMsg addContract(HttpServletRequest request, Contract contract, String paymentListStr) {
|
|
|
+ public HttpRespMsg addContract(HttpServletRequest request, Contract contract, ContractCustom custom, String paymentListStr) {
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
User user = userMapper.selectById(request.getHeader("token"));
|
|
|
List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "新增合同");
|
|
@@ -349,6 +349,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
|
|
|
contract.setCompanyId(user.getCompanyId());
|
|
|
contractMapper.insert(contract);
|
|
|
|
|
|
+
|
|
|
if (StringUtils.isNotBlank(paymentListStr)){
|
|
|
List<ContractPayment> contractPaymentList = JSON.parseArray(paymentListStr, ContractPayment.class);
|
|
|
BigDecimal bg = new BigDecimal("0");
|
|
@@ -372,6 +373,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
|
|
|
contractLog.setType(0);
|
|
|
contractLog.setMsg("创建了合同。");
|
|
|
contractLogMapper.insert(contractLog);
|
|
|
+
|
|
|
+ custom.setContractId(contract.getId());
|
|
|
+ contractCustomMapper.insert(custom);
|
|
|
httpRespMsg.msg = MessageUtils.message("contract.addSuc");
|
|
|
httpRespMsg.data = contract.getId();
|
|
|
return httpRespMsg;
|
|
@@ -384,7 +388,7 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public HttpRespMsg editContract(HttpServletRequest request, Contract contract, String paymentListStr) {
|
|
|
+ public HttpRespMsg editContract(HttpServletRequest request, Contract contract, ContractCustom custom, String paymentListStr) {
|
|
|
HttpRespMsg httpRespMsg = new HttpRespMsg();
|
|
|
User user = userMapper.selectById(request.getHeader("token"));
|
|
|
List<SysRichFunction> functionContractList = sysFunctionMapper.getRoleFunctions(user.getRoleId(), "管理全部合同");
|
|
@@ -393,6 +397,10 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
|
|
|
return httpRespMsg;
|
|
|
}
|
|
|
try {
|
|
|
+ if (contract.getId() == null) {
|
|
|
+ httpRespMsg.setError(MessageUtils.message("name.idNullError"));
|
|
|
+ return httpRespMsg;
|
|
|
+ }
|
|
|
if (StringUtils.isBlank(contract.getName())){
|
|
|
//名称不可为空
|
|
|
httpRespMsg.setError(MessageUtils.message("name.nullNameError"));
|
|
@@ -455,6 +463,8 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
|
|
|
contractLog.setType(1);
|
|
|
contractLog.setMsg("编辑了合同。");
|
|
|
contractLogMapper.insert(contractLog);
|
|
|
+ custom.setContractId(contract.getId());
|
|
|
+ contractCustomMapper.updateById(custom);
|
|
|
httpRespMsg.msg = MessageUtils.message("contract.editSuc");
|
|
|
return httpRespMsg;
|
|
|
}catch (NullPointerException e) {
|
|
@@ -808,9 +818,9 @@ public class ContractServiceImpl extends ServiceImpl<ContractMapper, Contract> i
|
|
|
String status = row.getCell(26)==null?null:row.getCell(26).getStringCellValue();
|
|
|
if (StringUtils.isNotBlank(status)){
|
|
|
if ("履约中".equals(status)) {
|
|
|
- customItem.setStatus(1);
|
|
|
+ customItem.setFinishStatus(1);
|
|
|
} else {
|
|
|
- customItem.setStatus(2);
|
|
|
+ customItem.setFinishStatus(2);
|
|
|
}
|
|
|
}
|
|
|
String remarks = row.getCell(27)==null?null:row.getCell(27).getStringCellValue();
|