|
@@ -33,6 +33,7 @@ import com.ruoyi.quotation.domain.TSeaprice;
|
|
|
import com.ruoyi.quotation.mapper.TSeapriceMapper;
|
|
|
import com.ruoyi.reportManagement.domain.TWareHouseItemsExcel;
|
|
|
import com.ruoyi.reportManagement.domain.TWhgenleg;
|
|
|
+import com.ruoyi.reportManagement.domain.vo.WhgenlegVO;
|
|
|
import com.ruoyi.reportManagement.mapper.TWhgenlegMapper;
|
|
|
import com.ruoyi.shipping.domain.*;
|
|
|
import com.ruoyi.shipping.excel.DeriveInventoryExcel;
|
|
@@ -41,15 +42,23 @@ import com.ruoyi.shipping.excel.TWarehousebillsCntritemsExcel;
|
|
|
import com.ruoyi.shipping.mapper.*;
|
|
|
import com.ruoyi.system.domain.SysCheckCode;
|
|
|
import com.ruoyi.system.domain.SysConfig;
|
|
|
-import com.ruoyi.system.mapper.*;
|
|
|
+import com.ruoyi.system.mapper.SysConfigMapper;
|
|
|
+import com.ruoyi.system.mapper.SysDeptMapper;
|
|
|
+import com.ruoyi.system.mapper.SysDictDataMapper;
|
|
|
+import com.ruoyi.system.mapper.SysUserMapper;
|
|
|
import com.ruoyi.system.service.ISysConfigService;
|
|
|
import com.ruoyi.system.service.impl.SysConfigServiceImpl;
|
|
|
+import com.ruoyi.warehouseBusiness.component.WarehouseBillsfilterService;
|
|
|
import com.ruoyi.warehouseBusiness.domain.*;
|
|
|
import com.ruoyi.warehouseBusiness.domain.dto.CalculateStorageFeesDTO;
|
|
|
+import com.ruoyi.warehouseBusiness.domain.dto.WarehousebillsDTO;
|
|
|
import com.ruoyi.warehouseBusiness.domain.enums.FeesTypeEnum;
|
|
|
import com.ruoyi.warehouseBusiness.domain.enums.WarehouseActIdEnum;
|
|
|
import com.ruoyi.warehouseBusiness.domain.enums.WarehouseTypeEnum;
|
|
|
-import com.ruoyi.warehouseBusiness.domain.vo.*;
|
|
|
+import com.ruoyi.warehouseBusiness.domain.vo.AppWarehouseInfoVO;
|
|
|
+import com.ruoyi.warehouseBusiness.domain.vo.CalculateStorageFeesInfoVO;
|
|
|
+import com.ruoyi.warehouseBusiness.domain.vo.StorageFeeCalculationResultVO;
|
|
|
+import com.ruoyi.warehouseBusiness.domain.vo.WarehouseBillsVO;
|
|
|
import com.ruoyi.warehouseBusiness.excel.*;
|
|
|
import com.ruoyi.warehouseBusiness.mapper.*;
|
|
|
import com.ruoyi.warehouseBusiness.service.ITWarehouseBillsService;
|
|
@@ -111,9 +120,6 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
private SysDeptMapper sysDeptMapper;
|
|
|
|
|
|
@Autowired
|
|
|
- private SysRoleMapper sysRoleMapper;
|
|
|
-
|
|
|
- @Autowired
|
|
|
private BillnoDelMapper billnoDelMapper;
|
|
|
|
|
|
@Autowired
|
|
@@ -174,7 +180,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
private TWarehouseAgreementServiceImpl tWarehouseAgreementService;
|
|
|
|
|
|
@Autowired
|
|
|
- private TWarehouseAgreementitemsMapper tWarehouseAgreementitemsMapper;
|
|
|
+ private WarehouseBillsfilterService warehouseBillsfilterService;
|
|
|
|
|
|
@Autowired
|
|
|
private TWarehousebillsCntritemsMapper tWarehousebillsCntritemsMapper;
|
|
@@ -735,7 +741,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
wbDr.setfChargedate(warehouseBills.getfChargedate());
|
|
|
wbDr.setfBillingDeadline(warehouseBills.getfChargedate());
|
|
|
wbDr.setCreateBy(loginUser.getUser().getUserName());
|
|
|
- if (warehouseBills.getfBsdate() != null && !warehouseBills.getfBsdate().equals("")) {
|
|
|
+ if (warehouseBills.getfBsdate() != null && !"".equals(warehouseBills.getfBsdate())) {
|
|
|
wbDr.setfBsdate(warehouseBills.getfBsdate());
|
|
|
}
|
|
|
tWarehousebillsfeesMapper.insertTWarehousebillsfees(wbDr);
|
|
@@ -830,7 +836,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
warehousebillsCntr.setfPid(warehouseBills.getfId());
|
|
|
warehousebillsCntr.setCreateTime(DateUtils.getNowDate());
|
|
|
warehousebillsCntr.setCreateBy(SecurityUtils.getUsername());
|
|
|
- int cntr = tWarehousebillsCntrMapper.insertTWarehousebillsCntr(warehousebillsCntr);
|
|
|
+ tWarehousebillsCntrMapper.insertTWarehousebillsCntr(warehousebillsCntr);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -2023,7 +2029,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
if (tCntrno == null) {
|
|
|
tCnTrNoList.add(cell.getStringCellValue());
|
|
|
} else {
|
|
|
- if (tCntrno.getfTypeid() != null && tCntrno.getfTypeid() != tWarehousebillsCntr.getfCntrid()) {
|
|
|
+ if (tCntrno.getfTypeid() != null && !Objects.equals(tCntrno.getfTypeid(), tWarehousebillsCntr.getfCntrid())) {
|
|
|
List.add(cell.getStringCellValue());
|
|
|
}
|
|
|
}
|
|
@@ -3290,12 +3296,9 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
}
|
|
|
if (!businessStatus) {
|
|
|
// 查询库容量 是否可入库
|
|
|
- int m = calculation(tWarehouseBills.getfWarehouseid(), item.getfGrossweight());
|
|
|
- if (m == 0) {
|
|
|
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
- return AjaxResult.error("更新库存总账失败-->入库毛重大于库容");
|
|
|
+ if (calculation(tWarehouseBills.getfWarehouseid(), item.getfGrossweight()) <= 0) {
|
|
|
+ throw new WarehouseException("更新库存总账失败-->入库毛重大于库容");
|
|
|
}
|
|
|
-
|
|
|
item.setfOriginalbilldate(item.getfBsdate());
|
|
|
item.setfBillingway(tWarehouseBills.getfBillingway());
|
|
|
if ("1".equals(tWarehouseBills.getfChargetype())) {
|
|
@@ -4869,10 +4872,11 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 计算仓储费审核通过
|
|
|
- * @param warehouseId 主表id
|
|
|
- * @param fettle 状态
|
|
|
- * @param date 审核时间
|
|
|
+ * 计算仓储费审核通过
|
|
|
+ *
|
|
|
+ * @param warehouseId 主表id
|
|
|
+ * @param fettle 状态
|
|
|
+ * @param date 审核时间
|
|
|
*/
|
|
|
public void approvedStorageFee(Long warehouseId, Long fettle, Date date) {
|
|
|
// 查出主表数据
|
|
@@ -6572,12 +6576,12 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
//TCntr tCntr = tCntrMapper.selectTCntrById(fId);//查询货物信息对应的箱类型
|
|
|
TCntrno cnTrNo = tCntrnoMapper.selectTCnTrNoByfNo(tWarehousebillsCntritems.getfCntrno());//查询箱号对应的箱信息
|
|
|
TCntr tCntr = tCntrMapper.selectTCntrById(cnTrNo.getfTypeid());//查询箱类型
|
|
|
- if (cnTrNo != null && cnTrNo.getfTypeid() == tWarehousebillsCntritems.getfCntrid()) {
|
|
|
- if (tWarehousebillsCntritems.getfCntrid() != fId) {
|
|
|
+ if (cnTrNo != null && Objects.equals(cnTrNo.getfTypeid(), tWarehousebillsCntritems.getfCntrid())) {
|
|
|
+ if (!Objects.equals(tWarehousebillsCntritems.getfCntrid(), fId)) {
|
|
|
TCntr cntr = tCntrMapper.selectTCntrById(fId);
|
|
|
return AjaxResult.error("箱号" + tWarehousebillsCntritems.getfCntrno() + "跟货物信息中箱类型不一致,箱类型应为:" + cntr.getfNo());
|
|
|
}
|
|
|
- } else if (cnTrNo != null && cnTrNo.getfTypeid() != tWarehousebillsCntritems.getfCntrid()) {
|
|
|
+ } else if (cnTrNo != null && !Objects.equals(cnTrNo.getfTypeid(), tWarehousebillsCntritems.getfCntrid())) {
|
|
|
return AjaxResult.error("箱号" + tWarehousebillsCntritems.getfCntrno() + "跟基础信息中箱类型不一致,箱类型应为:" + tCntr.getfNo());
|
|
|
}
|
|
|
return AjaxResult.success();
|
|
@@ -7126,36 +7130,229 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
/**
|
|
|
* 货转根据提单号查询可用客户、仓库信息
|
|
|
*
|
|
|
- * @param fMblno 提单号
|
|
|
+ * @param warehousebillsDTO 查询条件
|
|
|
* @return
|
|
|
*/
|
|
|
@Override
|
|
|
- public AjaxResult corpOrWarehouseByMblno(String fMblno) {
|
|
|
+ public AjaxResult corpOrWarehouseByMblno(WarehousebillsDTO warehousebillsDTO) {
|
|
|
+ String fMblno = warehousebillsDTO.getfMblno();
|
|
|
WarehouseBillsVO billsVO = new WarehouseBillsVO();
|
|
|
- // 查询符合条件的库存总帐
|
|
|
- TWhgenleg tWhgenleg = new TWhgenleg();
|
|
|
- tWhgenleg.setfMblno(fMblno);
|
|
|
- List<TWhgenleg> tWhgenlegs = tWhgenlegMapper.selectTWhgenlegList(tWhgenleg);
|
|
|
- if (CollectionUtils.isNotEmpty(tWhgenlegs)) {
|
|
|
- // 查询仓库信息
|
|
|
- List<Long> warehouseIds = tWhgenlegs.stream().filter(leg -> Objects.nonNull(leg.getfWarehouseid())).map(TWhgenleg::getfWarehouseid)
|
|
|
- .distinct().collect(toList());
|
|
|
- if (CollectionUtils.isNotEmpty(warehouseIds)) {
|
|
|
- List<TWarehouse> warehouseList = tWarehouseMapper.selectByIds(warehouseIds);
|
|
|
- billsVO.setWarehouseList(warehouseList);
|
|
|
- }
|
|
|
- // 查询客户
|
|
|
- List<Long> corpIds = tWhgenlegs.stream().filter(leg -> Objects.nonNull(leg.getfCorpid())).map(TWhgenleg::getfCorpid)
|
|
|
- .distinct().collect(toList());
|
|
|
- if (CollectionUtils.isNotEmpty(corpIds)) {
|
|
|
- List<TCorps> corpsList = tCorpsMapper.selectByIds(corpIds);
|
|
|
- billsVO.setCorpsList(corpsList);
|
|
|
+ // 查询客户
|
|
|
+ if (WarehouseTypeEnum.BY_MBLNO.getType().equals(warehousebillsDTO.getType())) {
|
|
|
+ // 查询符合条件的库存总帐
|
|
|
+ TWhgenleg tWhgenleg = new TWhgenleg();
|
|
|
+ tWhgenleg.setfMblno(fMblno);
|
|
|
+ List<TWhgenleg> tWhgenlegs = tWhgenlegMapper.selectTWhgenlegList(tWhgenleg);
|
|
|
+ if (CollectionUtils.isNotEmpty(tWhgenlegs)) {
|
|
|
+ // 查询客户
|
|
|
+ List<Long> corpIds = tWhgenlegs.stream().filter(leg -> Objects.nonNull(leg.getfCorpid())).map(TWhgenleg::getfCorpid)
|
|
|
+ .distinct().collect(toList());
|
|
|
+ if (CollectionUtils.isNotEmpty(corpIds)) {
|
|
|
+ List<TCorps> corpsList = tCorpsMapper.selectByIds(corpIds);
|
|
|
+ billsVO.setCorpsList(corpsList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return AjaxResult.success(billsVO);
|
|
|
+ } else if (WarehouseTypeEnum.BY_CPRP.getType().equals(warehousebillsDTO.getType())) {
|
|
|
+ if (StringUtils.isNull(warehousebillsDTO.getCorpId())) {
|
|
|
+ throw new WarehouseException("未找到客户查询条件");
|
|
|
+ }
|
|
|
+ // 查询符合条件的库存总帐
|
|
|
+ TWhgenleg tWhgenleg = new TWhgenleg();
|
|
|
+ tWhgenleg.setfMblno(fMblno);
|
|
|
+ tWhgenleg.setfCorpid(warehousebillsDTO.getCorpId());
|
|
|
+ List<TWhgenleg> tWhgenlegs = tWhgenlegMapper.selectTWhgenlegList(tWhgenleg);
|
|
|
+ if (CollectionUtils.isNotEmpty(tWhgenlegs)) {
|
|
|
+ // 查询仓库信息
|
|
|
+ List<Long> warehouseIds = tWhgenlegs.stream().filter(leg -> Objects.nonNull(leg.getfWarehouseid()))
|
|
|
+ .map(TWhgenleg::getfWarehouseid).distinct().collect(toList());
|
|
|
+ if (CollectionUtils.isNotEmpty(warehouseIds)) {
|
|
|
+ List<TWarehouse> warehouseList = tWarehouseMapper.selectByIds(warehouseIds);
|
|
|
+ billsVO.setWarehouseList(warehouseList);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return AjaxResult.success(billsVO);
|
|
|
+ } else if (WarehouseTypeEnum.BY_WAREHOUSE.getType().equals(warehousebillsDTO.getType())) {
|
|
|
+ if (StringUtils.isNull(warehousebillsDTO.getCorpId()) ||
|
|
|
+ StringUtils.isNull(warehousebillsDTO.getWarehouseId())) {
|
|
|
+ throw new WarehouseException("未找到客户、仓库查询条件");
|
|
|
+ }
|
|
|
+ // 查询符合条件的库存总帐
|
|
|
+ TWhgenleg tWhgenleg = new TWhgenleg();
|
|
|
+ tWhgenleg.setfMblno(fMblno);
|
|
|
+ tWhgenleg.setfCorpid(warehousebillsDTO.getCorpId());
|
|
|
+ tWhgenleg.setfWarehouseid(warehousebillsDTO.getWarehouseId());
|
|
|
+ List<TWhgenleg> tWhgenlegs = tWhgenlegMapper.selectTWhgenlegList(tWhgenleg);
|
|
|
+ if (CollectionUtils.isNotEmpty(tWhgenlegs)) {
|
|
|
+ List<WhgenlegVO> voList = new ArrayList<>();
|
|
|
+ tWhgenlegs.forEach(vo -> {
|
|
|
+ WhgenlegVO whgenlegVO = new WhgenlegVO();
|
|
|
+ whgenlegVO.setfMarks(vo.getfMarks());
|
|
|
+ whgenlegVO.setfGoodsid(vo.getfGoodsid());
|
|
|
+ whgenlegVO.setfBusinessType(vo.getfBusinessType());
|
|
|
+ voList.add(whgenlegVO);
|
|
|
+ });
|
|
|
+ billsVO.setWhgenlegVOList(voList);
|
|
|
+ return AjaxResult.success(billsVO);
|
|
|
}
|
|
|
}
|
|
|
return AjaxResult.success(billsVO);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 快速出库
|
|
|
+ *
|
|
|
+ * @param warehousebillsDTO 出库信息
|
|
|
+ * @param loginUser 登陆人
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
+ public AjaxResult quickOperation(WarehousebillsDTO warehousebillsDTO, LoginUser loginUser) {
|
|
|
+ if (CollectionUtils.isEmpty(warehousebillsDTO.getWarehousebillsitemsList())) {
|
|
|
+ throw new WarehouseException("未找到仓储的明细数据");
|
|
|
+ }
|
|
|
+ // 校验必填项
|
|
|
+ warehouseBillsfilterService.filter(warehousebillsDTO);
|
|
|
+ // 生成编号
|
|
|
+ String billNo = billnoSerialServiceImpl.getBillNo(warehousebillsDTO.getfBilltype(), warehousebillsDTO.getfBsdate());
|
|
|
+ warehousebillsDTO.setfBillno(billNo);
|
|
|
+ warehousebillsDTO.setCreateTime(new Date());
|
|
|
+ warehousebillsDTO.setCreateBy(loginUser.getUsername());
|
|
|
+ warehousebillsDTO.setfBsdeptid(loginUser.getUser().getDeptId());
|
|
|
+ warehousebillsDTO.setfBillstatus(Long.parseLong(WarehouseTypeEnum.SAVE.getType()));
|
|
|
+ warehousebillsDTO.setfItemstatus(Long.parseLong(WarehouseTypeEnum.DETAILED_STATUS_PROCESSED.getType()));
|
|
|
+ tWarehouseBillsMapper.insertTWarehousebills(warehousebillsDTO);
|
|
|
+ // 遍历进行入库、出库确认
|
|
|
+ List<TWarehousebillsitems> itemList = warehousebillsDTO.getWarehousebillsitemsList();
|
|
|
+ int line = 1;
|
|
|
+ for (TWarehousebillsitems li : itemList) {
|
|
|
+ // 如果业务时间超出当前时间则不允许
|
|
|
+ if (li.getfBsdate().after(new Date())) {
|
|
|
+ throw new WarehouseException("业务日期不得超出当前日期");
|
|
|
+ }
|
|
|
+ li.setfPid(warehousebillsDTO.getfId());
|
|
|
+ li.setfBillstatus(40L);
|
|
|
+ li.setfBillno(warehousebillsDTO.getfBillno());
|
|
|
+ li.setfBilltype(warehousebillsDTO.getfBilltype());
|
|
|
+ if (warehousebillsDTO.getfBilltype().equals(WarehouseTypeEnum.SJRK.getType())) {
|
|
|
+ quickStorage(warehousebillsDTO, li, loginUser, line);
|
|
|
+ } else if (warehousebillsDTO.getfBilltype().equals(WarehouseTypeEnum.SJCK.getType())) {
|
|
|
+ quickDelivery(warehousebillsDTO, li, loginUser, line);
|
|
|
+ line++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return AjaxResult.success();
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 快速入库
|
|
|
+ *
|
|
|
+ * @param warehousebillsDTO 主表信息
|
|
|
+ * @param item 明细信息
|
|
|
+ * @param loginUser 用户信息
|
|
|
+ * @param line 序号
|
|
|
+ */
|
|
|
+ private void quickStorage(WarehousebillsDTO warehousebillsDTO, TWarehousebillsitems item, LoginUser loginUser, int line) {
|
|
|
+ // 查询库容量 是否可入库
|
|
|
+ if (calculation(warehousebillsDTO.getfWarehouseid(), item.getfGrossweight()) <= 0) {
|
|
|
+ throw new WarehouseException("仓储明细第" + line + "行入库毛重大于库容");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(warehousebillsDTO.getfCustomno())) {
|
|
|
+ item.setfCustomno(warehousebillsDTO.getfCustomno());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotEmpty(warehousebillsDTO.getRemark())) {
|
|
|
+ item.setRemark(warehousebillsDTO.getRemark());
|
|
|
+ }
|
|
|
+ item.setfOriginalbilldate(item.getfBsdate());
|
|
|
+ item.setfBillingway(warehousebillsDTO.getfBillingway());
|
|
|
+ if ("1".equals(warehousebillsDTO.getfChargetype())) {
|
|
|
+ item.setfChargedate(item.getfBsdate());
|
|
|
+ } else {
|
|
|
+ item.setfChargedate(new Date());
|
|
|
+ }
|
|
|
+ // 校验商品是否区分箱号
|
|
|
+ TGoods goods = tGoodsMapper.selectTGoodsById(item.getfGoodsid());
|
|
|
+ if ("1".equals(goods.getIfCntrno()) && StringUtils.isNull(item.getfCntrno())) {
|
|
|
+ throw new WarehouseException("仓库明细第" + line + "行未找到箱号");
|
|
|
+ }
|
|
|
+ TWhgenleg tWhgenle = queryTWhgenleg(warehousebillsDTO, item, goods.getIfCntrno());
|
|
|
+ if (Objects.nonNull(tWhgenle)) {
|
|
|
+ updateTWhgenlegData(item, tWhgenle.getfId(), warehousebillsDTO.getfBilltype());
|
|
|
+ } else {
|
|
|
+ instalTWhgenleg(warehousebillsDTO, item, loginUser.getUser());
|
|
|
+ }
|
|
|
+ item.setfIsInventory(Long.parseLong(WarehouseTypeEnum.INVENTORY.getType()));
|
|
|
+ tWarehousebillsitemsMapper.insertTWarehousebillsitems(item);
|
|
|
+ // 添加状态log
|
|
|
+ insertTWarehousebillsLog(item, 40L, loginUser);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 快速出库
|
|
|
+ *
|
|
|
+ * @param warehousebillsDTO 主表信息
|
|
|
+ * @param item 明细信息
|
|
|
+ * @param loginUser 用户信息
|
|
|
+ * @param line 序号
|
|
|
+ */
|
|
|
+ private void quickDelivery(WarehousebillsDTO warehousebillsDTO, TWarehousebillsitems item, LoginUser loginUser, int line) {
|
|
|
+ // 校验商品是否区分箱号
|
|
|
+ TGoods goods = tGoodsMapper.selectTGoodsById(item.getfGoodsid());
|
|
|
+ if ("1".equals(goods.getIfCntrno()) && StringUtils.isNull(item.getfCntrno())) {
|
|
|
+ throw new WarehouseException("仓库明细未找到箱号");
|
|
|
+ }
|
|
|
+ // 查询总账是否存在
|
|
|
+ TWhgenleg tWhgenle = queryTWhgenleg(warehousebillsDTO, item, goods.getIfCntrno());
|
|
|
+ if (Objects.nonNull(tWhgenle) && item.getfBsdate().before(warehousebillsDTO.getfChargedate())) {
|
|
|
+ throw new WarehouseException("出库明细第" + line + "行业务日期不得超出库存总帐日期");
|
|
|
+ }
|
|
|
+ if (Objects.isNull(tWhgenle)) {
|
|
|
+ throw new WarehouseException("出库库存总帐第" + line + "行不存在");
|
|
|
+ }
|
|
|
+ //校验计费日期是等于库存总帐计费日,如果不相等则报错
|
|
|
+ checkWhgenleg(item, tWhgenle);
|
|
|
+ // 库存 < 出库件数
|
|
|
+ if (tWhgenle.getfQtyblc() < item.getfQty()) {
|
|
|
+ throw new WarehouseException("库存明细第" + line + "行库存不足");
|
|
|
+ }
|
|
|
+ // 更新库存总账
|
|
|
+ updateTWhgenlegData(item, tWhgenle.getfId(), warehousebillsDTO.getfBilltype());
|
|
|
+ DateUtils.getDateDay(warehousebillsDTO.getfBsdate(), item.getfChargedate());
|
|
|
+ item.setCreateTime(new Date());
|
|
|
+ item.setCreateBy(loginUser.getUsername());
|
|
|
+ tWarehousebillsitemsMapper.insertTWarehousebillsitems(item);
|
|
|
+ // 添加状态log
|
|
|
+ insertTWarehousebillsLog(item, 40L, loginUser);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 校验提单号是否在同一天出现第二次
|
|
|
+ *
|
|
|
+ * @param warehousebillsDTO 查询条件
|
|
|
+ */
|
|
|
+ @Override
|
|
|
+ public void checkMblNoRepeat(WarehousebillsDTO warehousebillsDTO) {
|
|
|
+ if (CollectionUtils.isNotEmpty(warehousebillsDTO.getWarehousebillsitemsList())) {
|
|
|
+ List<TWarehousebillsitems> items = warehousebillsDTO.getWarehousebillsitemsList();
|
|
|
+ int line = 1;
|
|
|
+ for (TWarehousebillsitems li : items) {
|
|
|
+ if (StringUtils.isNotEmpty(li.getfCntrno())) {
|
|
|
+ warehousebillsDTO.setfCntrno(li.getfCntrno());
|
|
|
+ }
|
|
|
+ int num = tWarehouseBillsMapper.selectByMblnoOrCntrnoCount(warehousebillsDTO);
|
|
|
+ if (num > 0 && StringUtils.isNotEmpty(li.getfCntrno())) {
|
|
|
+ throw new WarehouseException("该提单号与第" + line + "行明细箱号存在重复录入");
|
|
|
+ }
|
|
|
+ if (num > 0 && StringUtils.isEmpty(li.getfCntrno())) {
|
|
|
+ throw new WarehouseException("该提单号存在重复录入");
|
|
|
+ }
|
|
|
+ line++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 如果是入库
|
|
|
*
|
|
|
* @param infoVO
|
|
@@ -7170,7 +7367,7 @@ public class TWarehouseBillsServiceImpl implements ITWarehouseBillsService {
|
|
|
// 计费单位
|
|
|
if (StringUtils.isNotNull(infoVO.getfFeetunit())) {
|
|
|
String type = "data_unitfees";
|
|
|
- String dictLabel = DictUtils.getDictLabel(type, infoVO.getfFeetunit().toString());
|
|
|
+ String dictLabel = DictUtils.getDictLabel(type, infoVO.getfFeetunit());
|
|
|
if (StringUtils.isNotEmpty(dictLabel)) {
|
|
|
infoVO.setFeetunitName(dictLabel);
|
|
|
}
|