Merge pull request 'develop' (#306) from develop into master

Reviewed-on: http://git.xdadan.loc/tanex/emis-service/pulls/306
This commit is contained in:
heyu 2026-01-28 13:11:46 +08:00
commit 0940bc6f9f
3 changed files with 41 additions and 1 deletions

View File

@ -45,6 +45,7 @@ import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.scheduling.annotation.Async;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
@ -53,6 +54,9 @@ import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.FileOutputStream;
import java.io.OutputStream;
import java.time.LocalDateTime;
import java.time.YearMonth;
import java.time.format.DateTimeFormatter;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.util.*;
@ -1515,6 +1519,39 @@ public class EmisCommonController extends EmisBaseController
}
/**
* 触发按月份计算运单成本
* @return
*/
@GetMapping(value = "/reCalcCostFeeByBillMonth")
@Async
public AjaxResult reCalcCostFeeByBillMonth(String billMonth)
{
if(StringUtils.isEmpty(billMonth)){
return AjaxResult.error("月份不能为空");
}
String lockKey="reCalcCostFeeByBillMonth";
log.info("reCalcCostFeeByBillMonth start");
// 加锁查询
redissonService.lock(lockKey,300);
try{
EmisWaybill emisWaybill = new EmisWaybill();
emisWaybill.getParams().put("billMonth",billMonth.replaceAll("-",""));
emisWaybill.getParams().put("blAllScan","1");
emisTmsCostFeeService.redoCalcCostFeeWaitWaybill(emisWaybill);
}catch(Exception ex){
ex.printStackTrace();
log.error("reCalcCostFeeByBillMonth exception:"+ex.getMessage());
return AjaxResult.error("计算异常:"+ex.getMessage());
}
log.info("reCalcCostFeeByBillMonth end");
redissonService.unlock(lockKey);
return AjaxResult.success("计算成功");
}
/**
* 导出进仓单-对接外部
*

View File

@ -69,6 +69,7 @@ public class EmisTransProductServiceImpl implements IEmisTransProductService
// 获取线路编号
QueryWrapper<EmisTransProduct> queryWrapper=new QueryWrapper<>();
queryWrapper.likeRight("prod_code",emisTransProduct.getTransLineCode()+"-");
queryWrapper.eq("trans_line_code", emisTransProduct.getTransLineCode());
queryWrapper.select("prod_code");
queryWrapper.orderByDesc("prod_code");
queryWrapper.last("LIMIT 1");

View File

@ -3586,13 +3586,15 @@
a.del_flag = '0'
AND a.order_status != '0'
AND a.order_status != '2'
AND a.bl_calc_cost = '0'
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(151)
)
<if test="params.billMonth != null and params.billMonth != ''">
and DATE_FORMAT(a.send_date,'%Y%m')= #{params.billMonth}
</if>
<if test="params.blAllScan != 1">
and a.bl_calc_cost= '0'
</if>
ORDER BY a.send_date DESC
</select>