|
|
@@ -57,12 +57,12 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
private CopyrightInfoService copyrightInfoService;
|
|
|
@Resource
|
|
|
private TechProjectService techProjectService;
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 批量删除合同
|
|
|
*/
|
|
|
@RequestMapping(value = "/delete", method = RequestMethod.POST)
|
|
|
- public Result delete(@RequestParam(name = "ids[]", required = false) String[] ids){
|
|
|
+ public Result delete(@RequestParam(name = "ids[]", required = false) String[] ids) {
|
|
|
Result res = new Result();
|
|
|
if (ids == null || ids.length < 1) {
|
|
|
res.getError().add(buildError(ErrorConstants.PARAM_ERROR, "", ""));
|
|
|
@@ -71,12 +71,12 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 合同编号下拉
|
|
|
*/
|
|
|
- @RequestMapping(value= "/serialNumber", method = RequestMethod.GET)
|
|
|
- public Result contractSerialNumber(){
|
|
|
+ @RequestMapping(value = "/serialNumber", method = RequestMethod.GET)
|
|
|
+ public Result contractSerialNumber() {
|
|
|
Result res = new Result();
|
|
|
res.setData(contractService.selectContractSerialNumber());
|
|
|
return res;
|
|
|
@@ -271,8 +271,9 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
* 合同列表
|
|
|
*/
|
|
|
@RequestMapping(value = "/list", method = RequestMethod.GET)
|
|
|
- public Result listContract(String contractId, Integer serialNumber, Integer type, Integer status, String startDateFormattedDate,
|
|
|
- String endDateFormattedDate, Integer province, String unitName, String uid, String pageNo, String pageSize) {
|
|
|
+ public Result listContract(String contractId, Integer serialNumber, Integer type, Integer status,
|
|
|
+ String startDateFormattedDate, String endDateFormattedDate, Integer province, String unitName, String uid,
|
|
|
+ String pageNo, String pageSize) {
|
|
|
Result res = new Result();
|
|
|
Integer pNo = 1;
|
|
|
Integer pSize = 10;
|
|
|
@@ -319,7 +320,13 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
if (StringUtils.isBlank(contract.getId())) {
|
|
|
res.setData(contractService.saveManageContract(c));
|
|
|
} else {
|
|
|
- res.setData(contractService.updateByPrimaryKeySelective(c));
|
|
|
+ Contract ct = contractService.selectByPrimaryKey(c.getId());
|
|
|
+ if (null != ct && !ContractStatus.COMPLETE.getCode().equals(ct.getStatus())) {
|
|
|
+ res.setData(contractService.updateByPrimaryKeySelective(c));
|
|
|
+ } else {
|
|
|
+ res.getError().add(buildError("", "当前合同已完成(结款),无法操作!"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -362,7 +369,13 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
if (StringUtils.isBlank(ic.getId())) {
|
|
|
contractService.insertManageSubmit(c, principals, signDateFormattedDate);
|
|
|
} else {
|
|
|
- contractService.updateSubmit(c, principals, signDateFormattedDate);
|
|
|
+ Contract ct = contractService.selectByPrimaryKey(c.getId());
|
|
|
+ if (null != ct && !ContractStatus.COMPLETE.getCode().equals(ct.getStatus())) {
|
|
|
+ contractService.updateSubmit(c, principals, signDateFormattedDate);
|
|
|
+ } else {
|
|
|
+ res.getError().add(buildError("", "当前合同已完成(结款),无法操作!"));
|
|
|
+ return res;
|
|
|
+ }
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
@@ -457,15 +470,16 @@ public class AdminContractApiController extends CertifyApiController {
|
|
|
if (TokenManager.hasRole(AFTConstants.SUPERADMIN)) {
|
|
|
for (ContractStatus p : ContractStatus.values()) {
|
|
|
status.put(p.getCode().toString(), p.getDesc());
|
|
|
+ status.remove(ContractStatus.CREATE.getCode().toString());
|
|
|
status.remove(ContractStatus.OTHER.getCode().toString());
|
|
|
}
|
|
|
} else {
|
|
|
- if (TokenManager.hasPermission("ContractStatus" + ContractStatus.CREATE.getCode())) {
|
|
|
+ /*if (TokenManager.hasPermission("ContractStatus" + ContractStatus.CREATE.getCode())) {
|
|
|
status.put(ContractStatus.CREATE.getCode().toString(), ContractStatus.CREATE.getDesc());
|
|
|
}
|
|
|
if (TokenManager.hasPermission("ContractStatus" + ContractStatus.SIGN.getCode())) {
|
|
|
status.put(ContractStatus.SIGN.getCode().toString(), ContractStatus.SIGN.getDesc());
|
|
|
- }
|
|
|
+ }*/
|
|
|
if (TokenManager.hasPermission("ContractStatus" + ContractStatus.CIRCULATION.getCode())) {
|
|
|
status.put(ContractStatus.CIRCULATION.getCode().toString(), ContractStatus.CIRCULATION.getDesc());
|
|
|
}
|