From 06a4beb8556c9a7d6b4b8c5c65f1acc1c8c294a4 Mon Sep 17 00:00:00 2001 From: Yen Date: Thu, 21 Sep 2023 16:48:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/qs/serve/common/util/HttpUtil.java | 4 +++- .../sale/controller/SalePlanController.java | 16 +++++++++------- .../modules/sale/mapper/SalePlanGoodsMapper.java | 2 +- .../serve/modules/tbs/entity/TbsCostApply.java | 6 ++++++ .../third/service/PortalOfCostApplication.java | 4 ++++ .../modules/vtb/entity/VtbVerification.java | 6 ++++++ .../service/impl/VtbVerificationServiceImpl.java | 2 +- 7 files changed, 30 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/qs/serve/common/util/HttpUtil.java b/src/main/java/com/qs/serve/common/util/HttpUtil.java index 283638dd..0398a3a9 100644 --- a/src/main/java/com/qs/serve/common/util/HttpUtil.java +++ b/src/main/java/com/qs/serve/common/util/HttpUtil.java @@ -36,6 +36,7 @@ public class HttpUtil { public static String doPost(String url, String jsonStr, HashMap headers) { CloseableHttpClient client = HttpClientBuilder.create().build(); CloseableHttpResponse response = null; + String errorMsg = null; try { //设post请求 HttpPost post = new HttpPost(url); @@ -57,6 +58,7 @@ public class HttpUtil { return EntityUtils.toString(response.getEntity()); } } catch (IOException e) { + errorMsg = e.getMessage(); e.printStackTrace(); }finally { try { @@ -68,7 +70,7 @@ public class HttpUtil { e.printStackTrace(); } } - return null; + return errorMsg; } public static String doGet(String url, HashMap headers) { diff --git a/src/main/java/com/qs/serve/modules/sale/controller/SalePlanController.java b/src/main/java/com/qs/serve/modules/sale/controller/SalePlanController.java index 9c0a93a9..eabea85e 100644 --- a/src/main/java/com/qs/serve/modules/sale/controller/SalePlanController.java +++ b/src/main/java/com/qs/serve/modules/sale/controller/SalePlanController.java @@ -85,10 +85,12 @@ public class SalePlanController { */ @PostMapping("/updateById") @SysLog(module = SystemModule.SALE, title = "销售计划", biz = BizType.UPDATE) - public R updateById(@RequestBody @Valid SalePlanBo param){ - SalePlan entity = CopierUtil.copy(param,new SalePlan()); - boolean result = salePlanService.updateById(entity); - return R.isTrue(result); + public R updateById(@RequestBody SalePlanBo param){ + if(param.getId()==null){ + return R.error(); + } + SalePlan salePlan = salePlanService.modify(param); + return R.ok(salePlan); } /** @@ -99,9 +101,9 @@ public class SalePlanController { @PostMapping("/save") @SysLog(module = SystemModule.SALE, title = "销售计划", biz = BizType.INSERT) public R save(@RequestBody @Valid SalePlanBo param){ - SalePlan entity = CopierUtil.copy(param,new SalePlan()); - boolean result = salePlanService.save(entity); - return R.isTrue(result); + param.setId(null); + SalePlan salePlan = salePlanService.modify(param); + return R.ok(salePlan); } /** diff --git a/src/main/java/com/qs/serve/modules/sale/mapper/SalePlanGoodsMapper.java b/src/main/java/com/qs/serve/modules/sale/mapper/SalePlanGoodsMapper.java index 2eea7769..bdce9a7d 100644 --- a/src/main/java/com/qs/serve/modules/sale/mapper/SalePlanGoodsMapper.java +++ b/src/main/java/com/qs/serve/modules/sale/mapper/SalePlanGoodsMapper.java @@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.DeleteMapping; */ public interface SalePlanGoodsMapper extends BaseMapper { - @Update("update set del_flag = 1 where plan_id = #{planId}") + @Update("update sale_plan_goods set del_flag = 1 where plan_id = #{planId}") int deleteByPlanId(@Param("planId") Long planId); } diff --git a/src/main/java/com/qs/serve/modules/tbs/entity/TbsCostApply.java b/src/main/java/com/qs/serve/modules/tbs/entity/TbsCostApply.java index 2ff9e4a9..84ca43ef 100644 --- a/src/main/java/com/qs/serve/modules/tbs/entity/TbsCostApply.java +++ b/src/main/java/com/qs/serve/modules/tbs/entity/TbsCostApply.java @@ -34,6 +34,12 @@ public class TbsCostApply implements Serializable { private String code; + /** 发货单号 */ + private String disCode; + + /** 发票号 */ + private String billNumber; + /** 主题 */ @NotBlank(message = "主题不能为空") @Length(max = 60,message = "主题长度不能超过60字") diff --git a/src/main/java/com/qs/serve/modules/third/service/PortalOfCostApplication.java b/src/main/java/com/qs/serve/modules/third/service/PortalOfCostApplication.java index 7c4bda50..28f66d99 100644 --- a/src/main/java/com/qs/serve/modules/third/service/PortalOfCostApplication.java +++ b/src/main/java/com/qs/serve/modules/third/service/PortalOfCostApplication.java @@ -607,6 +607,8 @@ public class PortalOfCostApplication { } //构建费用申请 TbsCostApply costApply = new TbsCostApply(); + costApply.setDisCode(disNumber); + costApply.setBillNumber(billNumber); costApply.setCode(costCode); costApply.setMatchType(1); costApply.setChargeTheme(costTheme); @@ -786,6 +788,8 @@ public class PortalOfCostApplication { //保存核销申请 VtbVerification verification = new VtbVerification(); + verification.setDisCode(disNumber); + verification.setBillNumber(billNumber); // verification.setVerificationCode("MHX"+ CodeGenUtil.generate(CodeGenUtil.SourceKey.Verification)); verification.setVerificationCode(costCode); verification.setVerificationMainCode(verification.getVerificationCode()); diff --git a/src/main/java/com/qs/serve/modules/vtb/entity/VtbVerification.java b/src/main/java/com/qs/serve/modules/vtb/entity/VtbVerification.java index 2045930f..6eeca2ec 100644 --- a/src/main/java/com/qs/serve/modules/vtb/entity/VtbVerification.java +++ b/src/main/java/com/qs/serve/modules/vtb/entity/VtbVerification.java @@ -157,6 +157,12 @@ public class VtbVerification implements Serializable { /** 支付条件id */ private Long payConditionId; + /** 发货单号 */ + private String disCode; + + /** 发票号 */ + private String billNumber; + /** 申请人 */ @NotBlank(message = "申请人不能为空") @Length(max = 32,message = "申请人长度不能超过32字") diff --git a/src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationServiceImpl.java b/src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationServiceImpl.java index 3b535b62..5ba42a82 100644 --- a/src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationServiceImpl.java +++ b/src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationServiceImpl.java @@ -901,7 +901,7 @@ public class VtbVerificationServiceImpl extends ServiceImpl