|
|
@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.nl.common.base.CommonPage; |
|
|
|
import org.nl.common.enums.wms.EasBillTypeEnum; |
|
|
|
import org.nl.common.exception.BadRequestException; |
|
|
@ -78,7 +79,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
* 首页显示出入库单据数量 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public List<HomeBillCounts> getBillsCount() { |
|
|
|
public List<HomeBillCounts> getBillsCount() throws InterruptedException { |
|
|
|
|
|
|
|
List<HomeBillCounts> allCounts =easOutInBillMapper.getBillsCount(); |
|
|
|
HomeBillCounts allocations =new HomeBillCounts(); |
|
|
@ -132,7 +133,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
.lambda() |
|
|
|
.eq(ObjectUtil.isNotEmpty(params.getDjlx()), EasOutInBill::getDjlx, params.getDjlx()) |
|
|
|
.eq(ObjectUtil.isNotEmpty(params.getCkbm()), EasOutInBill::getCkbm, params.getCkbm()) |
|
|
|
.eq(ObjectUtil.isNotEmpty(params.getDjzt()), EasOutInBill::getDjzt, "1".equals(params.getDjzt()) ? "提交" : "审核") |
|
|
|
.eq(EasOutInBill::getDjzt, "提交") |
|
|
|
.nested(ObjectUtil.isNotEmpty(params.getFuzzy()), |
|
|
|
i -> i.like(EasOutInBill::getDjid, params.getFuzzy()) |
|
|
|
.or() |
|
|
@ -549,23 +550,28 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
EasData easData = new EasData(); |
|
|
|
easData.setData(bill); |
|
|
|
String billJson = com.alibaba.fastjson.JSON.toJSONString(easData, SerializerFeature.WriteMapNullValue); |
|
|
|
msgDto = wmsToEasService.sendWebService(billJson); |
|
|
|
if (msgDto != null) { |
|
|
|
if (msgDto.getResult() == 0) { |
|
|
|
throw new BadRequestException(msgDto.getMsg()); |
|
|
|
} |
|
|
|
String msg ="审核失败:此入库单在PC端完成操作,单据为:CGRK2024072316142732"; |
|
|
|
UpdateWrapper<EasOutInBill> updateWrapper = new UpdateWrapper<EasOutInBill>().set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd")).eq("djid", bill.getBillId()); |
|
|
|
if (StringUtils.isNoneBlank(msg)) { |
|
|
|
updateWrapper.set("shjg", msg); |
|
|
|
} else { |
|
|
|
updateWrapper.set("djzt", "审核"); |
|
|
|
} |
|
|
|
easOutInBillMapper.update(null, updateWrapper); |
|
|
|
// msgDto = wmsToEasService.sendWebService(billJson);
|
|
|
|
} else { |
|
|
|
SrmMsgDto srmMsgDto; |
|
|
|
String billJson = com.alibaba.fastjson.JSON.toJSONString(bill, SerializerFeature.WriteMapNullValue); |
|
|
|
srmMsgDto = wmsToSrmService.sendWebPostData(billJson); |
|
|
|
if (srmMsgDto != null) { |
|
|
|
if ("false".equals(srmMsgDto.getSuccess())) { |
|
|
|
throw new BadRequestException(srmMsgDto.getMessage()); |
|
|
|
} |
|
|
|
// srmMsgDto = wmsToSrmService.sendWebPostData(billJson);
|
|
|
|
String msg =""; |
|
|
|
UpdateWrapper<EasOutInBill> updateWrapper = new UpdateWrapper<EasOutInBill>().set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd")).eq("djid", bill.getBillId()); |
|
|
|
if (StringUtils.isNoneBlank(msg)) { |
|
|
|
updateWrapper.set("shjg", msg); |
|
|
|
} else { |
|
|
|
updateWrapper.set("djzt", "审核"); |
|
|
|
} |
|
|
|
easOutInBillMapper.update(null, updateWrapper); |
|
|
|
} |
|
|
|
updateBills(bill); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString()); |
|
|
|
throw new BadRequestException(e.toString()); |
|
|
@ -582,8 +588,15 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
EasData easData = new EasData(); |
|
|
|
easData.setData(bill); |
|
|
|
String billJson = com.alibaba.fastjson.JSON.toJSONString(easData, SerializerFeature.WriteMapNullValue); |
|
|
|
wmsToEasService.sendWebService(billJson); |
|
|
|
updateBills(bill); |
|
|
|
// wmsToEasService.sendWebService(billJson);
|
|
|
|
String msg ="审核失败:此入库单在PC端完成操作,单据为:CGRK2024072316142732"; |
|
|
|
UpdateWrapper<EasOutInBill> updateWrapper = new UpdateWrapper<EasOutInBill>().set("update_id", SecurityUtils.getCurrentUserId()).set("update_name", SecurityUtils.getCurrentNickName()).set("update_time", DateUtil.format(DateUtil.beginOfDay(DateUtil.date()), "yyyy-MM-dd")).eq("djid", bill.getBillId()); |
|
|
|
if (StringUtils.isNoneBlank(msg)) { |
|
|
|
updateWrapper.set("shjg", msg); |
|
|
|
} else { |
|
|
|
updateWrapper.set("djzt", "审核"); |
|
|
|
} |
|
|
|
easOutInBillMapper.update(null, updateWrapper); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString()); |
|
|
|
//throw new BadRequestException(e.toString());
|
|
|
@ -599,7 +612,7 @@ public class EasOutInBillServiceImpl extends ServiceImpl<EasOutInBillMapper, Eas |
|
|
|
for (EasOutInBillDto bill : bills) { |
|
|
|
try { |
|
|
|
String billJson = com.alibaba.fastjson.JSON.toJSONString(bill, SerializerFeature.WriteMapNullValue); |
|
|
|
wmsToSrmService.sendWebPostData(billJson); |
|
|
|
// wmsToSrmService.sendWebPostData(billJson);
|
|
|
|
updateBills(bill); |
|
|
|
} catch (Exception e) { |
|
|
|
log.error("推送Eas单据失败,单据号为:[" + bill.getBillId() + "]异常原因:" + e.toString()); |
|
|
|