Merge remote-tracking branch 'origin/dev' into test
This commit is contained in:
@@ -189,6 +189,10 @@ public class PurchaseOrderWithDetailsDTO {
|
|||||||
* 订单类型
|
* 订单类型
|
||||||
*/
|
*/
|
||||||
private String splyBsnTp;
|
private String splyBsnTp;
|
||||||
|
/**
|
||||||
|
* 税码
|
||||||
|
*/
|
||||||
|
private String taxNum;
|
||||||
/**
|
/**
|
||||||
* 采购订单明细
|
* 采购订单明细
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
package com.zt.plat.module.contractorder.api.vo.contract;
|
package com.zt.plat.module.contractorder.api.vo.contract;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 查询参数降级规则列表 Request VO")
|
@Schema(description = "管理后台 - 查询参数降级规则列表 Request VO")
|
||||||
@Data
|
@Data
|
||||||
public class DemotesQueryReqVO {
|
public class DemotesQueryReqVO extends PageParam {
|
||||||
|
|
||||||
@Schema(description = "合同名称")
|
@Schema(description = "合同名称")
|
||||||
private String contractName;
|
private String contractName;
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
package com.zt.plat.module.contractorder.api.vo.contract;
|
package com.zt.plat.module.contractorder.api.vo.contract;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 查询结算公式列表 Request VO")
|
@Schema(description = "管理后台 - 查询结算公式列表 Request VO")
|
||||||
@Data
|
@Data
|
||||||
public class FormulasQueryReqVO {
|
public class FormulasQueryReqVO extends PageParam {
|
||||||
|
|
||||||
@Schema(description = "合同名称")
|
@Schema(description = "合同名称")
|
||||||
private String contractName;
|
private String contractName;
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
package com.zt.plat.module.contractorder.api.vo.contract;
|
package com.zt.plat.module.contractorder.api.vo.contract;
|
||||||
|
|
||||||
|
import com.zt.plat.framework.common.pojo.PageParam;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@Schema(description = "管理后台 - 查询不计价规则列表 Request VO")
|
@Schema(description = "管理后台 - 查询不计价规则列表 Request VO")
|
||||||
@Data
|
@Data
|
||||||
public class NotsQueryReqVO {
|
public class NotsQueryReqVO extends PageParam {
|
||||||
|
|
||||||
@Schema(description = "合同名称")
|
@Schema(description = "合同名称")
|
||||||
private String contractName;
|
private String contractName;
|
||||||
|
|||||||
@@ -51,21 +51,21 @@ public class ContractController implements BusinessControllerMarker {
|
|||||||
@GetMapping("/nots")
|
@GetMapping("/nots")
|
||||||
@Operation(summary = "查询不计价规则列表")
|
@Operation(summary = "查询不计价规则列表")
|
||||||
@PreAuthorize("@ss.hasPermission('base:contract:query')")
|
@PreAuthorize("@ss.hasPermission('base:contract:query')")
|
||||||
public CommonResult<List<NotRespVO>> getNots(NotsQueryReqVO queryReqVO) {
|
public CommonResult<PageResult<NotRespVO>> getNots(NotsQueryReqVO queryReqVO) {
|
||||||
return success(contractService.getNots(queryReqVO));
|
return success(contractService.getNots(queryReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/demotes")
|
@GetMapping("/demotes")
|
||||||
@Operation(summary = "查询参数降级规则列表")
|
@Operation(summary = "查询参数降级规则列表")
|
||||||
@PreAuthorize("@ss.hasPermission('base:contract:query')")
|
@PreAuthorize("@ss.hasPermission('base:contract:query')")
|
||||||
public CommonResult<List<DemoteRespVO>> getDemotes(DemotesQueryReqVO queryReqVO) {
|
public CommonResult<PageResult<DemoteRespVO>> getDemotes(DemotesQueryReqVO queryReqVO) {
|
||||||
return success(contractService.getDemotes(queryReqVO));
|
return success(contractService.getDemotes(queryReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/formulas")
|
@GetMapping("/formulas")
|
||||||
@Operation(summary = "查询结算公式列表")
|
@Operation(summary = "查询结算公式列表")
|
||||||
@PreAuthorize("@ss.hasPermission('base:contract:query')")
|
@PreAuthorize("@ss.hasPermission('base:contract:query')")
|
||||||
public CommonResult<List<FormulaRespVO>> getFormulas(FormulasQueryReqVO queryReqVO) {
|
public CommonResult<PageResult<FormulaRespVO>> getFormulas(FormulasQueryReqVO queryReqVO) {
|
||||||
return success(contractService.getFormulas(queryReqVO));
|
return success(contractService.getFormulas(queryReqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -144,20 +144,16 @@ public class PurchaseOrderController implements BusinessControllerMarker {
|
|||||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
|
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
|
||||||
public CommonResult<?> submitErp061(@RequestBody @Validated @NotEmpty(message = "采购订单id不能为空") List<String> idsStr) {
|
public CommonResult<?> submitErp061(@RequestBody @Validated @NotEmpty(message = "采购订单id不能为空") List<String> idsStr) {
|
||||||
List<Long> ids = idsStr.stream().map(Long::valueOf).toList();
|
List<Long> ids = idsStr.stream().map(Long::valueOf).toList();
|
||||||
// TODO 推送ERP订单
|
// todo 推送ERP订单
|
||||||
// purchaseOrderService.submitErp061(ids);
|
return success(purchaseOrderService.submitErp061(ids));
|
||||||
//随机生成六位数
|
|
||||||
|
|
||||||
return success(R());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/submit-erp062")
|
@PostMapping("/submit-erp062")
|
||||||
@Operation(summary = "推送ERP订单", description = "062当每次调更新接口后都需要调此接口")
|
@Operation(summary = "推送ERP订单", description = "062当每次调更新接口后都需要调此接口")
|
||||||
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
|
@PreAuthorize("@ss.hasPermission('bse:purchase-order:update')")
|
||||||
public CommonResult<?> submitErp062(@RequestParam @Validated @NotNull(message = "采购订单id不能为空") String id) {
|
public CommonResult<?> submitErp062(@RequestParam @Validated @NotNull(message = "采购订单id不能为空") String id) {
|
||||||
//TODO 推送ERP订单
|
// todo 推送ERP订单
|
||||||
|
return success(purchaseOrderService.submitErp062(Long.valueOf(id)));
|
||||||
return success(R());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//通过订单号查询订单信息
|
//通过订单号查询订单信息
|
||||||
@@ -213,8 +209,5 @@ public class PurchaseOrderController implements BusinessControllerMarker {
|
|||||||
return success(purchaseOrderService.getBindOrderByOrder(reqVO));
|
return success(purchaseOrderService.getBindOrderByOrder(reqVO));
|
||||||
}
|
}
|
||||||
|
|
||||||
private String R(){
|
|
||||||
int number = (int) (Math.random() * 900000 + 100000);
|
|
||||||
return String.valueOf(number);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,8 +129,9 @@ public class SalesOrderController implements BusinessControllerMarker {
|
|||||||
//推送erp091
|
//推送erp091
|
||||||
@PostMapping("/push-erp091")
|
@PostMapping("/push-erp091")
|
||||||
@Operation(summary = "推送erp091")
|
@Operation(summary = "推送erp091")
|
||||||
public CommonResult<Boolean> pushErp091(@RequestParam("id") String id) {
|
public CommonResult<Boolean> pushErp091(@RequestBody @Validated @NotEmpty(message = "销售订单id不能为空") List<String> ids) {
|
||||||
return success(salesOrderService.pushErp091(id));
|
ids.forEach(id -> salesOrderService.pushErp091(id));
|
||||||
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
//提交审批
|
//提交审批
|
||||||
|
|||||||
@@ -303,4 +303,9 @@ public class SalesOrderDO extends BusinessBaseDO {
|
|||||||
*/
|
*/
|
||||||
@TableField("PYER_NUM")
|
@TableField("PYER_NUM")
|
||||||
private String payerNum;
|
private String payerNum;
|
||||||
|
/**
|
||||||
|
* 税码
|
||||||
|
*/
|
||||||
|
@TableField("TAX_NUM")
|
||||||
|
private String taxNum;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.contractorder.dal.mysql.contract;
|
package com.zt.plat.module.contractorder.dal.mysql.contract;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.zt.plat.module.contractorder.api.vo.contract.DemoteRespVO;
|
import com.zt.plat.module.contractorder.api.vo.contract.DemoteRespVO;
|
||||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractDemoteDO;
|
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractDemoteDO;
|
||||||
@@ -22,7 +23,7 @@ public interface ContractDemoteMapper extends BaseMapperX<ContractDemoteDO> {
|
|||||||
", (select ctrt_name from BSE_CTRT_MAIN where id = ctrt_id) contractName",
|
", (select ctrt_name from BSE_CTRT_MAIN where id = ctrt_id) contractName",
|
||||||
", (select ctrt_ppr_num from BSE_CTRT_MAIN where id = ctrt_id) contractPaperNumber",
|
", (select ctrt_ppr_num from BSE_CTRT_MAIN where id = ctrt_id) contractPaperNumber",
|
||||||
"from bse_ctrt_dmot",
|
"from bse_ctrt_dmot",
|
||||||
"where 1 = 1",
|
"where DELETED = 0",
|
||||||
"<if test= \"contractIds != null and contractIds.size() > 0\">",
|
"<if test= \"contractIds != null and contractIds.size() > 0\">",
|
||||||
"and ctrt_id in",
|
"and ctrt_id in",
|
||||||
"<foreach collection = 'contractIds' item = 'contractId' open='(' separator = ',' close = ')'>",
|
"<foreach collection = 'contractIds' item = 'contractId' open='(' separator = ',' close = ')'>",
|
||||||
@@ -37,5 +38,5 @@ public interface ContractDemoteMapper extends BaseMapperX<ContractDemoteDO> {
|
|||||||
"</if>",
|
"</if>",
|
||||||
"</script>"
|
"</script>"
|
||||||
})
|
})
|
||||||
List<DemoteRespVO> selectDemotes(List<Long> contractIds, String materialName, String elementName);
|
IPage<DemoteRespVO> selectDemotes(IPage<?> page, List<Long> contractIds, String materialName, String elementName);
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.contractorder.dal.mysql.contract;
|
package com.zt.plat.module.contractorder.dal.mysql.contract;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.zt.plat.module.contractorder.api.vo.contract.FormulaRespVO;
|
import com.zt.plat.module.contractorder.api.vo.contract.FormulaRespVO;
|
||||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractFormulaDO;
|
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractFormulaDO;
|
||||||
@@ -22,7 +23,7 @@ public interface ContractFormulaMapper extends BaseMapperX<ContractFormulaDO> {
|
|||||||
", (select ctrt_name from BSE_CTRT_MAIN where id = ctrt_id) contractName",
|
", (select ctrt_name from BSE_CTRT_MAIN where id = ctrt_id) contractName",
|
||||||
", (select ctrt_ppr_num from BSE_CTRT_MAIN where id = ctrt_id) contractPaperNumber",
|
", (select ctrt_ppr_num from BSE_CTRT_MAIN where id = ctrt_id) contractPaperNumber",
|
||||||
"from bse_ctrt_fmu",
|
"from bse_ctrt_fmu",
|
||||||
"where 1 = 1",
|
"where DELETED = 0",
|
||||||
"<if test= \"contractIds != null and contractIds.size() > 0\">",
|
"<if test= \"contractIds != null and contractIds.size() > 0\">",
|
||||||
"and ctrt_id in",
|
"and ctrt_id in",
|
||||||
"<foreach collection = 'contractIds' item = 'contractId' open='(' separator = ',' close = ')'>",
|
"<foreach collection = 'contractIds' item = 'contractId' open='(' separator = ',' close = ')'>",
|
||||||
@@ -37,5 +38,5 @@ public interface ContractFormulaMapper extends BaseMapperX<ContractFormulaDO> {
|
|||||||
"</if>",
|
"</if>",
|
||||||
"</script>"
|
"</script>"
|
||||||
})
|
})
|
||||||
List<FormulaRespVO> selectFormulas(List<Long> contractIds, String materialName, String elementName);
|
IPage<FormulaRespVO> selectFormulas(IPage<?> page, List<Long> contractIds, String materialName, String elementName);
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.zt.plat.module.contractorder.dal.mysql.contract;
|
package com.zt.plat.module.contractorder.dal.mysql.contract;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import com.zt.plat.module.contractorder.api.vo.contract.NotRespVO;
|
import com.zt.plat.module.contractorder.api.vo.contract.NotRespVO;
|
||||||
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractNotDO;
|
import com.zt.plat.module.contractorder.dal.dataobject.contract.ContractNotDO;
|
||||||
@@ -22,7 +23,7 @@ public interface ContractNotMapper extends BaseMapperX<ContractNotDO> {
|
|||||||
", (select ctrt_name from BSE_CTRT_MAIN where id = ctrt_id) contractName",
|
", (select ctrt_name from BSE_CTRT_MAIN where id = ctrt_id) contractName",
|
||||||
", (select ctrt_ppr_num from BSE_CTRT_MAIN where id = ctrt_id) contractPaperNumber",
|
", (select ctrt_ppr_num from BSE_CTRT_MAIN where id = ctrt_id) contractPaperNumber",
|
||||||
"from bse_ctrt_nt",
|
"from bse_ctrt_nt",
|
||||||
"where 1 = 1",
|
"where DELETED = 0",
|
||||||
"<if test= \"contractIds != null and contractIds.size() > 0\">",
|
"<if test= \"contractIds != null and contractIds.size() > 0\">",
|
||||||
"and ctrt_id in",
|
"and ctrt_id in",
|
||||||
"<foreach collection = 'contractIds' item = 'contractId' open='(' separator = ',' close = ')'>",
|
"<foreach collection = 'contractIds' item = 'contractId' open='(' separator = ',' close = ')'>",
|
||||||
@@ -37,5 +38,5 @@ public interface ContractNotMapper extends BaseMapperX<ContractNotDO> {
|
|||||||
"</if>",
|
"</if>",
|
||||||
"</script>"
|
"</script>"
|
||||||
})
|
})
|
||||||
List<NotRespVO> selectNots(List<Long> contractIds, String materialName, String elementName);
|
IPage<NotRespVO> selectNots(IPage<NotRespVO> page, List<Long> contractIds, String materialName, String elementName);
|
||||||
}
|
}
|
||||||
@@ -73,7 +73,7 @@ public interface ContractService {
|
|||||||
* @param queryReqVO 查询参数
|
* @param queryReqVO 查询参数
|
||||||
* @return 不计价规则列表
|
* @return 不计价规则列表
|
||||||
*/
|
*/
|
||||||
List<NotRespVO> getNots(NotsQueryReqVO queryReqVO);
|
PageResult<NotRespVO> getNots(NotsQueryReqVO queryReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询参数降级规则列表
|
* 查询参数降级规则列表
|
||||||
@@ -81,7 +81,7 @@ public interface ContractService {
|
|||||||
* @param queryReqVO 查询参数
|
* @param queryReqVO 查询参数
|
||||||
* @return 参数降级规则列表
|
* @return 参数降级规则列表
|
||||||
*/
|
*/
|
||||||
List<DemoteRespVO> getDemotes(DemotesQueryReqVO queryReqVO);
|
PageResult<DemoteRespVO> getDemotes(DemotesQueryReqVO queryReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询结算公式列表
|
* 查询结算公式列表
|
||||||
@@ -89,7 +89,7 @@ public interface ContractService {
|
|||||||
* @param queryReqVO 查询参数
|
* @param queryReqVO 查询参数
|
||||||
* @return 结算公式列表
|
* @return 结算公式列表
|
||||||
*/
|
*/
|
||||||
List<FormulaRespVO> getFormulas(FormulasQueryReqVO queryReqVO);
|
PageResult<FormulaRespVO> getFormulas(FormulasQueryReqVO queryReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过合同编号获取对应的合同信息
|
* 通过合同编号获取对应的合同信息
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import cn.hutool.json.JSONArray;
|
|||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||||
import com.zt.plat.framework.common.pojo.PageResult;
|
import com.zt.plat.framework.common.pojo.PageResult;
|
||||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||||
@@ -1185,33 +1187,67 @@ public class ContractServiceImpl implements ContractService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<NotRespVO> getNots(NotsQueryReqVO queryReqVO) {
|
public PageResult<NotRespVO> getNots(NotsQueryReqVO queryReqVO) {
|
||||||
|
|
||||||
// 查合同ID集合
|
// 查合同ID集合
|
||||||
List<Long> contractIds = new ArrayList<>();
|
List<Long> contractIds = new ArrayList<>();
|
||||||
if (StringUtils.isNotEmpty(queryReqVO.getContractName()) || StringUtils.isNotEmpty(queryReqVO.getContractPaperNumber())) {
|
if (StringUtils.isNotEmpty(queryReqVO.getContractName())
|
||||||
|
|| StringUtils.isNotEmpty(queryReqVO.getContractPaperNumber())) {
|
||||||
contractIds = getContractIds(queryReqVO.getContractName(), queryReqVO.getContractPaperNumber());
|
contractIds = getContractIds(queryReqVO.getContractName(), queryReqVO.getContractPaperNumber());
|
||||||
}
|
}
|
||||||
return contractNotMapper.selectNots(contractIds, queryReqVO.getMaterialName(), queryReqVO.getElementName());
|
|
||||||
|
// 分页查询
|
||||||
|
IPage<NotRespVO> ipage = contractNotMapper.selectNots(
|
||||||
|
new Page<NotRespVO>().setCurrent(queryReqVO.getPageNo()).setSize(queryReqVO.getPageSize()),
|
||||||
|
contractIds,
|
||||||
|
queryReqVO.getMaterialName(),
|
||||||
|
queryReqVO.getElementName()
|
||||||
|
);
|
||||||
|
|
||||||
|
// 分页返回
|
||||||
|
return new PageResult<NotRespVO>().setTotal(ipage.getTotal()).setList(ipage.getRecords());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<DemoteRespVO> getDemotes(DemotesQueryReqVO queryReqVO) {
|
public PageResult<DemoteRespVO> getDemotes(DemotesQueryReqVO queryReqVO) {
|
||||||
|
|
||||||
// 查合同ID集合
|
// 查合同ID集合
|
||||||
List<Long> contractIds = new ArrayList<>();
|
List<Long> contractIds = new ArrayList<>();
|
||||||
if (StringUtils.isNotEmpty(queryReqVO.getContractName()) || StringUtils.isNotEmpty(queryReqVO.getContractPaperNumber())) {
|
if (StringUtils.isNotEmpty(queryReqVO.getContractName()) || StringUtils.isNotEmpty(queryReqVO.getContractPaperNumber())) {
|
||||||
contractIds = getContractIds(queryReqVO.getContractName(), queryReqVO.getContractPaperNumber());
|
contractIds = getContractIds(queryReqVO.getContractName(), queryReqVO.getContractPaperNumber());
|
||||||
}
|
}
|
||||||
return contractDemoteMapper.selectDemotes(contractIds, queryReqVO.getMaterialName(), queryReqVO.getElementName());
|
|
||||||
|
// 分页查询
|
||||||
|
IPage<DemoteRespVO> ipage = contractDemoteMapper.selectDemotes(
|
||||||
|
new Page<>().setCurrent(queryReqVO.getPageNo()).setSize(queryReqVO.getPageSize()),
|
||||||
|
contractIds,
|
||||||
|
queryReqVO.getMaterialName(),
|
||||||
|
queryReqVO.getElementName()
|
||||||
|
);
|
||||||
|
|
||||||
|
// 分页返回
|
||||||
|
return new PageResult<DemoteRespVO>().setTotal(ipage.getTotal()).setList(ipage.getRecords());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<FormulaRespVO> getFormulas(FormulasQueryReqVO queryReqVO) {
|
public PageResult<FormulaRespVO> getFormulas(FormulasQueryReqVO queryReqVO) {
|
||||||
|
|
||||||
// 查合同ID集合
|
// 查合同ID集合
|
||||||
List<Long> contractIds = new ArrayList<>();
|
List<Long> contractIds = new ArrayList<>();
|
||||||
if (StringUtils.isNotEmpty(queryReqVO.getContractName()) || StringUtils.isNotEmpty(queryReqVO.getContractPaperNumber())) {
|
if (StringUtils.isNotEmpty(queryReqVO.getContractName()) || StringUtils.isNotEmpty(queryReqVO.getContractPaperNumber())) {
|
||||||
contractIds = getContractIds(queryReqVO.getContractName(), queryReqVO.getContractPaperNumber());
|
contractIds = getContractIds(queryReqVO.getContractName(), queryReqVO.getContractPaperNumber());
|
||||||
}
|
}
|
||||||
return contractFormulaMapper.selectFormulas(contractIds, queryReqVO.getMaterialName(), queryReqVO.getElementName());
|
|
||||||
|
// 分页查询
|
||||||
|
IPage<FormulaRespVO> ipage = contractFormulaMapper.selectFormulas(
|
||||||
|
new Page<>().setCurrent(queryReqVO.getPageNo()).setSize(queryReqVO.getPageSize()),
|
||||||
|
contractIds,
|
||||||
|
queryReqVO.getMaterialName(),
|
||||||
|
queryReqVO.getElementName()
|
||||||
|
);
|
||||||
|
|
||||||
|
// 分页返回
|
||||||
|
return new PageResult<FormulaRespVO>().setTotal(ipage.getTotal()).setList(ipage.getRecords());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -351,18 +351,19 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|||||||
erpOrderSaveReqVO.setItems(items);
|
erpOrderSaveReqVO.setItems(items);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 4. 推送ERP并处理返回结果
|
//todo 4. 推送ERP并处理返回结果
|
||||||
String s = erpOrderService.submitOrderToErp061(erpOrderSaveReqVO);
|
// String s = erpOrderService.submitOrderToErp061(erpOrderSaveReqVO);
|
||||||
log.info("订单推送成功,订单id【{}】", order.getId());
|
log.info("订单推送成功,订单id【{}】", order.getId());
|
||||||
|
|
||||||
// 解析ERP返回的ID
|
// 解析ERP返回的ID
|
||||||
JSONObject jsonObject = JSONObject.parseObject(s);
|
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(Map.of("id",R())));
|
||||||
String erpId = jsonObject.getString("id");
|
String erpId = jsonObject.getString("id");
|
||||||
if (erpId != null && !erpId.isEmpty()) {
|
if (erpId != null && !erpId.isEmpty()) {
|
||||||
// 更新订单的ERP编号
|
// 更新订单的ERP编号
|
||||||
PurchaseOrderDO updateDO = new PurchaseOrderDO();
|
PurchaseOrderDO updateDO = new PurchaseOrderDO();
|
||||||
updateDO.setId(order.getId());
|
updateDO.setId(order.getId());
|
||||||
updateDO.setOrderSAPNumber(erpId);
|
updateDO.setOrderSAPNumber(erpId);
|
||||||
|
updateDO.setStatus(OrderStatusEnum.IN_PROGRESS.getCode());
|
||||||
int updateCount = purchaseOrderMapper.updateById(updateDO);
|
int updateCount = purchaseOrderMapper.updateById(updateDO);
|
||||||
if (updateCount > 0) {
|
if (updateCount > 0) {
|
||||||
log.info("更新订单ERPID成功,订单id【{}】", order.getId());
|
log.info("更新订单ERPID成功,订单id【{}】", order.getId());
|
||||||
@@ -786,4 +787,9 @@ public class PurchaseOrderServiceImpl implements PurchaseOrderService {
|
|||||||
return new IllegalArgumentException("BPM状态码不能为null");
|
return new IllegalArgumentException("BPM状态码不能为null");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String R(){
|
||||||
|
int number = (int) (Math.random() * 900000 + 100000);
|
||||||
|
return String.valueOf(number);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,10 +40,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.List;
|
|
||||||
import java.util.Objects;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static com.zt.plat.module.contractorder.enums.ErrorCodeConstants.CONTRACT_ORDER_EXISTS;
|
import static com.zt.plat.module.contractorder.enums.ErrorCodeConstants.CONTRACT_ORDER_EXISTS;
|
||||||
@@ -242,13 +239,17 @@ public class SalesOrderServiceImpl implements SalesOrderService {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
erpSalesOrderSaveReqVO.setConds(conds);
|
erpSalesOrderSaveReqVO.setConds(conds);
|
||||||
String result = erpOrderService.submitOrderToErp091(erpSalesOrderSaveReqVO);
|
// String result = erpOrderService.submitOrderToErp091(erpSalesOrderSaveReqVO);
|
||||||
|
String result="3333";
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
JSONObject jsonObject = JSONObject.parseObject(result);
|
JSONObject jsonObject = JSONObject.parseObject(JSONObject.toJSONString(Map.of("salesdocument",R())));
|
||||||
String salesdocument = jsonObject.getString("salesdocument");
|
String salesdocument = jsonObject.getString("salesdocument");
|
||||||
if (salesdocument != null) {
|
if (salesdocument != null) {
|
||||||
salesOrderDO.setOrderSAPNumber(salesdocument);
|
SalesOrderDO upVo = new SalesOrderDO();
|
||||||
salesOrderMapper.updateById(salesOrderDO);
|
upVo.setId(salesOrderDO.getId());
|
||||||
|
upVo.setOrderSAPNumber(salesdocument);
|
||||||
|
upVo.setStatus(OrderStatusEnum.IN_PROGRESS.getCode());
|
||||||
|
salesOrderMapper.updateById(upVo);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -540,4 +541,9 @@ public class SalesOrderServiceImpl implements SalesOrderService {
|
|||||||
})
|
})
|
||||||
.orElseThrow(() -> new IllegalArgumentException("BPM状态码不能为null"));
|
.orElseThrow(() -> new IllegalArgumentException("BPM状态码不能为null"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String R(){
|
||||||
|
int number = (int) (Math.random() * 900000 + 100000);
|
||||||
|
return String.valueOf(number);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user