|
@@ -19,6 +19,7 @@ import com.ruoyi.common.core.domain.entity.SysDictData;
|
|
|
import com.ruoyi.common.core.domain.entity.SysUser;
|
|
|
import com.ruoyi.common.core.domain.entity.TWarehouse;
|
|
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
|
+import com.ruoyi.common.exception.BaseException;
|
|
|
import com.ruoyi.common.exception.WarehouseException;
|
|
|
import com.ruoyi.common.utils.DateUtils;
|
|
|
import com.ruoyi.common.utils.DictUtils;
|
|
@@ -3075,9 +3076,16 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
}
|
|
|
}
|
|
|
tWarehousebillsitems.setfChargedate(time);//仓储费计算日期
|
|
|
- if (warehousebillsitems.getfBillstatus() != 30L) {
|
|
|
+
|
|
|
+ SysConfig sysConfig = sysConfigMapper.checkConfigKeyUnique("entry.printing");
|
|
|
+ if (StringUtils.isNull(sysConfig)) {
|
|
|
+ throw new BaseException("系统参数异常");
|
|
|
+ }
|
|
|
+ String configValue = sysConfig.getConfigValue();
|
|
|
+ if ("0".equals(configValue) && warehousebillsitems.getfBillstatus() != 30L) {
|
|
|
return AjaxResult.error("请确认是该明细数据是否存在,或该明细数据状态异常");
|
|
|
}
|
|
|
+
|
|
|
TGoods goods = tGoodsMapper.selectTGoodsById(warehousebillsitems.getfGoodsid());
|
|
|
if ("1".equals(goods.getIfCntrno()) && StringUtils.isNull(warehousebillsitems.getfCntrno())) {
|
|
|
return AjaxResult.error("仓库明细第未找到箱号");
|
|
@@ -6141,11 +6149,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
tWarehousebillsCntrMapper.deleteTWarehousebillsCntrfPid(tWarehousebills.getfId());
|
|
|
JSONArray warehouseJSON = JSONArray.parseArray(warehousebillsitems);
|
|
|
List<TWarehousebillsitems> warehousebillsitemsList = JSONObject.parseArray(warehouseJSON.toJSONString(), TWarehousebillsitems.class);
|
|
|
- /**
|
|
|
- * 流水号回收
|
|
|
- * 1、 获取所有流水号
|
|
|
- */
|
|
|
- List<String> serialNumberList = new ArrayList<>();
|
|
|
+
|
|
|
if (StringUtils.isNotEmpty(warehousebillsitemsList)) {
|
|
|
int i = 1;
|
|
|
for (TWarehousebillsitems wb : warehousebillsitemsList) {
|
|
@@ -6153,9 +6157,6 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
if ("1".equals(goods.getIfCntrno()) && StringUtils.isNull(wb.getfCntrno())) {
|
|
|
return AjaxResult.error("仓库明细第" + i + "行未找到箱号");
|
|
|
}
|
|
|
- if (StringUtils.isNotNull(wb.getfSerialNumber())) {
|
|
|
- serialNumberList.add(wb.getfSerialNumber()); // 流水号回收
|
|
|
- }
|
|
|
if (WarehouseTypeEnum.SJRK_REVOKE.getType().equals(billsType)) { // 撤销 入库
|
|
|
// 查询库存总账
|
|
|
TWhgenleg tWhgenle = queryWhgenlegService.stockWhgenleg(tWarehousebills, wb, goods.getIfCntrno(), WarehouseTypeEnum.UNDO_OPERATION.getType());
|
|
@@ -6255,20 +6256,6 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (!WarehouseTypeEnum.HQZY_REVOKE.getType().equals(billsType)) {
|
|
|
- /**
|
|
|
- * 流水号回收
|
|
|
- * 2、 流水号去重
|
|
|
- * 3、 添加到 billno_del
|
|
|
- */
|
|
|
- List<String> serialNumberNewList = delRepeat(serialNumberList);
|
|
|
- serialNumberNewList.forEach(item -> {
|
|
|
- BillnoDel billnoDel = new BillnoDel();
|
|
|
- billnoDel.setBillType(item.substring(0, 2));
|
|
|
- billnoDel.setBillNo(item);
|
|
|
- billnoDelMapper.insertBillnoDel(billnoDel);
|
|
|
- });
|
|
|
- }
|
|
|
// 箱型数据
|
|
|
if (StringUtils.isNotNull(tCntr) && !"[]".equals(tCntr)) {
|
|
|
JSONArray jsonDrArray = JSONArray.parseArray(tCntr);
|
|
@@ -6309,7 +6296,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
wbDr.setfDc("D");
|
|
|
wbDr.setCreateBy(loginUser.getUser().getUserName());
|
|
|
wbDr.setCreateTime(new Date());
|
|
|
- if (tWarehousebills.getfBsdate() != null && !tWarehousebills.getfBsdate().equals("")) {
|
|
|
+ if (tWarehousebills.getfBsdate() != null && !"".equals(tWarehousebills.getfBsdate())) {
|
|
|
wbDr.setfBsdate(tWarehousebills.getfBsdate());
|
|
|
}
|
|
|
tWarehousebillsfeesMapper.insertTWarehousebillsfees(wbDr);
|
|
@@ -6324,7 +6311,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
wbCr.setfDc("C");
|
|
|
wbCr.setCreateBy(loginUser.getUser().getUserName());
|
|
|
wbCr.setCreateTime(new Date());
|
|
|
- if (tWarehousebills.getfBsdate() != null && !tWarehousebills.getfBsdate().equals("")) {
|
|
|
+ if (tWarehousebills.getfBsdate() != null && !"".equals(tWarehousebills.getfBsdate())) {
|
|
|
wbCr.setfBsdate(tWarehousebills.getfBsdate());
|
|
|
}
|
|
|
tWarehousebillsfeesMapper.insertTWarehousebillsfees(wbCr);
|
|
@@ -6341,8 +6328,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
|
|
|
|
|
|
public static List<String> delRepeat(List<String> list) {
|
|
|
- List<String> myList = list.stream().distinct().collect(Collectors.toList());
|
|
|
- return myList;
|
|
|
+ return list.stream().distinct().collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -7948,7 +7934,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
if (StringUtils.isNotEmpty(endDate)) {
|
|
|
endDate += " 00:00:00";
|
|
|
}
|
|
|
- Map<String, Object> statistics = tWhgenlegMapper.stockStatistics(beginDate, endDate, external, null, null);
|
|
|
+ Map<String, Object> statistics = tWhgenlegMapper.stockStatistics(beginDate, endDate, external, null, null, null);
|
|
|
return String.valueOf(statistics.get("quantity"));
|
|
|
}
|
|
|
|