Browse Source

调整

v1.0
Yen 2 years ago
parent
commit
06a4beb855
  1. 4
      src/main/java/com/qs/serve/common/util/HttpUtil.java
  2. 16
      src/main/java/com/qs/serve/modules/sale/controller/SalePlanController.java
  3. 2
      src/main/java/com/qs/serve/modules/sale/mapper/SalePlanGoodsMapper.java
  4. 6
      src/main/java/com/qs/serve/modules/tbs/entity/TbsCostApply.java
  5. 4
      src/main/java/com/qs/serve/modules/third/service/PortalOfCostApplication.java
  6. 6
      src/main/java/com/qs/serve/modules/vtb/entity/VtbVerification.java
  7. 2
      src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationServiceImpl.java

4
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<String,String> 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<String,String> headers) {

16
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);
}
/**

2
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<SalePlanGoods> {
@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);
}

6
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字")

4
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());

6
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字")

2
src/main/java/com/qs/serve/modules/vtb/service/impl/VtbVerificationServiceImpl.java

@ -901,7 +901,7 @@ public class VtbVerificationServiceImpl extends ServiceImpl<VtbVerificationMappe
totalFunFlow = totalFunFlow.add(fundFlow.getUsedAmount());
}
BigDecimal allowAmount = activity.getTotalAmount().subtract(totalFunFlow);
if(allowAmount.compareTo(BigDecimal.ZERO)<1){
if(allowAmount.compareTo(BigDecimal.ZERO)<0){
Assert.throwEx("无可用费用");
}
return allowAmount;

Loading…
Cancel
Save