删除合同接口、提erp接口

This commit is contained in:
guojunyun
2025-10-14 15:42:17 +08:00
parent d0e7938e4d
commit a25e85cb8e
6 changed files with 118 additions and 20 deletions

View File

@@ -22,4 +22,5 @@ public interface ErrorCodeConstants {
ErrorCode CONTRACT_STATUS_NOT_SUBMIT_APPROVAL = new ErrorCode(1_027_000_007, "{}状态合同不允许提交审核"); ErrorCode CONTRACT_STATUS_NOT_SUBMIT_APPROVAL = new ErrorCode(1_027_000_007, "{}状态合同不允许提交审核");
ErrorCode CONTRACT_STATUS_NOT_APPROVAL = new ErrorCode(1_027_000_008, "{}状态合同不允许审核"); ErrorCode CONTRACT_STATUS_NOT_APPROVAL = new ErrorCode(1_027_000_008, "{}状态合同不允许审核");
ErrorCode CONTRACT_ERP_COMPANY_PLEASE_BIND = new ErrorCode(1_027_000_009, "请先绑定{}ERP公司信息"); ErrorCode CONTRACT_ERP_COMPANY_PLEASE_BIND = new ErrorCode(1_027_000_009, "请先绑定{}ERP公司信息");
ErrorCode CONTRACT_STATUS_NOT_DELETE = new ErrorCode(1_027_000_010, "{}状态合同不允许删除");
} }

View File

@@ -63,4 +63,8 @@ public enum DictEnum {
public String getRemark() { public String getRemark() {
return remark; return remark;
} }
public static DictEnum getByCode(String code, String dictType) {
return DictEnum.valueOf(dictType + "_" +code);
}
} }

View File

@@ -85,13 +85,11 @@ public class ContractController implements BusinessControllerMarker {
return success(contractService.update(reqVO)); return success(contractService.update(reqVO));
} }
// TODO
@DeleteMapping("/delete") @DeleteMapping("/delete")
@Operation(summary = "删除合同") @Operation(summary = "删除合同")
@Parameter(name = "ids", description = "合同ID集合", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('base:contract:delete')") @PreAuthorize("@ss.hasPermission('base:contract:delete')")
public CommonResult<Boolean> delete(@RequestParam("ids") Long[] ids) { public CommonResult<List<JSONObject>> delete(@RequestBody List<Long> ids) {
return success(true); return success(contractService.delete(ids));
} }
// TODO // TODO
@@ -144,11 +142,10 @@ public class ContractController implements BusinessControllerMarker {
public void viewApproval() { public void viewApproval() {
} }
// TODO
@PostMapping("/submit/erp") @PostMapping("/submit/erp")
@Operation(summary = "提交ERP") @Operation(summary = "提交ERP")
@PreAuthorize("@ss.hasPermission('base:contract:erp')") @PreAuthorize("@ss.hasPermission('base:contract:erp')")
public void submitErp(@RequestBody List<Long> ids) { public CommonResult<List<String>> submitErp(@RequestBody List<Long> ids) {
contractService.submitErp(ids); return success(contractService.submitErp(ids));
} }
} }

View File

@@ -1,5 +1,6 @@
package com.zt.plat.module.contractorder.service.contract; package com.zt.plat.module.contractorder.service.contract;
import cn.hutool.json.JSONObject;
import com.zt.plat.framework.common.pojo.PageResult; import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.contractorder.api.dto.contract.ContractRespDTO; import com.zt.plat.module.contractorder.api.dto.contract.ContractRespDTO;
import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.*; import com.zt.plat.module.contractorder.controller.admin.contract.vo.contract.*;
@@ -101,5 +102,13 @@ public interface ContractService {
* @param ids 合同ID集合 * @param ids 合同ID集合
* @return * @return
*/ */
void submitErp(List<Long> ids); List<String> submitErp(List<Long> ids);
/**
* 删除合同
*
* @param ids 合同ID集合
* @return 删除结果
*/
List<JSONObject> delete(List<Long> ids);
} }

View File

@@ -342,9 +342,7 @@ public class ErpContractServiceImpl implements ErpContractService {
HashMap<String, String> response = erpExternalApi.submitDataToErp(erpSubmitReqDTO); HashMap<String, String> response = erpExternalApi.submitDataToErp(erpSubmitReqDTO);
System.out.println(response.get("resStr")); return response.get("resStr");
return "";
} }
/** /**