|
|
@ -6,14 +6,18 @@ import com.win.framework.common.pojo.CustomConditions; |
|
|
|
import com.win.framework.common.pojo.PageResult; |
|
|
|
import com.win.framework.mybatis.core.util.MyBatisUtils; |
|
|
|
import com.win.framework.mybatis.core.util.QueryWrapperUtils; |
|
|
|
import com.win.module.system.api.dict.DictDataApi; |
|
|
|
import com.win.module.system.api.dict.dto.DictDataRespDTO; |
|
|
|
import com.win.module.system.api.user.AdminUserApi; |
|
|
|
import com.win.module.wms.controller.balance.vo.BalanceExportReqVO; |
|
|
|
import com.win.module.wms.controller.balance.vo.BalancePageReqVO; |
|
|
|
import com.win.module.wms.controller.balance.vo.BalanceRespVO; |
|
|
|
import com.win.module.wms.controller.balance.vo.BalanceUpdateReqVO; |
|
|
|
import com.win.module.wms.controller.packageMassage.vo.PackageUpdateReqVO; |
|
|
|
import com.win.module.wms.controller.transaction.vo.TransactionCreateReqVO; |
|
|
|
import com.win.module.wms.convert.balance.BalanceConvert; |
|
|
|
import com.win.module.wms.dal.dataobject.balance.BalanceDO; |
|
|
|
import com.win.module.wms.dal.dataobject.packageMassage.PackageDO; |
|
|
|
import com.win.module.wms.dal.dataobject.transactiontype.TransactiontypeDO; |
|
|
|
import com.win.module.wms.dal.mysql.balance.BalanceMapper; |
|
|
|
import com.win.module.wms.dal.mysql.packageMassage.PackageMapper; |
|
|
@ -54,6 +58,8 @@ public class BalanceServiceImpl implements BalanceService { |
|
|
|
private JobUtils jobUtils; |
|
|
|
@Resource |
|
|
|
private BalanceMapper balanceMapper; |
|
|
|
@Resource |
|
|
|
private DictDataApi dictDataApi; |
|
|
|
|
|
|
|
@Override |
|
|
|
public PageResult<BalanceDO> getBalancePage(BalancePageReqVO pageReqVO) { |
|
|
@ -109,7 +115,7 @@ public class BalanceServiceImpl implements BalanceService { |
|
|
|
public List<BalanceDO> selectBatch(String itemCode, String batch, List<String> inventoryStatus, String locationCode) { |
|
|
|
QueryWrapper<BalanceDO> queryWrapper = new QueryWrapper<>(); |
|
|
|
queryWrapper.eq("item_code", itemCode); |
|
|
|
if (batch == null || batch.equals("")) { |
|
|
|
if (batch == null || batch.isEmpty()) { |
|
|
|
queryWrapper.eq("batch", ""); |
|
|
|
} |
|
|
|
queryWrapper.in("inventory_status", inventoryStatus); |
|
|
@ -238,7 +244,7 @@ public class BalanceServiceImpl implements BalanceService { |
|
|
|
transactionCreateReqVOList.add(transactionCreateReqVOOut); |
|
|
|
// 更新包装信息
|
|
|
|
PackageUpdateReqVO packageUpdateReqVO = new PackageUpdateReqVO(); |
|
|
|
QueryWrapper queryWrapper = new QueryWrapper<>(); |
|
|
|
QueryWrapper<PackageDO> queryWrapper = new QueryWrapper<>(); |
|
|
|
queryWrapper.eq("number",balanceDO.getPackingNumber()); |
|
|
|
packageUpdateReqVO.setId(packageMapper.selectOne(queryWrapper).getId()); |
|
|
|
packageUpdateReqVO.setNumber(balanceDO.getPackingNumber()); |
|
|
@ -268,4 +274,23 @@ public class BalanceServiceImpl implements BalanceService { |
|
|
|
mpPage.setRecords(list); |
|
|
|
return new PageResult<>(mpPage.getRecords(), mpPage.getTotal()); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<BalanceRespVO> getStagnantBalanceList() { |
|
|
|
DictDataRespDTO dictDataRespDTO = dictDataApi.selectDictTypeAndLabel("stagnant_time", "默认时间(天)"); |
|
|
|
QueryWrapper<BalanceDO> queryWrapper = new QueryWrapper<>(); |
|
|
|
queryWrapper.apply(" DATEDIFF(NOW(), arrive_date) > {0}", dictDataRespDTO.getValue()); |
|
|
|
queryWrapper.last("LIMIT 10"); |
|
|
|
List<BalanceDO> balanceDOList = balanceMapper.selectList(queryWrapper); |
|
|
|
return BalanceConvert.INSTANCE.convertList(balanceDOList); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public List<BalanceRespVO> getOverdueBalanceList() { |
|
|
|
QueryWrapper<BalanceDO> queryWrapper = new QueryWrapper<>(); |
|
|
|
queryWrapper.apply("expire_date>NOW()"); |
|
|
|
queryWrapper.last("LIMIT 10"); |
|
|
|
List<BalanceDO> balanceDOList = balanceMapper.selectList(queryWrapper); |
|
|
|
return BalanceConvert.INSTANCE.convertList(balanceDOList); |
|
|
|
} |
|
|
|
} |
|
|
|