| | |
| | | return ResponseValue.error("采购的价型号未找到"); |
| | | } |
| | | // 查询型号库存 |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(warehouseId, baseGoodsModelsId, (short) 1, null); |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(0, warehouseId, baseGoodsModelsId, (short) 1, null); |
| | | LWhProcureModel model = new LWhProcureModel(); |
| | | model.setId(NumberGenerator.getLongSequenceNumber()); |
| | | model.setFromProcureGoodsId(fromProcureGoodsId); |
| | |
| | | /** |
| | | * 4部门分发 |
| | | */ |
| | | BUMENFENFA((short) 4); |
| | | BUMENFENFA((short) 4), |
| | | /** |
| | | * 报废 |
| | | */ |
| | | BAOFEI((short) 5); |
| | | |
| | | private short value; |
| | | |
| | |
| | | public class LockManage { |
| | | private static final ConcurrentHashMap<String, Object> lockMap = new ConcurrentHashMap<>(); |
| | | |
| | | public static Object acquireLock(Long warehouseId, Long goodsModelsId) { |
| | | String key = warehouseId + "-" + goodsModelsId; |
| | | public static Object acquireLock(int warehouseType, Long warehouseId, Long goodsModelsId) { |
| | | String key = warehouseType + "-" + warehouseId + "-" + goodsModelsId; |
| | | return lockMap.computeIfAbsent(key, k -> new Object()); |
| | | } |
| | | } |
| | |
| | | } |
| | | // 查询仓库信息 |
| | | Long warehouseFlowId = warehouseFlow.getId(); |
| | | Integer warehouseType = warehouseFlow.getWarehouseType(); |
| | | Long warehouseId = warehouseFlow.getWarehouseId(); |
| | | Long dealTime = warehouseFlow.getDealTime(); |
| | | BaseWarehouse baseWarehouses = lWarehouseFlowService.get(new BaseWarehouse(warehouseId)); |
| | |
| | | whGoodsRecord.setThisType(1); |
| | | |
| | | //通过LockManage获得锁 |
| | | Object warehouseModelLockObj = LockManage.acquireLock(warehouseId, baseGoodsModelsId); |
| | | Object warehouseModelLockObj = LockManage.acquireLock(warehouseType, warehouseId, baseGoodsModelsId); |
| | | synchronized (warehouseModelLockObj) { |
| | | // 获得锁后查询该型号的期初数量 |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(warehouseId, baseGoodsModelsId, (short) 1, null); |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(warehouseType,warehouseId, baseGoodsModelsId, (short) 1, null); |
| | | whGoodsRecord.setInitialCount(goodsModelNum); |
| | | whGoodsRecord.setThisCount(modelCount); |
| | | whGoodsRecord.setEndCount(goodsModelNum + modelCount); |
| | |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.NumberGenerator; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; |
| | | import org.springframework.jdbc.core.namedparam.SqlParameterSource; |
| | | import org.springframework.jdbc.core.simple.SimpleJdbcCall; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | |
| | | @Slf4j |
| | | @Service |
| | | public class LWhFormOutputCoreService { |
| | | private final JdbcTemplate jdbcTemplate; |
| | | private SimpleJdbcCall simpleJdbcCall; |
| | | |
| | | private BaseGoodsTemplateServiceImpl baseGoodsTemplateService; |
| | | private LWhGoodsService lWhGoodsService; |
| | | private CodeGeneratorService codeGeneratorService; |
| | |
| | | private LWhFormTransferService lWhFormTransferService; |
| | | private LWhFormOutputService lWhFormOutputService; |
| | | private LWarehouseFlowService lWarehouseFlowService; |
| | | private LWhGoodsRecordDetailsService lWhGoodsRecordDetailsService; |
| | | private LWhGoodsRecordService lWhGoodsRecordService; |
| | | |
| | | @Autowired |
| | | public LWhFormOutputCoreService(BaseGoodsTemplateServiceImpl baseGoodsTemplateService, |
| | |
| | | LWhFormTransferService lWhFormTransferService, |
| | | LWhFormOutputService lWhFormOutputService, |
| | | LWarehouseFlowService lWarehouseFlowService, |
| | | JdbcTemplate jdbcTemplate |
| | | ) { |
| | | LWhGoodsRecordDetailsService lWhGoodsRecordDetailsService, |
| | | LWhGoodsRecordService lWhGoodsRecordService) { |
| | | this.baseGoodsTemplateService = baseGoodsTemplateService; |
| | | this.lWhGoodsService = lWhGoodsService; |
| | | this.codeGeneratorService = codeGeneratorService; |
| | |
| | | this.lWhFormTransferService = lWhFormTransferService; |
| | | this.lWhFormOutputService = lWhFormOutputService; |
| | | this.lWarehouseFlowService = lWarehouseFlowService; |
| | | this.jdbcTemplate = jdbcTemplate; |
| | | this.simpleJdbcCall = new SimpleJdbcCall(jdbcTemplate).withProcedureName("insert_WH_GOODS_RECORD_DETAILS"); |
| | | this.lWhGoodsRecordDetailsService = lWhGoodsRecordDetailsService; |
| | | this.lWhGoodsRecordService = lWhGoodsRecordService; |
| | | } |
| | | |
| | | |
| | |
| | | return null; |
| | | } |
| | | // 要出物品的仓库id |
| | | Integer outWarehouseType = lWhFormOutput.getOutWarehouseType(); |
| | | Long outWarehouseId = lWhFormOutput.getWarehouseId(); |
| | | String warehouseName = lWhFormOutput.getWarehouseName(); |
| | | |
| | |
| | | whGoodsRecord.setThisCount(counts); |
| | | |
| | | //通过LockManage获得锁 |
| | | Object warehouseModelLockObj = LockManage.acquireLock(outWarehouseId, baseGoodsModelsId); |
| | | Object warehouseModelLockObj = LockManage.acquireLock(outWarehouseType, outWarehouseId, baseGoodsModelsId); |
| | | synchronized (warehouseModelLockObj) { |
| | | // 获得锁后查询该型号的期初数量 |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(outWarehouseId, baseGoodsModelsId, queryModelStatus, buyType); |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(outWarehouseType, outWarehouseId, baseGoodsModelsId, queryModelStatus, buyType); |
| | | if (goodsModelNum < counts) { |
| | | log.error("出库失败!型号{} 的数量不足,需要调拨{}个,仓库中现存{}个", baseGoodsModelsId, counts, goodsModelNum); |
| | | // 手动回滚 |
| | |
| | | whGoodsRecord.setEndCount(goodsModelNum - counts); |
| | | |
| | | //出库时候,按 先入库的先出库,同时入库的,按价格高的先出库 |
| | | List<Long> outGoodsId = lWhGoodsService.queryOutGoodsId(outWarehouseId, baseGoodsModelsId, queryModelStatus, buyType, goodsModelNum); |
| | | lWhGoodsService.modGoodsTransfering(outGoodsId, inWarehouseId, inWarehouseName, modGoodsTransferingStatus); |
| | | List<Long> outGoodsId = lWhGoodsService.queryOutGoodsId(outWarehouseType, outWarehouseId, baseGoodsModelsId, queryModelStatus, buyType, goodsModelNum); |
| | | lWhGoodsService.modGoodsTransfering(outGoodsId, outWarehouseType, inWarehouseId, inWarehouseName, modGoodsTransferingStatus); |
| | | // 批量插入 进出库流水明细[L_WH_GOODS_RECORD_DETAILS] |
| | | sameGoodsInsertMore(outGoodsId, whGoodsRecordId, (short) 0); |
| | | lWhGoodsRecordDetailsService.sameGoodsInsertMore(outGoodsId, whGoodsRecordId, (short) 0); |
| | | lWhGoodsRecordService.insert(whGoodsRecord); |
| | | } |
| | | }); |
| | | LWarehouseFlow warehouseFlow = new LWarehouseFlow(); |
| | |
| | | return lWarehouseFlowId; |
| | | } |
| | | |
| | | public void sameGoodsInsertMore(List<Long> outGoodsId, long whGoodsRecordId, short thisType) { |
| | | SqlParameterSource in = new MapSqlParameterSource() |
| | | .addValue("WHGOODSIDList", StringUtils.join(outGoodsId)) |
| | | .addValue("WH_GOODS_RECORD_ID", whGoodsRecordId) |
| | | .addValue("THIS_TYPE", thisType); |
| | | |
| | | Map<String, Object> out = simpleJdbcCall.execute(in); |
| | | System.out.println("Procedure result: " + out); |
| | | } |
| | | } |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.core.param.BaseWarehouseParam1; |
| | | import com.consum.base.pojo.LWhFormOutputParam; |
| | | import com.consum.base.pojo.LWhFormProcureParam; |
| | | import com.consum.base.util.IdUtil; |
| | | import com.consum.model.po.*; |
| | | import com.iplatform.model.po.S_user_core; |
| | |
| | | int flag5 = 0; |
| | | for (LWhGoodsRecord record : recordList) { |
| | | //根据物品型号查询物品库存 |
| | | int goodsNum = this.lWhGoodsService.queryGoodsModelNum(warehouseId, record.getBaseGoodsModelsId(), (short) 1, null); |
| | | int goodsNum = this.lWhGoodsService.queryGoodsModelNum(0,warehouseId, record.getBaseGoodsModelsId(), (short) 1, null); |
| | | |
| | | //5.新增L_WH_PROCURE_MODEL记录 |
| | | LWhProcureModel lWhProcureModel = new LWhProcureModel(); |
New file |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.base.core.WhBusinessEnum; |
| | | import com.consum.base.core.util.LockManage; |
| | | import com.consum.model.po.*; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.NumberGenerator; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @ClassName LWhFormScrappedCoreService |
| | | * @Author cy |
| | | * @Date 2023/10/30 |
| | | * @Description |
| | | * @Version 1.0 |
| | | **/ |
| | | @Service |
| | | @Slf4j |
| | | public class LWhFormScrappedCoreService { |
| | | private LWhFormScrappedService lWhFormScrappedService; |
| | | private LWhFormScrappedGoodsService lWhFormScrappedGoodsService; |
| | | private BaseGoodsTemplateServiceImpl baseGoodsTemplateService; |
| | | private LWhGoodsService lWhGoodsService; |
| | | private LWhGoodsRecordDetailsService lWhGoodsRecordDetailsService; |
| | | private LWhGoodsRecordService lWhGoodsRecordService; |
| | | private LWarehouseFlowService lWarehouseFlowService; |
| | | |
| | | @Autowired |
| | | public LWhFormScrappedCoreService(LWhFormScrappedService lWhFormScrappedService, |
| | | LWhFormScrappedGoodsService lWhFormScrappedGoodsService, |
| | | BaseGoodsTemplateServiceImpl baseGoodsTemplateService, |
| | | LWhGoodsService lWhGoodsService, |
| | | LWhGoodsRecordDetailsService lWhGoodsRecordDetailsService, |
| | | LWhGoodsRecordService lWhGoodsRecordService, |
| | | LWarehouseFlowService lWarehouseFlowService) { |
| | | this.lWhFormScrappedService = lWhFormScrappedService; |
| | | this.lWhFormScrappedGoodsService = lWhFormScrappedGoodsService; |
| | | this.baseGoodsTemplateService = baseGoodsTemplateService; |
| | | this.lWhGoodsService = lWhGoodsService; |
| | | this.lWhGoodsRecordDetailsService = lWhGoodsRecordDetailsService; |
| | | this.lWhGoodsRecordService = lWhGoodsRecordService; |
| | | this.lWarehouseFlowService = lWarehouseFlowService; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据 报废单【L_WH_FORM_SCRAPPED】 报废物品 |
| | | * |
| | | * @param formScrappedId 报废单Id |
| | | * @return 流水记录总表ID |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Long outFormByTransId(Long formScrappedId, S_user_core currentUser, Long dealTime) { |
| | | if (formScrappedId == null) { |
| | | return null; |
| | | } |
| | | LWhFormScrapped lWhFormScrapped = new LWhFormScrapped(formScrappedId); |
| | | lWhFormScrapped = lWhFormScrappedService.get(lWhFormScrapped); |
| | | if (lWhFormScrapped != null && lWhFormScrapped.getStates() != 0) { |
| | | log.error("报废失败!请检查报废单状态"); |
| | | return null; |
| | | } |
| | | |
| | | Long userId = currentUser.getId(); |
| | | String nickName = currentUser.getNick_name(); |
| | | |
| | | Integer warehouseType = lWhFormScrapped.getWarehouseType(); |
| | | Long warehouseId = lWhFormScrapped.getWarehouseId(); |
| | | String warehouseName = lWhFormScrapped.getWarehouseName(); |
| | | // 流水记录总表ID |
| | | long lWarehouseFlowId = NumberGenerator.getLongSequenceNumberNano(); |
| | | |
| | | //要报废的物品 |
| | | LWhFormScrappedGoods goods = new LWhFormScrappedGoods(); |
| | | goods.setFormScrappedId(formScrappedId); |
| | | List<LWhFormScrappedGoods> formScrappedGoods = lWhFormScrappedGoodsService.select(goods); |
| | | if (CollectionUtils.isEmpty(formScrappedGoods)) { |
| | | log.error("没有要报废的物品"); |
| | | return null; |
| | | } |
| | | |
| | | // 按型号分组 |
| | | Map<Long, List<LWhFormScrappedGoods>> modelGroup = formScrappedGoods.stream().collect(Collectors.groupingBy(LWhFormScrappedGoods::getBaseGoodsModelsId)); |
| | | for (Map.Entry<Long, List<LWhFormScrappedGoods>> entry : modelGroup.entrySet()) { |
| | | //规格型号编号 |
| | | Long baseGoodsModelsId = entry.getKey(); |
| | | //对每组中要报废的数量求和 |
| | | List<LWhFormScrappedGoods> modelGoodsList = entry.getValue(); |
| | | //查询型号信息 |
| | | Map<String, Object> tempGoodsInfo = baseGoodsTemplateService.queryGoodsInfoByModelId(baseGoodsModelsId); |
| | | //要报废的总数量 |
| | | int modelTotalNum = modelGoodsList.stream().mapToInt(LWhFormScrappedGoods::getCounts).sum(); |
| | | Long tempGoodsId = (Long) tempGoodsInfo.get("goodsid"); |
| | | String goodsName = (String) tempGoodsInfo.get("goodsname"); |
| | | String modelName = (String) tempGoodsInfo.get("modelname"); |
| | | // 插入 各规格物品的进出库记录 L_WH_GOODS_RECORD |
| | | long whGoodsRecordId = NumberGenerator.getLongSequenceNumberNano(); |
| | | LWhGoodsRecord whGoodsRecord = new LWhGoodsRecord(); |
| | | whGoodsRecord.setId(whGoodsRecordId); |
| | | whGoodsRecord.setWarehouseType(warehouseType); |
| | | whGoodsRecord.setWarehouseId(warehouseId); |
| | | whGoodsRecord.setWarehouseFlowId(lWarehouseFlowId); |
| | | whGoodsRecord.setBaseGoodsTemplateId(tempGoodsId); |
| | | whGoodsRecord.setGoodsTemplateName(goodsName); |
| | | whGoodsRecord.setBaseGoodsModelsId(baseGoodsModelsId); |
| | | whGoodsRecord.setBaseGoodsModelsName(modelName); |
| | | whGoodsRecord.setDealTime(dealTime); |
| | | //本次调整类型 1=调增;2=调减 |
| | | whGoodsRecord.setThisType(2); |
| | | whGoodsRecord.setThisCount(modelTotalNum); |
| | | |
| | | //通过LockManage获得锁 |
| | | Object warehouseModelLockObj = LockManage.acquireLock(warehouseType, warehouseId, baseGoodsModelsId); |
| | | synchronized (warehouseModelLockObj) { |
| | | for (LWhFormScrappedGoods formScrappedGood : modelGoodsList) { |
| | | //报废数量 |
| | | Integer counts = formScrappedGood.getCounts(); |
| | | //报废单编号 |
| | | Long transBusinessId = formScrappedGood.getTransBusinessId(); |
| | | |
| | | int goodsModelNum = 0; |
| | | List<Long> srappedGoodsIds = null; |
| | | if (warehouseType == null || warehouseType == 0) { |
| | | srappedGoodsIds = lWhGoodsService.queryScrappedGoodsIds(warehouseType, warehouseId, null, null, baseGoodsModelsId, (short) 1, counts); |
| | | } else { |
| | | //使用人员名称 |
| | | String userName = formScrappedGood.getUserName(); |
| | | // 根据分发单、规格型号编号、使用人员名称,进行报废 |
| | | srappedGoodsIds = lWhGoodsService.queryScrappedGoodsIds(warehouseType, warehouseId, transBusinessId, userName, baseGoodsModelsId, (short) 2, counts); |
| | | } |
| | | if (CollectionUtils.isEmpty(srappedGoodsIds) || srappedGoodsIds.size() < counts) { |
| | | log.error("要报废的物品数量不足!"); |
| | | // 手动回滚 |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | throw new RuntimeException("报废失败!型号数量不足"); |
| | | } |
| | | |
| | | whGoodsRecord.setInitialCount(goodsModelNum); |
| | | whGoodsRecord.setEndCount(goodsModelNum - counts); |
| | | |
| | | // 设置物品为报废状态 |
| | | lWhGoodsService.modGoodsTransfering(srappedGoodsIds, null, null, null, (short) 3); |
| | | // 批量插入 进出库流水明细[L_WH_GOODS_RECORD_DETAILS] |
| | | lWhGoodsRecordDetailsService.sameGoodsInsertMore(srappedGoodsIds, whGoodsRecordId, (short) 2); |
| | | } |
| | | lWhGoodsRecordService.insert(whGoodsRecord); |
| | | } |
| | | |
| | | } |
| | | LWarehouseFlow warehouseFlow = new LWarehouseFlow(); |
| | | warehouseFlow.setId(lWarehouseFlowId); |
| | | warehouseFlow.setWarehouseType(warehouseType); |
| | | warehouseFlow.setWarehouseId(warehouseId); |
| | | warehouseFlow.setWarehouseName(warehouseName); |
| | | warehouseFlow.setThisType(2); |
| | | warehouseFlow.setBusinessType(WhBusinessEnum.BAOFEI.getValue() + 0); |
| | | warehouseFlow.setBusinessFormId(formScrappedId); |
| | | warehouseFlow.setOperatorId(userId); |
| | | warehouseFlow.setOperatorName(nickName); |
| | | warehouseFlow.setDealTime(dealTime); |
| | | // 插入流水总表 |
| | | int flowInsertFlag = lWarehouseFlowService.insert(warehouseFlow); |
| | | if (flowInsertFlag == 0) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return null; |
| | | } |
| | | // 更新报废单 |
| | | lWhFormScrapped = new LWhFormScrapped(formScrappedId); |
| | | lWhFormScrapped = lWhFormScrappedService.get(lWhFormScrapped); |
| | | if (lWhFormScrapped != null && lWhFormScrapped.getStates() != 0) { |
| | | log.error("报废失败!请检查报废单状态"); |
| | | return null; |
| | | } |
| | | lWhFormScrapped.setLWarehouseFlowId(lWarehouseFlowId); |
| | | lWhFormScrapped.setStates(1); |
| | | lWhFormScrapped.setOperatorId(userId); |
| | | lWhFormScrapped.setOperatorName(nickName); |
| | | lWhFormScrapped.setDealTime(dealTime); |
| | | lWhFormScrappedService.update(lWhFormScrapped); |
| | | return lWarehouseFlowId; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @ClassName LWhFormScrappedGoodsService |
| | | * @Author cy |
| | | * @Date 2023/10/30 |
| | | * @Description |
| | | * @Version 1.0 |
| | | **/ |
| | | @Service |
| | | public class LWhFormScrappedGoodsService extends BaseServiceImpl { |
| | | |
| | | } |
New file |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @ClassName LWhFormScrappedService |
| | | * @Author cy |
| | | * @Date 2023/10/30 |
| | | * @Description |
| | | * @Version 1.0 |
| | | **/ |
| | | @Service |
| | | public class LWhFormScrappedService extends BaseServiceImpl { |
| | | |
| | | } |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.core.CodeGeneratorEnum; |
| | | import com.consum.base.core.CodeGeneratorService; |
| | | import com.consum.base.core.WhBusinessEnum; |
| | | import com.consum.base.core.param.BaseWarehouseParam1; |
| | | import com.consum.base.pojo.*; |
| | | import com.consum.base.pojo.LWhFormTransferParam; |
| | | import com.consum.base.pojo.LWhProcureModelParams; |
| | | import com.consum.base.util.IdUtil; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.vo.LWhFormOutputVo; |
| | |
| | | lWhProcureModel.setBaseGoodsModelsId(model.getBaseGoodsModelsId()); |
| | | lWhProcureModel.setCounts(model.getCounts()); |
| | | //根据物品型号查询物品库存 |
| | | int goodsNum = this.lWhGoodsService.queryGoodsModelNum(warehouseId, model.getBaseGoodsModelsId(), (short) 1, null); |
| | | int goodsNum = this.lWhGoodsService.queryGoodsModelNum(0,warehouseId, model.getBaseGoodsModelsId(), (short) 1, null); |
| | | lWhProcureModel.setWorehouseCount(goodsNum); |
| | | modelList.add(lWhProcureModel); |
| | | } |
New file |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.jdbc.core.JdbcTemplate; |
| | | import org.springframework.jdbc.core.namedparam.MapSqlParameterSource; |
| | | import org.springframework.jdbc.core.namedparam.SqlParameterSource; |
| | | import org.springframework.jdbc.core.simple.SimpleJdbcCall; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @ClassName LWhGoodsRecordDetailsService |
| | | * @Author cy |
| | | * @Date 2023/10/31 |
| | | * @Description |
| | | * @Version 1.0 |
| | | **/ |
| | | @Service |
| | | public class LWhGoodsRecordDetailsService extends BaseServiceImpl { |
| | | private final JdbcTemplate jdbcTemplate; |
| | | private SimpleJdbcCall simpleJdbcCall; |
| | | |
| | | @Autowired |
| | | public LWhGoodsRecordDetailsService(JdbcTemplate jdbcTemplate) { |
| | | this.jdbcTemplate = jdbcTemplate; |
| | | this.simpleJdbcCall = new SimpleJdbcCall(jdbcTemplate).withProcedureName("insert_WH_GOODS_RECORD_DETAILS"); |
| | | } |
| | | |
| | | public void sameGoodsInsertMore(List<Long> outGoodsId, long whGoodsRecordId, short thisType) { |
| | | SqlParameterSource in = new MapSqlParameterSource() |
| | | .addValue("WHGOODSIDList", StringUtils.join(outGoodsId)) |
| | | .addValue("WH_GOODS_RECORD_ID", whGoodsRecordId) |
| | | .addValue("THIS_TYPE", thisType); |
| | | Map<String, Object> out = simpleJdbcCall.execute(in); |
| | | System.out.println("Procedure result: " + out); |
| | | } |
| | | |
| | | } |
| | |
| | | |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | |
| | | |
| | | /** |
| | | * @param warehouseType 仓库类型0机构1部门 |
| | | * @param warehouseId 所属仓库仓库编号 |
| | | * @param baseGoodsModelsId 规格型号编号 |
| | | * @param states (0=在途调拨;1=入库未分发;2=已下发;3=报废) |
| | |
| | | */ |
| | | private static String query_Goods_Model_Num = "SELECT COUNT(1) from L_WH_GOODS where 1=1"; |
| | | |
| | | public int queryGoodsModelNum(Long warehouseId, Long baseGoodsModelsId, Short states, Short buyType) { |
| | | public int queryGoodsModelNum(Integer warehouseType, Long warehouseId, Long baseGoodsModelsId, Short states, Short buyType) { |
| | | StringBuilder sql = new StringBuilder(query_Goods_Model_Num); |
| | | Map<String, Object> paramts = new HashMap<>(); |
| | | |
| | | if (warehouseType != null) { |
| | | sql.append(" and WAREHOUSE_TYPE=:warehouseType"); |
| | | paramts.put("warehouseType", warehouseType); |
| | | } |
| | | if (warehouseId != null) { |
| | | sql.append(" and WAREHOUSE_ID=:warehouseId"); |
| | | paramts.put("warehouseId", warehouseId); |
| | |
| | | */ |
| | | private static String QUERY_OUT_GOODS_ID = "SELECT*FROM L_WH_GOODS WHERE 1=1"; |
| | | |
| | | public List<Map<String, Object>> queryOutGoods(Long warehouseId, Long baseGoodsModelsId, Short states, Short buyType, Integer goodsModelNum) { |
| | | public List<Map<String, Object>> queryOutGoods(Integer warehouseType, Long warehouseId, Long baseGoodsModelsId, Short states, Short buyType, Integer goodsModelNum) { |
| | | StringBuilder sql = new StringBuilder(QUERY_OUT_GOODS_ID); |
| | | Map<String, Object> paramts = new HashMap<>(); |
| | | if (warehouseType != null) { |
| | | sql.append(" and WAREHOUSE_TYPE=:warehouseType"); |
| | | paramts.put("warehouseType", warehouseType); |
| | | } |
| | | if (warehouseId != null) { |
| | | sql.append(" and WAREHOUSE_ID=:warehouseId"); |
| | | paramts.put("warehouseId", warehouseId); |
| | |
| | | paramts.put("baseGoodsModelsId", baseGoodsModelsId); |
| | | } |
| | | if (states != null) { |
| | | sql.append(" and STATES=:STATES"); |
| | | sql.append(" and STATES=:states"); |
| | | paramts.put("states", states); |
| | | } |
| | | if (buyType != null) { |
| | |
| | | * @param goodsModelNum 取出的数量 |
| | | * @return |
| | | */ |
| | | public List<Long> queryOutGoodsId(Long warehouseId, Long baseGoodsModelsId, Short states, Short buyType, Integer goodsModelNum) { |
| | | List<Map<String, Object>> outGoods = queryOutGoods(warehouseId, baseGoodsModelsId, states, buyType, goodsModelNum); |
| | | public List<Long> queryOutGoodsId(Integer warehouseType, Long warehouseId, Long baseGoodsModelsId, Short states, Short buyType, Integer goodsModelNum) { |
| | | List<Map<String, Object>> outGoods = queryOutGoods(warehouseType, warehouseId, baseGoodsModelsId, states, buyType, goodsModelNum); |
| | | if (CollectionUtils.isEmpty(outGoods)) { |
| | | return null; |
| | | } |
| | | List<Long> whGoodsIds = outGoods.stream().map(map -> (Long) map.get("id")).collect(Collectors.toList()); |
| | | return whGoodsIds; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询报废物品 |
| | | * 默认优先报废最高价的物品 |
| | | * |
| | | * @param warehouseType |
| | | * @param warehouseId |
| | | * @param transBusinessId 调拨单号 |
| | | * @param nowUserName 使用人姓名 |
| | | * @param baseGoodsModelsId 物品型号 |
| | | * @param states 状态(0=在途调拨;1=入库未分发;2=已下发;3=报废 4 零星出库) |
| | | * @param goodsModelNum 取出的数量 |
| | | * @return |
| | | */ |
| | | private static String QUERY_SCRAPPED_GOODS_PREFIX = "SELECT goods.id FROM L_WH_GOODS goods LEFT JOIN (SELECT t2.*FROM (SELECT max(DEAL_TIME) DEAL_TIME,WH_GOODS_ID FROM L_GOODS_USER_RECORD GROUP BY WH_GOODS_ID) t1 LEFT JOIN L_GOODS_USER_RECORD t2 ON t1.DEAL_TIME=t2.DEAL_TIME AND t1.WH_GOODS_ID=t2.WH_GOODS_ID) useRecord ON goods.id=useRecord.WH_GOODS_ID WHERE 1=1"; |
| | | private static String QUERY_SCRAPPED_GOODS_END = " ORDER BY goods.PRICE DESC,goods.PROCURE_DATE ASC,goods.id"; |
| | | |
| | | public List<Map<String, Object>> queryScrappedGoods(Integer warehouseType, |
| | | Long warehouseId, |
| | | Long transBusinessId, |
| | | String nowUserName, |
| | | Long baseGoodsModelsId, |
| | | Short states, |
| | | Integer goodsModelNum) { |
| | | if (warehouseType == null) { |
| | | warehouseType = 0; |
| | | } |
| | | StringBuilder sql = new StringBuilder(QUERY_SCRAPPED_GOODS_PREFIX); |
| | | Map<String, Object> paramts = new HashMap<>(); |
| | | if (warehouseType != null) { |
| | | sql.append(" AND goods.WAREHOUSE_TYPE=:warehouseType"); |
| | | paramts.put("warehouseType", warehouseType); |
| | | } |
| | | if (warehouseId != null) { |
| | | sql.append(" AND goods.WAREHOUSE_ID=:warehouseId"); |
| | | paramts.put("warehouseId", warehouseId); |
| | | } |
| | | if (transBusinessId != null) { |
| | | sql.append(" and useRecord.TRANS_BUSINESS_ID=:transBusinessId"); |
| | | paramts.put("transBusinessId", transBusinessId); |
| | | } |
| | | if (StringUtils.isNotEmpty(nowUserName)) { |
| | | sql.append(" AND useRecord.NOW_USER_NAME=:nowUserName"); |
| | | paramts.put("nowUserName", nowUserName); |
| | | } |
| | | if (baseGoodsModelsId != null) { |
| | | sql.append(" AND goods.BASE_GOODS_MODELS_ID=:baseGoodsModelsId"); |
| | | paramts.put("baseGoodsModelsId", baseGoodsModelsId); |
| | | } |
| | | if (states != null) { |
| | | sql.append(" AND goods.STATES=:states"); |
| | | paramts.put("states", states); |
| | | } |
| | | return select(sql.append(QUERY_SCRAPPED_GOODS_END).append(" limit").append(goodsModelNum).toString(), paramts); |
| | | } |
| | | |
| | | /** |
| | | * 查询报废物品 |
| | | * 默认优先报废最高价的物品 |
| | | * |
| | | * @param warehouseType |
| | | * @param warehouseId |
| | | * @param transBusinessId 调拨单号 |
| | | * @param nowUserName 使用人姓名 |
| | | * @param baseGoodsModelsId 物品型号 |
| | | * @param states 状态(0=在途调拨;1=入库未分发;2=已下发;3=报废 4 零星出库) |
| | | * @param goodsModelNum 取出的数量 |
| | | * @return |
| | | */ |
| | | public List<Long> queryScrappedGoodsIds(Integer warehouseType, |
| | | Long warehouseId, |
| | | Long transBusinessId, |
| | | String nowUserName, |
| | | Long baseGoodsModelsId, |
| | | Short states, |
| | | Integer goodsModelNum) { |
| | | List<Map<String, Object>> outGoods = queryScrappedGoods(warehouseType, warehouseId, transBusinessId, nowUserName, baseGoodsModelsId, states, goodsModelNum); |
| | | if (CollectionUtils.isEmpty(outGoods)) { |
| | | return null; |
| | | } |
| | | List<Long> whGoodsIds = outGoods.stream().map(map -> (Long) map.get("id")).collect(Collectors.toList()); |
| | | return whGoodsIds; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 设置物品状态为调拨中 |
| | |
| | | */ |
| | | private static String MOD_GOODS_TRANSFERING_PREFIX = "update L_WH_GOODS set"; |
| | | |
| | | public int modGoodsTransfering(List<Long> whGoods, Long toWarehouseId, String toWarehouseName, Short states) { |
| | | public int modGoodsTransfering(List<Long> whGoods, Integer warehouseType, Long toWarehouseId, String toWarehouseName, Short states) { |
| | | StringBuilder sql = new StringBuilder(MOD_GOODS_TRANSFERING_PREFIX); |
| | | ArrayList<Object> params = new ArrayList<>(); |
| | | if (toWarehouseId != null) { |
| | | sql.append(", WAREHOUSE_TYPE=?"); |
| | | params.add(warehouseType); |
| | | } |
| | | if (toWarehouseId != null) { |
| | | sql.append(", WAREHOUSE_ID=?"); |
| | | params.add(toWarehouseId); |
| | |
| | | params.add(whGoods); |
| | | return update(sql.toString(), params.toArray()); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | protected boolean isset_id = false; |
| | | |
| | | // 属性列表 |
| | | private Long goodsUserPhone = null; |
| | | private Long whGoodsId = null; |
| | | @JsonIgnore |
| | | protected boolean isset_goodsUserPhone = false; |
| | | protected boolean isset_whGoodsId = false; |
| | | |
| | | private Integer recordType = null; |
| | | @JsonIgnore |
| | | protected boolean isset_recordType = false; |
| | | |
| | | private Long lastRecordId = null; |
| | | private Long transBusinessId = null; |
| | | @JsonIgnore |
| | | protected boolean isset_lastRecordId = false; |
| | | protected boolean isset_transBusinessId = false; |
| | | |
| | | private Long nowUserPhone = null; |
| | | @JsonIgnore |
| | |
| | | return this.id == null; |
| | | } |
| | | |
| | | public Long getGoodsUserPhone() { |
| | | return this.goodsUserPhone; |
| | | public Long getWhGoodsId() { |
| | | return this.whGoodsId; |
| | | } |
| | | |
| | | public void setGoodsUserPhone(Long goodsUserPhone) { |
| | | this.goodsUserPhone = goodsUserPhone; |
| | | this.isset_goodsUserPhone = true; |
| | | public void setWhGoodsId(Long whGoodsId) { |
| | | this.whGoodsId = whGoodsId; |
| | | this.isset_whGoodsId = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyGoodsUserPhone() { |
| | | return this.goodsUserPhone == null; |
| | | public boolean isEmptyWhGoodsId() { |
| | | return this.whGoodsId == null; |
| | | } |
| | | |
| | | public Integer getRecordType() { |
| | |
| | | return this.recordType == null; |
| | | } |
| | | |
| | | public Long getLastRecordId() { |
| | | return this.lastRecordId; |
| | | public Long getTransBusinessId() { |
| | | return this.transBusinessId; |
| | | } |
| | | |
| | | public void setLastRecordId(Long lastRecordId) { |
| | | this.lastRecordId = lastRecordId; |
| | | this.isset_lastRecordId = true; |
| | | public void setTransBusinessId(Long transBusinessId) { |
| | | this.transBusinessId = transBusinessId; |
| | | this.isset_transBusinessId = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyLastRecordId() { |
| | | return this.lastRecordId == null; |
| | | public boolean isEmptyTransBusinessId() { |
| | | return this.transBusinessId == null; |
| | | } |
| | | |
| | | public Long getNowUserPhone() { |
| | |
| | | public String toString() { |
| | | return new StringBuilder() |
| | | .append("id=").append(this.id) |
| | | .append("goodsUserPhone=").append(this.goodsUserPhone) |
| | | .append("whGoodsId=").append(this.whGoodsId) |
| | | .append("recordType=").append(this.recordType) |
| | | .append("lastRecordId=").append(this.lastRecordId) |
| | | .append("transBusinessId=").append(this.transBusinessId) |
| | | .append("nowUserPhone=").append(this.nowUserPhone) |
| | | .append("nowUserName=").append(this.nowUserName) |
| | | .append("operatorId=").append(this.operatorId) |
| | |
| | | l_goods_user_record.setId(this.getId()); |
| | | } |
| | | // 普通属性 |
| | | if (this.isset_goodsUserPhone) { |
| | | l_goods_user_record.setGoodsUserPhone(this.getGoodsUserPhone()); |
| | | if (this.isset_whGoodsId) { |
| | | l_goods_user_record.setWhGoodsId(this.getWhGoodsId()); |
| | | } |
| | | if (this.isset_recordType) { |
| | | l_goods_user_record.setRecordType(this.getRecordType()); |
| | | } |
| | | if (this.isset_lastRecordId) { |
| | | l_goods_user_record.setLastRecordId(this.getLastRecordId()); |
| | | if (this.isset_transBusinessId) { |
| | | l_goods_user_record.setTransBusinessId(this.getTransBusinessId()); |
| | | } |
| | | if (this.isset_nowUserPhone) { |
| | | l_goods_user_record.setNowUserPhone(this.getNowUserPhone()); |
| | |
| | | import com.walker.jdbc.sqlgen.InsertBuilder; |
| | | import com.walker.jdbc.sqlgen.SelectBuilder; |
| | | import com.walker.jdbc.sqlgen.UpdateBuilder; |
| | | import com.walker.jdbc.util.StringUtils; |
| | | |
| | | import org.springframework.jdbc.core.RowMapper; |
| | | |
| | | import java.sql.ResultSet; |
| | |
| | | // 主键 |
| | | public static final String Id = "id"; |
| | | // 普通属性 |
| | | public static final String GoodsUserPhone = "goods_user_phone"; |
| | | public static final String WhGoodsId = "wh_goods_id"; |
| | | public static final String RecordType = "record_type"; |
| | | public static final String LastRecordId = "last_record_id"; |
| | | public static final String TransBusinessId = "trans_business_id"; |
| | | public static final String NowUserPhone = "now_user_phone"; |
| | | public static final String NowUserName = "now_user_name"; |
| | | public static final String OperatorId = "operator_id"; |
| | |
| | | this.setId(lGoodsUserRecord.getId()); |
| | | } |
| | | //普通属性 |
| | | if (lGoodsUserRecord.isset_goodsUserPhone) { |
| | | this.setGoodsUserPhone(lGoodsUserRecord.getGoodsUserPhone()); |
| | | if (lGoodsUserRecord.isset_whGoodsId) { |
| | | this.setWhGoodsId(lGoodsUserRecord.getWhGoodsId()); |
| | | } |
| | | if (lGoodsUserRecord.isset_recordType) { |
| | | this.setRecordType(lGoodsUserRecord.getRecordType()); |
| | | } |
| | | if (lGoodsUserRecord.isset_lastRecordId) { |
| | | this.setLastRecordId(lGoodsUserRecord.getLastRecordId()); |
| | | if (lGoodsUserRecord.isset_transBusinessId) { |
| | | this.setTransBusinessId(lGoodsUserRecord.getTransBusinessId()); |
| | | } |
| | | if (lGoodsUserRecord.isset_nowUserPhone) { |
| | | this.setNowUserPhone(lGoodsUserRecord.getNowUserPhone()); |
| | |
| | | public SqlAndParameters<Map<String, Object>> getInsertSql_() { |
| | | InsertBuilder ib = new InsertBuilder(this.getTableName_()); |
| | | ib.set(Id, this.getId()); |
| | | ib.set(GoodsUserPhone, this.getGoodsUserPhone(), this.isset_goodsUserPhone); |
| | | ib.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId); |
| | | ib.set(RecordType, this.getRecordType(), this.isset_recordType); |
| | | ib.set(LastRecordId, this.getLastRecordId(), this.isset_lastRecordId); |
| | | ib.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); |
| | | ib.set(NowUserPhone, this.getNowUserPhone(), this.isset_nowUserPhone); |
| | | ib.set(NowUserName, this.getNowUserName(), this.isset_nowUserName); |
| | | ib.set(OperatorId, this.getOperatorId(), this.isset_operatorId); |
| | |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getUpdateSql_() { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(GoodsUserPhone, this.getGoodsUserPhone(), this.isset_goodsUserPhone); |
| | | ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId); |
| | | ub.set(RecordType, this.getRecordType(), this.isset_recordType); |
| | | ub.set(LastRecordId, this.getLastRecordId(), this.isset_lastRecordId); |
| | | ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); |
| | | ub.set(NowUserPhone, this.getNowUserPhone(), this.isset_nowUserPhone); |
| | | ub.set(NowUserName, this.getNowUserName(), this.isset_nowUserName); |
| | | ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId); |
| | |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getUpdateSql_(String where, Map<String, Object> parameters) { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(GoodsUserPhone, this.getGoodsUserPhone(), this.isset_goodsUserPhone); |
| | | ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId); |
| | | ub.set(RecordType, this.getRecordType(), this.isset_recordType); |
| | | ub.set(LastRecordId, this.getLastRecordId(), this.isset_lastRecordId); |
| | | ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); |
| | | ub.set(NowUserPhone, this.getNowUserPhone(), this.isset_nowUserPhone); |
| | | ub.set(NowUserName, this.getNowUserName(), this.isset_nowUserName); |
| | | ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId); |
| | |
| | | @Override |
| | | public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(GoodsUserPhone, this.getGoodsUserPhone(), this.isset_goodsUserPhone); |
| | | ub.set(WhGoodsId, this.getWhGoodsId(), this.isset_whGoodsId); |
| | | ub.set(RecordType, this.getRecordType(), this.isset_recordType); |
| | | ub.set(LastRecordId, this.getLastRecordId(), this.isset_lastRecordId); |
| | | ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); |
| | | ub.set(NowUserPhone, this.getNowUserPhone(), this.isset_nowUserPhone); |
| | | ub.set(NowUserName, this.getNowUserName(), this.isset_nowUserName); |
| | | ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId); |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, goods_user_phone, record_type, last_record_id, now_user_phone, now_user_name, operator_id, operator_name, deal_time from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>("select id, wh_goods_id, record_type, trans_business_id, now_user_phone, now_user_name, operator_id, operator_name, deal_time from " + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, goods_user_phone, record_type, last_record_id, now_user_phone, now_user_name, operator_id, operator_name, deal_time from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>("select id, wh_goods_id, record_type, trans_business_id, now_user_phone, now_user_name, operator_id, operator_name, deal_time from " + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | l_goods_user_record.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.GoodsUserPhone); |
| | | columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.WhGoodsId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | l_goods_user_record.setGoodsUserPhone(null); |
| | | l_goods_user_record.setWhGoodsId(null); |
| | | } else { |
| | | l_goods_user_record.setGoodsUserPhone(rs.getLong(columnIndex)); |
| | | l_goods_user_record.setWhGoodsId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.RecordType); |
| | |
| | | l_goods_user_record.setRecordType(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.LastRecordId); |
| | | columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.TransBusinessId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | l_goods_user_record.setLastRecordId(null); |
| | | l_goods_user_record.setTransBusinessId(null); |
| | | } else { |
| | | l_goods_user_record.setLastRecordId(rs.getLong(columnIndex)); |
| | | l_goods_user_record.setTransBusinessId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LGoodsUserRecord_mapper.NowUserPhone); |
| | |
| | | @JsonIgnore |
| | | protected boolean isset_businessFormCode = false; |
| | | |
| | | private Integer warehouseType = null; |
| | | @JsonIgnore |
| | | protected boolean isset_warehouseType = false; |
| | | |
| | | private Long warehouseId = null; |
| | | @JsonIgnore |
| | | protected boolean isset_warehouseId = false; |
| | |
| | | private String warehouseName = null; |
| | | @JsonIgnore |
| | | protected boolean isset_warehouseName = false; |
| | | |
| | | private Integer scrappedType = null; |
| | | @JsonIgnore |
| | | protected boolean isset_scrappedType = false; |
| | | |
| | | private Long agencyId = null; |
| | | @JsonIgnore |
| | |
| | | return this.businessFormCode == null || this.businessFormCode.length() == 0; |
| | | } |
| | | |
| | | public Integer getWarehouseType() { |
| | | return this.warehouseType; |
| | | } |
| | | |
| | | public void setWarehouseType(Integer warehouseType) { |
| | | this.warehouseType = warehouseType; |
| | | this.isset_warehouseType = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyWarehouseType() { |
| | | return this.warehouseType == null; |
| | | } |
| | | |
| | | public Long getWarehouseId() { |
| | | return this.warehouseId; |
| | | } |
| | |
| | | @JsonIgnore |
| | | public boolean isEmptyWarehouseName() { |
| | | return this.warehouseName == null || this.warehouseName.length() == 0; |
| | | } |
| | | |
| | | public Integer getScrappedType() { |
| | | return this.scrappedType; |
| | | } |
| | | |
| | | public void setScrappedType(Integer scrappedType) { |
| | | this.scrappedType = scrappedType; |
| | | this.isset_scrappedType = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyScrappedType() { |
| | | return this.scrappedType == null; |
| | | } |
| | | |
| | | public Long getAgencyId() { |
| | |
| | | .append("id=").append(this.id) |
| | | .append("lWarehouseFlowId=").append(this.lWarehouseFlowId) |
| | | .append("businessFormCode=").append(this.businessFormCode) |
| | | .append("warehouseType=").append(this.warehouseType) |
| | | .append("warehouseId=").append(this.warehouseId) |
| | | .append("warehouseName=").append(this.warehouseName) |
| | | .append("scrappedType=").append(this.scrappedType) |
| | | .append("agencyId=").append(this.agencyId) |
| | | .append("agencyName=").append(this.agencyName) |
| | | .append("operatorId=").append(this.operatorId) |
| | |
| | | if (this.isset_businessFormCode) { |
| | | l_wh_form_scrapped.setBusinessFormCode(this.getBusinessFormCode()); |
| | | } |
| | | if (this.isset_warehouseType) { |
| | | l_wh_form_scrapped.setWarehouseType(this.getWarehouseType()); |
| | | } |
| | | if (this.isset_warehouseId) { |
| | | l_wh_form_scrapped.setWarehouseId(this.getWarehouseId()); |
| | | } |
| | | if (this.isset_warehouseName) { |
| | | l_wh_form_scrapped.setWarehouseName(this.getWarehouseName()); |
| | | } |
| | | if (this.isset_scrappedType) { |
| | | l_wh_form_scrapped.setScrappedType(this.getScrappedType()); |
| | | } |
| | | if (this.isset_agencyId) { |
| | | l_wh_form_scrapped.setAgencyId(this.getAgencyId()); |
| | |
| | | // 普通属性 |
| | | public static final String LWarehouseFlowId = "l_warehouse_flow_id"; |
| | | public static final String BusinessFormCode = "business_form_code"; |
| | | public static final String WarehouseType = "warehouse_type"; |
| | | public static final String WarehouseId = "warehouse_id"; |
| | | public static final String WarehouseName = "warehouse_name"; |
| | | public static final String ScrappedType = "scrapped_type"; |
| | | public static final String AgencyId = "agency_id"; |
| | | public static final String AgencyName = "agency_name"; |
| | | public static final String OperatorId = "operator_id"; |
| | |
| | | if (lWhFormScrapped.isset_businessFormCode) { |
| | | this.setBusinessFormCode(lWhFormScrapped.getBusinessFormCode()); |
| | | } |
| | | if (lWhFormScrapped.isset_warehouseType) { |
| | | this.setWarehouseType(lWhFormScrapped.getWarehouseType()); |
| | | } |
| | | if (lWhFormScrapped.isset_warehouseId) { |
| | | this.setWarehouseId(lWhFormScrapped.getWarehouseId()); |
| | | } |
| | | if (lWhFormScrapped.isset_warehouseName) { |
| | | this.setWarehouseName(lWhFormScrapped.getWarehouseName()); |
| | | } |
| | | if (lWhFormScrapped.isset_scrappedType) { |
| | | this.setScrappedType(lWhFormScrapped.getScrappedType()); |
| | | } |
| | | if (lWhFormScrapped.isset_agencyId) { |
| | | this.setAgencyId(lWhFormScrapped.getAgencyId()); |
| | |
| | | ib.set(Id, this.getId()); |
| | | ib.set(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId); |
| | | ib.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); |
| | | ib.set(WarehouseType, this.getWarehouseType(), this.isset_warehouseType); |
| | | ib.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); |
| | | ib.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName); |
| | | ib.set(ScrappedType, this.getScrappedType(), this.isset_scrappedType); |
| | | ib.set(AgencyId, this.getAgencyId(), this.isset_agencyId); |
| | | ib.set(AgencyName, this.getAgencyName(), this.isset_agencyName); |
| | | ib.set(OperatorId, this.getOperatorId(), this.isset_operatorId); |
| | |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId); |
| | | ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); |
| | | ub.set(WarehouseType, this.getWarehouseType(), this.isset_warehouseType); |
| | | ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); |
| | | ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName); |
| | | ub.set(ScrappedType, this.getScrappedType(), this.isset_scrappedType); |
| | | ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId); |
| | | ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName); |
| | | ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId); |
| | |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId); |
| | | ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); |
| | | ub.set(WarehouseType, this.getWarehouseType(), this.isset_warehouseType); |
| | | ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); |
| | | ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName); |
| | | ub.set(ScrappedType, this.getScrappedType(), this.isset_scrappedType); |
| | | ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId); |
| | | ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName); |
| | | ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId); |
| | |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(LWarehouseFlowId, this.getLWarehouseFlowId(), this.isset_lWarehouseFlowId); |
| | | ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); |
| | | ub.set(WarehouseType, this.getWarehouseType(), this.isset_warehouseType); |
| | | ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); |
| | | ub.set(WarehouseName, this.getWarehouseName(), this.isset_warehouseName); |
| | | ub.set(ScrappedType, this.getScrappedType(), this.isset_scrappedType); |
| | | ub.set(AgencyId, this.getAgencyId(), this.isset_agencyId); |
| | | ub.set(AgencyName, this.getAgencyName(), this.isset_agencyName); |
| | | ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId); |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, l_warehouse_flow_id, business_form_code, warehouse_id, warehouse_name, scrapped_type, agency_id, agency_name, operator_id, operator_name, deal_time, department_id, department_name, upload_files, states from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>("select id, l_warehouse_flow_id, business_form_code, warehouse_type, warehouse_id, warehouse_name, agency_id, agency_name, operator_id, operator_name, deal_time, department_id, department_name, upload_files, states from " + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, l_warehouse_flow_id, business_form_code, warehouse_id, warehouse_name, scrapped_type, agency_id, agency_name, operator_id, operator_name, deal_time, department_id, department_name, upload_files, states from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>("select id, l_warehouse_flow_id, business_form_code, warehouse_type, warehouse_id, warehouse_name, agency_id, agency_name, operator_id, operator_name, deal_time, department_id, department_name, upload_files, states from " + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | if (columnIndex > 0) { |
| | | l_wh_form_scrapped.setBusinessFormCode(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.WarehouseType); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | l_wh_form_scrapped.setWarehouseType(null); |
| | | } else { |
| | | l_wh_form_scrapped.setWarehouseType(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.WarehouseId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.WarehouseName); |
| | | if (columnIndex > 0) { |
| | | l_wh_form_scrapped.setWarehouseName(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.ScrappedType); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | l_wh_form_scrapped.setScrappedType(null); |
| | | } else { |
| | | l_wh_form_scrapped.setScrappedType(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhFormScrapped_mapper.AgencyId); |
| | | if (columnIndex > 0) { |
| | |
| | | protected boolean isset_id = false; |
| | | |
| | | // 属性列表 |
| | | private Integer warehouseType = null; |
| | | @JsonIgnore |
| | | protected boolean isset_warehouseType = false; |
| | | |
| | | private Long warehouseId = null; |
| | | @JsonIgnore |
| | | protected boolean isset_warehouseId = false; |
| | |
| | | @JsonIgnore |
| | | public boolean isEmptyId() { |
| | | return this.id == null; |
| | | } |
| | | |
| | | public Integer getWarehouseType() { |
| | | return this.warehouseType; |
| | | } |
| | | |
| | | public void setWarehouseType(Integer warehouseType) { |
| | | this.warehouseType = warehouseType; |
| | | this.isset_warehouseType = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyWarehouseType() { |
| | | return this.warehouseType == null; |
| | | } |
| | | |
| | | public Long getWarehouseId() { |
| | |
| | | public String toString() { |
| | | return new StringBuilder() |
| | | .append("id=").append(this.id) |
| | | .append("warehouseType=").append(this.warehouseType) |
| | | .append("warehouseId=").append(this.warehouseId) |
| | | .append("warehouseFlowId=").append(this.warehouseFlowId) |
| | | .append("initialCount=").append(this.initialCount) |
| | |
| | | l_wh_goods_record.setId(this.getId()); |
| | | } |
| | | // 普通属性 |
| | | if (this.isset_warehouseType) { |
| | | l_wh_goods_record.setWarehouseType(this.getWarehouseType()); |
| | | } |
| | | if (this.isset_warehouseId) { |
| | | l_wh_goods_record.setWarehouseId(this.getWarehouseId()); |
| | | } |
| | |
| | | // 主键 |
| | | public static final String Id = "id"; |
| | | // 普通属性 |
| | | public static final String WarehouseType = "warehouse_type"; |
| | | public static final String WarehouseId = "warehouse_id"; |
| | | public static final String WarehouseFlowId = "warehouse_flow_id"; |
| | | public static final String InitialCount = "initial_count"; |
| | |
| | | this.setId(lWhGoodsRecord.getId()); |
| | | } |
| | | //普通属性 |
| | | if (lWhGoodsRecord.isset_warehouseType) { |
| | | this.setWarehouseType(lWhGoodsRecord.getWarehouseType()); |
| | | } |
| | | if (lWhGoodsRecord.isset_warehouseId) { |
| | | this.setWarehouseId(lWhGoodsRecord.getWarehouseId()); |
| | | } |
| | |
| | | public SqlAndParameters<Map<String, Object>> getInsertSql_() { |
| | | InsertBuilder ib = new InsertBuilder(this.getTableName_()); |
| | | ib.set(Id, this.getId()); |
| | | ib.set(WarehouseType, this.getWarehouseType(), this.isset_warehouseType); |
| | | ib.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); |
| | | ib.set(WarehouseFlowId, this.getWarehouseFlowId(), this.isset_warehouseFlowId); |
| | | ib.set(InitialCount, this.getInitialCount(), this.isset_initialCount); |
| | |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getUpdateSql_() { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(WarehouseType, this.getWarehouseType(), this.isset_warehouseType); |
| | | ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); |
| | | ub.set(WarehouseFlowId, this.getWarehouseFlowId(), this.isset_warehouseFlowId); |
| | | ub.set(InitialCount, this.getInitialCount(), this.isset_initialCount); |
| | |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getUpdateSql_(String where, Map<String, Object> parameters) { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(WarehouseType, this.getWarehouseType(), this.isset_warehouseType); |
| | | ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); |
| | | ub.set(WarehouseFlowId, this.getWarehouseFlowId(), this.isset_warehouseFlowId); |
| | | ub.set(InitialCount, this.getInitialCount(), this.isset_initialCount); |
| | |
| | | @Override |
| | | public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(WarehouseType, this.getWarehouseType(), this.isset_warehouseType); |
| | | ub.set(WarehouseId, this.getWarehouseId(), this.isset_warehouseId); |
| | | ub.set(WarehouseFlowId, this.getWarehouseFlowId(), this.isset_warehouseFlowId); |
| | | ub.set(InitialCount, this.getInitialCount(), this.isset_initialCount); |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, warehouse_id, warehouse_flow_id, initial_count, this_type, this_count, end_count, base_goods_template_id, goods_template_name, base_goods_models_id, base_goods_models_name, deal_time from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>("select id, warehouse_type, warehouse_id, warehouse_flow_id, initial_count, this_type, this_count, end_count, base_goods_template_id, goods_template_name, base_goods_models_id, base_goods_models_name, deal_time from " + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, warehouse_id, warehouse_flow_id, initial_count, this_type, this_count, end_count, base_goods_template_id, goods_template_name, base_goods_models_id, base_goods_models_name, deal_time from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>("select id, warehouse_type, warehouse_id, warehouse_flow_id, initial_count, this_type, this_count, end_count, base_goods_template_id, goods_template_name, base_goods_models_id, base_goods_models_name, deal_time from " + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | l_wh_goods_record.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.WarehouseType); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | l_wh_goods_record.setWarehouseType(null); |
| | | } else { |
| | | l_wh_goods_record.setWarehouseType(rs.getInt(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhGoodsRecord_mapper.WarehouseId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |