md
This commit is contained in:
parent
6a52a82e5f
commit
729be25a12
@ -22,6 +22,7 @@ import com.xdadan.erp.common.annotation.filter.jackson.JacksonFilter;
|
||||
import com.xdadan.erp.common.core.redis.RedissonService;
|
||||
import com.xdadan.erp.common.utils.DateUtils;
|
||||
import com.xdadan.erp.emis.domain.EmisCommissionDtl;
|
||||
import com.xdadan.erp.emis.domain.EmisTmsSiteBatch;
|
||||
import com.xdadan.erp.emis.domain.EmisWaybill;
|
||||
import com.xdadan.erp.emis.service.EmisBaseService;
|
||||
import com.xdadan.erp.emis.service.IEmisCommissionDtlService;
|
||||
@ -118,6 +119,7 @@ public class EmisCommissionProfitController extends BaseController
|
||||
try{
|
||||
EmisWaybill emisWaybill = new EmisWaybill();
|
||||
emisWaybill.getParams().put("noNeedBlProfit","Y");
|
||||
emisWaybill.getParams().put("billMonth",billMonth.replaceAll("-",""));
|
||||
emisCommissionProfitService.autoDoBillProfit(emisWaybill);
|
||||
}catch(Exception ex){
|
||||
ex.printStackTrace();
|
||||
@ -135,26 +137,54 @@ public class EmisCommissionProfitController extends BaseController
|
||||
* @param batchNo
|
||||
* @return
|
||||
*/
|
||||
@GetMapping(value = "/batchReCalcProfitByBatchNo")
|
||||
public AjaxResult batchReCalcProfitByBatchNo(String batchNo)
|
||||
@GetMapping(value = "/reCalcByBatchNo")
|
||||
public AjaxResult reCalcByBatchNo(String batchNo)
|
||||
{
|
||||
if(!StringUtils.isEmpty(batchNo)){
|
||||
batchNo=WaybillHelper.formatQueryValue(batchNo);
|
||||
String[] batchNoSortList = batchNo.split(",");
|
||||
if(batchNoSortList.length>0){
|
||||
for (int i=0;i<batchNoSortList.length;i++){
|
||||
String subBillCode=batchNoSortList[i];
|
||||
try {
|
||||
emisCommissionProfitService.reCalcProfitByBillCode(subBillCode);
|
||||
}catch (Exception ex){
|
||||
return AjaxResult.error("计算失败-单号:["+subBillCode+"]");
|
||||
}
|
||||
if(StringUtils.isEmpty(batchNo)){
|
||||
return AjaxResult.error("计算失败-批次号不能为空");
|
||||
}
|
||||
|
||||
batchNo=WaybillHelper.formatQueryValue(batchNo);
|
||||
String[] batchNoSortList = batchNo.split(",");
|
||||
if(batchNoSortList.length>0){
|
||||
for (int i=0;i<batchNoSortList.length;i++){
|
||||
String subBatchNo=batchNoSortList[i];
|
||||
try {
|
||||
emisCommissionProfitService.reCalcProfitByBatchNo(subBatchNo);
|
||||
}catch (Exception ex){
|
||||
return AjaxResult.error("计算失败-批次号:["+subBatchNo+"]");
|
||||
}
|
||||
}
|
||||
return AjaxResult.success("计算成功");
|
||||
}else{
|
||||
return AjaxResult.error("计算失败-单号不能为空");
|
||||
}
|
||||
return AjaxResult.success("计算成功");
|
||||
}
|
||||
|
||||
@GetMapping(value = "/reCalcByBatchMonth")
|
||||
public AjaxResult reCalcByBatchMonth(String billMonth)
|
||||
{
|
||||
if(StringUtils.isEmpty(billMonth)){
|
||||
return AjaxResult.error("月份不能为空");
|
||||
}
|
||||
|
||||
String lockKey="reCalcByBatchMonth";
|
||||
log.info("reCalcByBatchMonth start");
|
||||
|
||||
// 加锁查询
|
||||
redissonService.lock(lockKey,300);
|
||||
try{
|
||||
EmisTmsSiteBatch tmsSiteBatch = new EmisTmsSiteBatch();
|
||||
tmsSiteBatch.getParams().put("noNeedBlProfit","Y");
|
||||
tmsSiteBatch.getParams().put("billMonth",billMonth.replaceAll("-",""));
|
||||
emisCommissionProfitService.autoDoBatchProfit(tmsSiteBatch);
|
||||
}catch(Exception ex){
|
||||
ex.printStackTrace();
|
||||
log.error("reCalcByBatchMonth exception:"+ex.getMessage());
|
||||
return AjaxResult.error("计算异常:"+ex.getMessage());
|
||||
}
|
||||
log.info("reCalcByBatchMonth end");
|
||||
|
||||
redissonService.unlock(lockKey);
|
||||
return AjaxResult.success("计算成功");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -2344,9 +2344,11 @@
|
||||
emis_waybill a
|
||||
WHERE
|
||||
a.del_flag = '0'
|
||||
AND a.bl_profit = '0'
|
||||
AND a.order_status != '0'
|
||||
AND a.order_status != '2'
|
||||
<if test="params.noNeedBlProfit == null">
|
||||
AND a.bl_profit = '0'
|
||||
</if>
|
||||
and not EXISTS (
|
||||
select 1 from emis_waybill_problem_info ewpi where a.bill_code=ewpi.bill_code and ewpi.del_flag='0' and ewpi.`problem_type` in(173,170,151)
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user