| | |
| | | |
| | | /** |
| | | * @ClassName LOrgSupplierController |
| | | * @Author cy |
| | | |
| | | * @Date 2023/11/2 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName lWarehouseFlowController |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/27 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName LWhFormProcureController |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/27 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | // 插入 采购单物品【L_WH_FORM_PROCURE_GOODS】 |
| | | LWhFormProcure lWhFormProcure = new LWhFormProcure(); |
| | | lWhFormProcure.setId(whFormProcureId); |
| | | lWhFormProcure.setBusinessFormCode(codeGeneratorService.createCodeByPrefix(CodeGeneratorEnum.Procure_Warehouse.getValue(), 10)); |
| | | lWhFormProcure.setBusinessFormCode(codeGeneratorService.createBusinessFormCode(CodeGeneratorEnum.Procure_Warehouse)); |
| | | lWhFormProcure.setWarehouseId(warehouseId); |
| | | lWhFormProcure.setWarehouseName(baseWarehouse.getWarehouseName()); |
| | | lWhFormProcure.setBuyerId(currentUser.getId()); |
| | |
| | | System.out.println(prefix); |
| | | } |
| | | |
| | | public String createCodeByPrefix(String prefix,int length){ |
| | | private String createCodeByPrefix(String prefix,int length){ |
| | | String CODE_PREFIX = prefix; |
| | | String sql = "SELECT * from BASE_CODE_INDEXING where CODE_PREFIX=:CODE_PREFIX"; |
| | | |
| | |
| | | |
| | | /** |
| | | * @ClassName WhBusinessEnum |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/24 |
| | | * @Description 单据类型 |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName MapRowMapper |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/27 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName LockManage |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/25 |
| | | * @Description 全局锁管理器 |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName FinSysTenantUserUpdParam |
| | | * @Author cy |
| | | |
| | | * @Date 2023/9/6 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName LWarehouseFlowParam |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/27 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName LWhFormProcureExtend |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/27 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName LWhFormProcureExtend |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/27 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName LWhFormProcureGoodsParams |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/27 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName LWhFormProcureParam |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/27 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName LWhProcureModelParams |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/27 |
| | | * @Description |
| | | * @Version 1.0 |
New file |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @ClassName GoodsBaseServiceImpl |
| | | |
| | | * @Date 2023/11/2 |
| | | * @Description |
| | | * @Version 1.0 |
| | | **/ |
| | | @Service |
| | | public class GoodsBaseServiceImpl extends BaseServiceImpl { |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.model.po.LWhProcureModelUser; |
| | | import com.consum.model.po.LWhProcureModelUserRecord; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName LGoodsUserRecordCoreService |
| | | |
| | | * @Date 2023/11/2 |
| | | * @Description |
| | | * @Version 1.0 |
| | | **/ |
| | | @Service |
| | | public class LGoodsUserRecordCoreService { |
| | | @Resource |
| | | private GoodsBaseServiceImpl goodsBaseService; |
| | | |
| | | |
| | | /** |
| | | * 通过新旧 物品使用人修改记录【L_WH_PROCURE_MODEL_USER_RECORD】中的ID , 来修改物品使用人 |
| | | * |
| | | * @param oldProcureModelUserRecordId |
| | | * @param newProcureModelUserRecordId |
| | | * @return |
| | | */ |
| | | public boolean modifyGoodsUser(Long oldProcureModelUserRecordId, Long newProcureModelUserRecordId) { |
| | | LWhProcureModelUserRecord lWhProcureModelUserRecord = goodsBaseService.get(new LWhProcureModelUserRecord(newProcureModelUserRecordId)); |
| | | if (lWhProcureModelUserRecord == null) { |
| | | return false; |
| | | } |
| | | Long dealTime = lWhProcureModelUserRecord.getDealTime(); |
| | | Long operatorId = lWhProcureModelUserRecord.getOperatorId(); |
| | | String operatorName = lWhProcureModelUserRecord.getOperatorName(); |
| | | // 调拨单id |
| | | Long transBusinessId = lWhProcureModelUserRecord.getTransBusinessId(); |
| | | LWhProcureModelUser modelUser = new LWhProcureModelUser(); |
| | | modelUser.setProcureModelUserRecordId(newProcureModelUserRecordId); |
| | | List<LWhProcureModelUser> modelUserList = goodsBaseService.select(modelUser); |
| | | if (CollectionUtils.isEmpty(modelUserList)) { |
| | | return true; |
| | | } |
| | | for (LWhProcureModelUser lWhProcureModelUser : modelUserList) { |
| | | |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @ClassName LGoodsUserRecordServiceImpl |
| | | |
| | | * @Date 2023/11/2 |
| | | * @Description |
| | | * @Version 1.0 |
| | | **/ |
| | | @Service |
| | | public class LGoodsUserRecordServiceImpl extends BaseServiceImpl { |
| | | |
| | | } |
New file |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName LGoodsWhRecordService |
| | | |
| | | * @Date 2023/11/2 |
| | | * @Description |
| | | * @Version 1.0 |
| | | **/ |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class LGoodsWhRecordServiceImpl extends BaseServiceImpl { |
| | | private static String insert_new_record = "INSERT INTO L_GOODS_WH_RECORD (WAREHOUSE_FLOW_ID,DEAL_TIME,LAST_RECORD, WH_GOODS_ID,WAREHOUSE_TYPE, WAREHOUSE_ID)SELECT ?, ?,1,ID, WAREHOUSE_TYPE, WAREHOUSE_ID FROM L_WH_GOODS WHERE ID IN (?)"; |
| | | |
| | | public int insertNewRecord(List<Long> outGoodsIds, long lWarehouseFlowId, long dealTime) { |
| | | this.updSetNotLast(outGoodsIds); |
| | | ArrayList<Object> params = new ArrayList<>(); |
| | | params.add(lWarehouseFlowId); |
| | | params.add(dealTime); |
| | | params.add(outGoodsIds); |
| | | return this.update(insert_new_record, params.toArray()); |
| | | } |
| | | |
| | | /** |
| | | * 设置为非最新 |
| | | */ |
| | | private static String updSetNotLast = "update L_GOODS_WH_RECORD set LAST_RECORD = 0 where WH_GOODS_ID in(?)"; |
| | | |
| | | public int updSetNotLast(List<Long> outGoodsIds) { |
| | | ArrayList<Object> params = new ArrayList<>(); |
| | | params.add(outGoodsIds); |
| | | return this.update(updSetNotLast, params.toArray()); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * @ClassName LOrgSupplierServiceImpl |
| | | * @Author cy |
| | | |
| | | * @Date 2023/11/1 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName LWarehouseFlowService |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/24 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | private LWarehouseFlowService lWarehouseFlowService; |
| | | private LWhGoodsService lWhGoodsService; |
| | | private LWhGoodsRecordService lWhGoodsRecordService; |
| | | private LWhFormTransferServiceImpl lWhFormTransferService; |
| | | private LWhFormOutputCoreService lWhFormOutputCoreService; |
| | | private BaseGoodsTemplateServiceImpl baseGoodsTemplateService; |
| | | |
| | | @Autowired |
| | | public LWarehouseFlowCoreService(JdbcTemplate jdbcTemplate, LWarehouseFlowService lWarehouseFlowService, LWhGoodsService lWhGoodsService, LWhFormTransferServiceImpl lWhFormTransferService, LWhFormOutputCoreService lWhFormOutputCoreService, BaseGoodsTemplateServiceImpl baseGoodsTemplateService, LWhGoodsRecordService lWhGoodsRecordService) { |
| | | public LWarehouseFlowCoreService(JdbcTemplate jdbcTemplate, LWarehouseFlowService lWarehouseFlowService, LWhGoodsService lWhGoodsService, BaseGoodsTemplateServiceImpl baseGoodsTemplateService, LWhGoodsRecordService lWhGoodsRecordService) { |
| | | this.jdbcTemplate = jdbcTemplate; |
| | | this.lWarehouseFlowService = lWarehouseFlowService; |
| | | this.baseGoodsTemplateService = baseGoodsTemplateService; |
| | | this.lWhFormTransferService = lWhFormTransferService; |
| | | this.lWhFormOutputCoreService = lWhFormOutputCoreService; |
| | | this.lWhGoodsService = lWhGoodsService; |
| | | this.lWhGoodsRecordService = lWhGoodsRecordService; |
| | | this.simpleJdbcCall = new SimpleJdbcCall(jdbcTemplate).withProcedureName("InsertL_WH_GOODS"); |
| | |
| | | return 1; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 同样规格的物品 插入多次, |
| | | * 同时将主键记录在 进出库流水明细【L_WH_GOODS_RECORD_DETAILS】, |
| | |
| | | * @param pStates 状态 |
| | | * @param pTimes 插入条数 |
| | | */ |
| | | public void sameGoodsInsertMore(long pWarehouseFlowId, Integer warehouseType , long pWarehouseId, long pWhGoodsRecordId, short pRecordType, String pWarehouseName, short pCostType, |
| | | public void sameGoodsInsertMore(long pWarehouseFlowId, Integer warehouseType, long pWarehouseId, long pWhGoodsRecordId, short pRecordType, String pWarehouseName, short pCostType, |
| | | long pBaseGoodsTemplateId, String pGoodsTemplateName, long pBaseGoodsModelsId, |
| | | String pBaseGoodsModelsName, String pSupplier, short pBuyType, |
| | | String pUnit, long pPrice, long pProcureDate, |
| | |
| | | System.out.println("Procedure result: " + out); |
| | | } |
| | | |
| | | /** |
| | | * 调拨出库 |
| | | * |
| | | * @param outWarehouseId 出库单 |
| | | * @return |
| | | */ |
| | | public int outInsertWareFlow(Long outWarehouseId) { |
| | | // 出库时候,按 先入库的先出库,同时入库的,按价格高的先出库 |
| | | // List<Long> outGoodsId = lWhGoodsService.queryOutGoodsId(outWarehouseId, baseGoodsModelsId, queryModelStatus, buyType, goodsModelNum); |
| | | // 修改物品的状态为 状态(0=在途调拨;1=入库未分发;2=已下发;3=报废) |
| | | // 修改 所属仓库仓库编号WAREHOUSE_ID、仓库名称WAREHOUSE_NAME,此时不要同步进 物品仓库保管记录【L_GOODS_WH_RECORD】!入库时再同步 |
| | | |
| | | |
| | | // 新增记录 进出库流水总表[L_WAREHOUSE_FLOW] 各规格物品的进出库【L_WH_GOODS_RECORD】进出库流水明细[L_WH_GOODS_RECORD_DETAILS] |
| | | |
| | | |
| | | return 0; |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * @ClassName LWarehouseFlowService |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/25 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName LWhFormInventoryCoreService |
| | | * @Author cy |
| | | |
| | | * @Date 2023/11/1 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | BaseWarehouse baseWarehouse = baseWarehouseService.getById(warehouseId); |
| | | LWhFormProcure lWhFormProcure = new LWhFormProcure(); |
| | | lWhFormProcure.setId(whFormProcureId); |
| | | String inCode = codeGeneratorService.createCodeByPrefix(CodeGeneratorEnum.Procure_Warehouse.getValue(), 10); |
| | | String inCode = codeGeneratorService.createBusinessFormCode(CodeGeneratorEnum.Procure_Warehouse); |
| | | lWhFormProcure.setBusinessFormCode(inCode); |
| | | lWhFormProcure.setWarehouseId(warehouseId); |
| | | lWhFormProcure.setWarehouseName(baseWarehouse.getWarehouseName()); |
| | |
| | | return null; |
| | | } |
| | | lWhFormOutput.setWarehouseName(warehouse.getWarehouseName()); |
| | | String outCode = codeGeneratorService.createCodeByPrefix(CodeGeneratorEnum.OutPut_Warehouse.getValue(), 10); |
| | | String outCode = codeGeneratorService.createBusinessFormCode(CodeGeneratorEnum.OutPut_Warehouse); |
| | | lWhFormOutput.setOutputCode(outCode); |
| | | lWhFormOutput.setOutputName("盘点出库"); |
| | | lWhFormOutput.setAgencyId(Long.valueOf(sysInfo.getTenantId())); |
| | | lWhFormOutput.setAgencyName(sysInfo.getTenantName()); |
| | | // lWhFormOutput.setAgencyId(Long.valueOf(sysInfo.getTenantId())); |
| | | lWhFormOutput.setAgencyId(null); |
| | | // lWhFormOutput.setAgencyName(sysInfo.getTenantName()); |
| | | lWhFormOutput.setAgencyName(null); |
| | | lWhFormOutput.setOperatorId(sysInfo.getId()); |
| | | lWhFormOutput.setOperatorName(sysInfo.getUserName()); |
| | | |
| | |
| | | |
| | | /** |
| | | * @ClassName WhFormOutputCoreService |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/26 |
| | | * @Description |
| | | * @Version 1.0 |
| | | **/ |
| | | @Slf4j |
| | | @Service |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class LWhFormOutputCoreService { |
| | | |
| | | private BaseGoodsTemplateServiceImpl baseGoodsTemplateService; |
| | | private LWhGoodsService lWhGoodsService; |
| | | private CodeGeneratorService codeGeneratorService; |
| | | private LWhProcureModelService lWhProcureModelService; |
| | | // private LWhFormTransferServiceImpl lWhFormTransferService; |
| | | private LWhFormOutputService lWhFormOutputService; |
| | | private LWarehouseFlowService lWarehouseFlowService; |
| | | private LWhGoodsRecordDetailsService lWhGoodsRecordDetailsService; |
| | |
| | | LWhGoodsService lWhGoodsService, |
| | | CodeGeneratorService codeGeneratorService, |
| | | LWhProcureModelService lWhProcureModelService, |
| | | // LWhFormTransferServiceImpl lWhFormTransferService, |
| | | LWhFormOutputService lWhFormOutputService, |
| | | LWarehouseFlowService lWarehouseFlowService, |
| | | LWhGoodsRecordDetailsService lWhGoodsRecordDetailsService, |
| | |
| | | this.lWhGoodsService = lWhGoodsService; |
| | | this.codeGeneratorService = codeGeneratorService; |
| | | this.lWhProcureModelService = lWhProcureModelService; |
| | | // this.lWhFormTransferService = lWhFormTransferService; |
| | | this.lWhFormOutputService = lWhFormOutputService; |
| | | this.lWarehouseFlowService = lWarehouseFlowService; |
| | | this.lWhGoodsRecordDetailsService = lWhGoodsRecordDetailsService; |
| | |
| | | whFormOutput.setId(outWarehouseFormId); |
| | | // 此时并没有出库 |
| | | whFormOutput.setWarehouseFlowId(null); |
| | | whFormOutput.setBusinessFormCode(codeGeneratorService.createCodeByPrefix(CodeGeneratorEnum.OutPut_Warehouse.getValue(), 4)); |
| | | whFormOutput.setBusinessFormCode(codeGeneratorService.createBusinessFormCode(CodeGeneratorEnum.OutPut_Warehouse)); |
| | | //进出库流水总表 入库单ID |
| | | whFormOutput.setInWarehouseFlowId(null); |
| | | // 调拨单ID(调拨时需要) |
| | |
| | | Short buyType = buyTypeT; |
| | | Short modGoodsTransferingStatus = modGoodsTransferingStatusT; |
| | | |
| | | // 接收方仓库信息 |
| | | Long inWarehouseId = lWhFormOutput.getInWarehouseId(); |
| | | String inWarehouseName = lWhFormOutput.getInWarehouseName(); |
| | | |
| | | goodsModelNumList.forEach(itemModelInfo -> { |
| | | // 需要调拨的物品的某个型号 |
| | | Long baseGoodsModelsId = itemModelInfo.getBaseGoodsModelsId(); |
| | |
| | | |
| | | //出库时候,按 先入库的先出库,同时入库的,按价格高的先出库 |
| | | List<Long> outGoodsId = lWhGoodsService.queryOutGoodsId(outWarehouseType, outWarehouseId, baseGoodsModelsId, queryModelStatus, buyType, goodsModelNum); |
| | | lWhGoodsService.modGoodsTransfering(outGoodsId, outWarehouseType, inWarehouseId, inWarehouseName, modGoodsTransferingStatus); |
| | | lWhGoodsService.modGoodsTransfering(outGoodsId, null, null, null, modGoodsTransferingStatus); |
| | | // 批量插入 进出库流水明细[L_WH_GOODS_RECORD_DETAILS] |
| | | lWhGoodsRecordDetailsService.sameGoodsInsertMore(outGoodsId, whGoodsRecordId, (short) 0); |
| | | lWhGoodsRecordService.insert(whGoodsRecord); |
| | |
| | | |
| | | /** |
| | | * @ClassName WhFormOutputService |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/26 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | import com.walker.infrastructure.utils.NumberGenerator; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName LWhFormProcureCoreService |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/26 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | * 第一步:通过采购单ID查询采购单型号【L_WH_PROCURE_MODEL】得到商品型号以及数量 |
| | | * 第二步:记录进出库流水:L_WAREHOUSE_FLOW |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public String doProcure(Long whFormProcureId, S_user_core currentUser) { |
| | | if (whFormProcureId == null) { |
| | | return "采购单id为空"; |
| | |
| | | long lWarehouseFlowId = NumberGenerator.getLongSequenceNumberNano(); |
| | | LWarehouseFlow warehouseFlow = new LWarehouseFlow(); |
| | | warehouseFlow.setId(lWarehouseFlowId); |
| | | warehouseFlow.setWarehouseType(0); |
| | | warehouseFlow.setWarehouseId(lWhFormProcure.getWarehouseId()); |
| | | warehouseFlow.setWarehouseName(lWhFormProcure.getWarehouseName()); |
| | | warehouseFlow.setThisType(1); |
| | |
| | | |
| | | /** |
| | | * @ClassName LWhFormProcureGoodsService |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/27 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName lWhFormProcureService |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/24 |
| | | * @Description 采购单 |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName LWhFormScrappedCoreService |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/30 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName LWhFormScrappedGoodsService |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/30 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.base.core.util.LockManage; |
| | | import com.consum.model.po.LWarehouseFlow; |
| | | import com.consum.model.po.LWhFormTransfer; |
| | | import com.consum.model.po.LWhGoodsRecord; |
| | | import com.consum.model.po.LWhGoodsRecordDetails; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.NumberGenerator; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @ClassName LWhFormTransferCoreService |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/26 |
| | | * @Description |
| | | * @Version 1.0 |
| | | **/ |
| | | @Service |
| | | @Slf4j |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public class LWhFormTransferCoreService { |
| | | @Resource |
| | | private LWhFormTransferServiceImpl lWhFormTransferService; |
| | | @Resource |
| | | private LWhFormOutputCoreService lWhFormOutputCoreService; |
| | | @Resource |
| | | private GoodsBaseServiceImpl goodsBaseService; |
| | | @Resource |
| | | private LWhGoodsRecordService lWhGoodsRecordService; |
| | | @Resource |
| | | private LWhGoodsService lWhGoodsService; |
| | | @Resource |
| | | private LGoodsWhRecordServiceImpl lGoodsWhRecordService; |
| | | @Resource |
| | | private LWarehouseFlowService lWarehouseFlowService; |
| | | @Resource |
| | | private LWarehouseFlowService LWhGoodsRecordDetailsService; |
| | | |
| | | |
| | | /** |
| | | * 执行调拨出库操作 |
| | | * |
| | | * @param whFormTransferId 调拨单id |
| | | */ |
| | | public void doTransferOutPut(Long whFormTransferId, S_user_core currentUser) { |
| | |
| | | return; |
| | | } |
| | | // 出库单 出库,返回 出库单流水Id |
| | | Long outFormByTransId = lWhFormOutputCoreService.outFormByTransId(whFormTransferId, currentUser, dealTime); |
| | | Long lWarehouseFlowId = lWhFormOutputCoreService.outFormByTransId(outWarehouseFormId, currentUser, dealTime); |
| | | |
| | | // 更新调拨单 |
| | | lWhFormTransfer = new LWhFormTransfer(whFormTransferId); |
| | |
| | | lWhFormTransfer.setOutOperatorId(userId); |
| | | lWhFormTransfer.setOutOperatorName(nickName); |
| | | lWhFormTransfer.setOutputTime(dealTime); |
| | | lWhFormTransfer.setOutWarehouseFlowId(lWarehouseFlowId); |
| | | lWhFormTransferService.update(lWhFormTransfer); |
| | | |
| | | log.info("调拨单:{} 出库完成", whFormTransferId); |
| | | return; |
| | | |
| | |
| | | } |
| | | Long userId = currentUser.getId(); |
| | | String nickName = currentUser.getNick_name(); |
| | | // 出库单流水id |
| | | Long outWarehouseFlowId = lWhFormTransfer.getOutWarehouseFlowId(); |
| | | // 入库仓库类型 0机构1部门 |
| | | Integer inWarehouseType = lWhFormTransfer.getInWarehouseType(); |
| | | Long inWarehouseId = lWhFormTransfer.getInWarehouseId(); |
| | | String inWarehouseName = lWhFormTransfer.getInWarehouseName(); |
| | | |
| | | // 出库单ID |
| | | Long outWarehouseFormId = lWhFormTransfer.getOutWarehouseFormId(); |
| | | long dealTime = DateUtils.getDateTimeNumber(System.currentTimeMillis()); |
| | | |
| | | // 流水记录总表ID |
| | | long lWarehouseFlowId = lWhFormOutputCoreService.outFormByTransId(outWarehouseFormId, currentUser, dealTime); |
| | | long inWarehouseFlowId = NumberGenerator.getLongSequenceNumber(); |
| | | // 根据出库流水ID 查询 出库的物品ID |
| | | List<Long> outGoodsIds = getGoodsidByFlowId(outWarehouseFlowId); |
| | | |
| | | // 插入 进出库流水总表[L_WAREHOUSE_FLOW] |
| | | LWarehouseFlow inwarehouseFlow = new LWarehouseFlow(); |
| | | inwarehouseFlow.setId(inWarehouseFlowId); |
| | | inwarehouseFlow.setWarehouseType(inWarehouseType); |
| | | inwarehouseFlow.setWarehouseId(inWarehouseId); |
| | | inwarehouseFlow.setWarehouseName(inWarehouseName); |
| | | inwarehouseFlow.setThisType(1); |
| | | inwarehouseFlow.setBusinessType(2); |
| | | inwarehouseFlow.setBusinessFormId(whFormTransferId); |
| | | inwarehouseFlow.setOperatorId(userId); |
| | | inwarehouseFlow.setOperatorName(nickName); |
| | | inwarehouseFlow.setDealTime(dealTime); |
| | | lWarehouseFlowService.insert(inwarehouseFlow); |
| | | |
| | | LWhGoodsRecord lWhGoodsRecord = new LWhGoodsRecord(); |
| | | lWhGoodsRecord.setWarehouseFlowId(outWarehouseFlowId); |
| | | List<LWhGoodsRecord> whGoodsRecordList = lWhGoodsRecordService.select(lWhGoodsRecord); |
| | | for (LWhGoodsRecord whGoodsRecord : whGoodsRecordList) { |
| | | Long oldRecordId = whGoodsRecord.getId(); |
| | | Long baseGoodsModelsId = whGoodsRecord.getBaseGoodsModelsId(); |
| | | whGoodsRecord.setId(NumberGenerator.getLongSequenceNumber()); |
| | | whGoodsRecord.setWarehouseType(inWarehouseType); |
| | | whGoodsRecord.setWarehouseId(inWarehouseId); |
| | | whGoodsRecord.setDealTime(dealTime); |
| | | //通过LockManage获得锁 |
| | | Object warehouseModelLockObj = LockManage.acquireLock(inWarehouseType, inWarehouseId, baseGoodsModelsId); |
| | | synchronized (warehouseModelLockObj) { |
| | | // 获得锁后查询该型号的期初数量 |
| | | int goodsModelNum = lWhGoodsService.queryGoodsModelNum(inWarehouseType, inWarehouseId, baseGoodsModelsId, (short) 1, null); |
| | | whGoodsRecord.setInitialCount(goodsModelNum); |
| | | whGoodsRecord.setEndCount(goodsModelNum + whGoodsRecord.getThisCount()); |
| | | } |
| | | LWhGoodsRecordDetails lWhGoodsRecordDetails = new LWhGoodsRecordDetails(); |
| | | lWhGoodsRecordDetails.setWhGoodsRecordId(oldRecordId); |
| | | List<LWhGoodsRecordDetails> goodsRecordDetailsList = LWhGoodsRecordDetailsService.select(lWhGoodsRecordDetails); |
| | | for (LWhGoodsRecordDetails whGoodsRecordDetails : goodsRecordDetailsList) { |
| | | whGoodsRecordDetails.setId(NumberGenerator.getLongSequenceNumber()); |
| | | whGoodsRecordDetails.setThisType(1); |
| | | } |
| | | LWhGoodsRecordDetailsService.insertBatch(goodsRecordDetailsList); |
| | | } |
| | | lWhGoodsRecordService.insertBatch(whGoodsRecordList); |
| | | |
| | | // 库存物品详情(L_WH_GOODS)中 状态设置为1 |
| | | lWhGoodsService.modGoodsTransfering(outGoodsIds, inWarehouseType, inWarehouseId, inWarehouseName, (short) 1); |
| | | //将保管仓库信息更新到 物品仓库保管记录【L_GOODS_WH_RECORD】 |
| | | lGoodsWhRecordService.insertNewRecord(outGoodsIds, inWarehouseFlowId, dealTime); |
| | | |
| | | // 更新调拨单 |
| | | lWhFormTransfer = new LWhFormTransfer(whFormTransferId); |
| | | lWhFormTransfer.setInWarehouseFormId(lWarehouseFlowId); |
| | | lWhFormTransfer.setInWarehouseFormId(inWarehouseFlowId); |
| | | lWhFormTransfer.setStates(2); |
| | | lWhFormTransfer.setInOperatorId(userId); |
| | | lWhFormTransfer.setInOperatorName(nickName); |
| | | lWhFormTransfer.setInTime(dealTime); |
| | | lWhFormTransferService.update(lWhFormTransfer); |
| | | |
| | | log.info("调拨单:{} 入库完成", whFormTransferId); |
| | | return; |
| | | } |
| | | |
| | | |
| | | private static String GET_GOODSID_BY_FLOWID = "SELECT goods.id FROM L_WH_GOODS_RECORD gr LEFT JOIN L_WH_GOODS_RECORD_DETAILS grd ON gr.id=grd.WH_GOODS_RECORD_ID LEFT JOIN L_WH_GOODS goods ON goods.id=grd.WH_GOODS_ID WHERE 1=1"; |
| | | |
| | | /** |
| | | * 根据出库流水ID 查询 出库的物品ID |
| | | * |
| | | * @param lWarehouseFlowId |
| | | */ |
| | | private List<Long> getGoodsidByFlowId(long lWarehouseFlowId) { |
| | | StringBuilder sql = new StringBuilder(GET_GOODSID_BY_FLOWID); |
| | | Map<String, Object> paramts = new HashMap<>(); |
| | | sql.append(" and gr.WAREHOUSE_FLOW_ID =:lWarehouseFlowId"); |
| | | paramts.put("lWarehouseFlowId", lWarehouseFlowId); |
| | | List<Map<String, Object>> outGoods = goodsBaseService.select(sql.toString(), paramts); |
| | | if (CollectionUtils.isEmpty(outGoods)) { |
| | | return null; |
| | | } |
| | | List<Long> whGoodsIds = outGoods.stream().map(map -> (Long) map.get("id")).collect(Collectors.toList()); |
| | | return whGoodsIds; |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * @ClassName LWhGoodsRecordDetailsService |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/31 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName LWhGoodsRecordService |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/27 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | @Service |
| | | public class LWhGoodsRecordService extends BaseServiceImpl { |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | /** |
| | | * @ClassName LWhGoodsService |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/24 |
| | | * @Description |
| | | * @Version 1.0 |
| | |
| | | |
| | | /** |
| | | * @ClassName LWhProcureModelService |
| | | * @Author cy |
| | | |
| | | * @Date 2023/10/24 |
| | | * @Description |
| | | * @Version 1.0 |
New file |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @ClassName LWhProcureModelUserRecordServiceImpl |
| | | |
| | | * @Date 2023/11/2 |
| | | * @Description |
| | | * @Version 1.0 |
| | | **/ |
| | | @Service |
| | | public class LWhProcureModelUserRecordServiceImpl extends BaseServiceImpl { |
| | | |
| | | } |
| | |
| | | // |
| | | ///** |
| | | // * @ClassName RangeMergeUtil |
| | | // * @Author cy |
| | | // |
| | | // * @Date 2023/9/25 |
| | | // * @Description |
| | | // * @Version 1.0 |
| | |
| | | @JsonIgnore |
| | | protected boolean isset_inWarehouseFormId = false; |
| | | |
| | | private Long inWarehouseFlowId = null; |
| | | @JsonIgnore |
| | | protected boolean isset_inWarehouseFlowId = false; |
| | | |
| | | private Long outWarehouseFlowId = null; |
| | | @JsonIgnore |
| | | protected boolean isset_outWarehouseFlowId = false; |
| | | |
| | | private Long outWarehouseFormId = null; |
| | | @JsonIgnore |
| | | protected boolean isset_outWarehouseFormId = false; |
| | |
| | | @JsonIgnore |
| | | public boolean isEmptyInWarehouseFormId() { |
| | | return this.inWarehouseFormId == null; |
| | | } |
| | | |
| | | public Long getInWarehouseFlowId() { |
| | | return this.inWarehouseFlowId; |
| | | } |
| | | |
| | | public void setInWarehouseFlowId(Long inWarehouseFlowId) { |
| | | this.inWarehouseFlowId = inWarehouseFlowId; |
| | | this.isset_inWarehouseFlowId = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyInWarehouseFlowId() { |
| | | return this.inWarehouseFlowId == null; |
| | | } |
| | | |
| | | public Long getOutWarehouseFlowId() { |
| | | return this.outWarehouseFlowId; |
| | | } |
| | | |
| | | public void setOutWarehouseFlowId(Long outWarehouseFlowId) { |
| | | this.outWarehouseFlowId = outWarehouseFlowId; |
| | | this.isset_outWarehouseFlowId = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyOutWarehouseFlowId() { |
| | | return this.outWarehouseFlowId == null; |
| | | } |
| | | |
| | | public Long getOutWarehouseFormId() { |
| | |
| | | return new StringBuilder() |
| | | .append("id=").append(this.id) |
| | | .append("inWarehouseFormId=").append(this.inWarehouseFormId) |
| | | .append("inWarehouseFlowId=").append(this.inWarehouseFlowId) |
| | | .append("outWarehouseFlowId=").append(this.outWarehouseFlowId) |
| | | .append("outWarehouseFormId=").append(this.outWarehouseFormId) |
| | | .append("businessType=").append(this.businessType) |
| | | .append("businessFormCode=").append(this.businessFormCode) |
| | |
| | | if (this.isset_inWarehouseFormId) { |
| | | l_wh_form_transfer.setInWarehouseFormId(this.getInWarehouseFormId()); |
| | | } |
| | | if (this.isset_inWarehouseFlowId) { |
| | | l_wh_form_transfer.setInWarehouseFlowId(this.getInWarehouseFlowId()); |
| | | } |
| | | if (this.isset_outWarehouseFlowId) { |
| | | l_wh_form_transfer.setOutWarehouseFlowId(this.getOutWarehouseFlowId()); |
| | | } |
| | | if (this.isset_outWarehouseFormId) { |
| | | l_wh_form_transfer.setOutWarehouseFormId(this.getOutWarehouseFormId()); |
| | | } |
| | |
| | | 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 InWarehouseFormId = "in_warehouse_form_id"; |
| | | public static final String InWarehouseFlowId = "in_warehouse_flow_id"; |
| | | public static final String OutWarehouseFlowId = "out_warehouse_flow_id"; |
| | | public static final String OutWarehouseFormId = "out_warehouse_form_id"; |
| | | public static final String BusinessType = "business_type"; |
| | | public static final String BusinessFormCode = "business_form_code"; |
| | |
| | | //普通属性 |
| | | if (lWhFormTransfer.isset_inWarehouseFormId) { |
| | | this.setInWarehouseFormId(lWhFormTransfer.getInWarehouseFormId()); |
| | | } |
| | | if (lWhFormTransfer.isset_inWarehouseFlowId) { |
| | | this.setInWarehouseFlowId(lWhFormTransfer.getInWarehouseFlowId()); |
| | | } |
| | | if (lWhFormTransfer.isset_outWarehouseFlowId) { |
| | | this.setOutWarehouseFlowId(lWhFormTransfer.getOutWarehouseFlowId()); |
| | | } |
| | | if (lWhFormTransfer.isset_outWarehouseFormId) { |
| | | this.setOutWarehouseFormId(lWhFormTransfer.getOutWarehouseFormId()); |
| | |
| | | InsertBuilder ib = new InsertBuilder(this.getTableName_()); |
| | | ib.set(Id, this.getId()); |
| | | ib.set(InWarehouseFormId, this.getInWarehouseFormId(), this.isset_inWarehouseFormId); |
| | | ib.set(InWarehouseFlowId, this.getInWarehouseFlowId(), this.isset_inWarehouseFlowId); |
| | | ib.set(OutWarehouseFlowId, this.getOutWarehouseFlowId(), this.isset_outWarehouseFlowId); |
| | | ib.set(OutWarehouseFormId, this.getOutWarehouseFormId(), this.isset_outWarehouseFormId); |
| | | ib.set(BusinessType, this.getBusinessType(), this.isset_businessType); |
| | | ib.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); |
| | |
| | | public SqlAndParameters<Map<String, Object>> getUpdateSql_() { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(InWarehouseFormId, this.getInWarehouseFormId(), this.isset_inWarehouseFormId); |
| | | ub.set(InWarehouseFlowId, this.getInWarehouseFlowId(), this.isset_inWarehouseFlowId); |
| | | ub.set(OutWarehouseFlowId, this.getOutWarehouseFlowId(), this.isset_outWarehouseFlowId); |
| | | ub.set(OutWarehouseFormId, this.getOutWarehouseFormId(), this.isset_outWarehouseFormId); |
| | | ub.set(BusinessType, this.getBusinessType(), this.isset_businessType); |
| | | ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); |
| | |
| | | public SqlAndParameters<Map<String, Object>> getUpdateSql_(String where, Map<String, Object> parameters) { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(InWarehouseFormId, this.getInWarehouseFormId(), this.isset_inWarehouseFormId); |
| | | ub.set(InWarehouseFlowId, this.getInWarehouseFlowId(), this.isset_inWarehouseFlowId); |
| | | ub.set(OutWarehouseFlowId, this.getOutWarehouseFlowId(), this.isset_outWarehouseFlowId); |
| | | ub.set(OutWarehouseFormId, this.getOutWarehouseFormId(), this.isset_outWarehouseFormId); |
| | | ub.set(BusinessType, this.getBusinessType(), this.isset_businessType); |
| | | ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); |
| | |
| | | public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(InWarehouseFormId, this.getInWarehouseFormId(), this.isset_inWarehouseFormId); |
| | | ub.set(InWarehouseFlowId, this.getInWarehouseFlowId(), this.isset_inWarehouseFlowId); |
| | | ub.set(OutWarehouseFlowId, this.getOutWarehouseFlowId(), this.isset_outWarehouseFlowId); |
| | | ub.set(OutWarehouseFormId, this.getOutWarehouseFormId(), this.isset_outWarehouseFormId); |
| | | ub.set(BusinessType, this.getBusinessType(), this.isset_businessType); |
| | | ub.set(BusinessFormCode, this.getBusinessFormCode(), this.isset_businessFormCode); |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, in_warehouse_form_id, out_warehouse_form_id, business_type, business_form_code, in_warehouse_type, in_warehouse_id, in_warehouse_name, out_warehouse_type, out_warehouse_id, out_warehouse_name, in_agency_id, in_agency_name, out_agency_id, out_agency_name, operator_id, operator_name, create_time, states, in_operator_id, in_operator_name, in_time, out_operator_id, out_operator_name, output_time, beiz1, beiz2, beiz3, procure_doc from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>("select id, in_warehouse_form_id, in_warehouse_flow_id, out_warehouse_flow_id, out_warehouse_form_id, business_type, business_form_code, in_warehouse_type, in_warehouse_id, in_warehouse_name, out_warehouse_type, out_warehouse_id, out_warehouse_name, in_agency_id, in_agency_name, out_agency_id, out_agency_name, operator_id, operator_name, create_time, states, in_operator_id, in_operator_name, in_time, out_operator_id, out_operator_name, output_time, beiz1, beiz2, beiz3, procure_doc from " + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getSelectSql_(String where, Object[] parameters) { |
| | | return new SqlAndParameters<>("select id, in_warehouse_form_id, out_warehouse_form_id, business_type, business_form_code, in_warehouse_type, in_warehouse_id, in_warehouse_name, out_warehouse_type, out_warehouse_id, out_warehouse_name, in_agency_id, in_agency_name, out_agency_id, out_agency_name, operator_id, operator_name, create_time, states, in_operator_id, in_operator_name, in_time, out_operator_id, out_operator_name, output_time, beiz1, beiz2, beiz3, procure_doc from " + this.getTableName_() + " " + where, parameters); |
| | | return new SqlAndParameters<>("select id, in_warehouse_form_id, in_warehouse_flow_id, out_warehouse_flow_id, out_warehouse_form_id, business_type, business_form_code, in_warehouse_type, in_warehouse_id, in_warehouse_name, out_warehouse_type, out_warehouse_id, out_warehouse_name, in_agency_id, in_agency_name, out_agency_id, out_agency_name, operator_id, operator_name, create_time, states, in_operator_id, in_operator_name, in_time, out_operator_id, out_operator_name, output_time, beiz1, beiz2, beiz3, procure_doc from " + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | |
| | | l_wh_form_transfer.setInWarehouseFormId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhFormTransfer_mapper.InWarehouseFlowId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | l_wh_form_transfer.setInWarehouseFlowId(null); |
| | | } else { |
| | | l_wh_form_transfer.setInWarehouseFlowId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhFormTransfer_mapper.OutWarehouseFlowId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | l_wh_form_transfer.setOutWarehouseFlowId(null); |
| | | } else { |
| | | l_wh_form_transfer.setOutWarehouseFlowId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhFormTransfer_mapper.OutWarehouseFormId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
New file |
| | |
| | | |
| | | package com.consum.model.po; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonAutoDetect; |
| | | import com.fasterxml.jackson.annotation.JsonIgnore; |
| | | import com.walker.jdbc.BasePo; |
| | | |
| | | /** |
| | | * 表名:L_WH_PROCURE_MODEL_USER_RECORD * |
| | | * @author genrator |
| | | */ |
| | | @JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY) |
| | | public class LWhProcureModelUserRecord extends BasePo<LWhProcureModelUserRecord> { |
| | | // 序列化版本号 |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | // 主键 |
| | | private Long id = null; |
| | | @JsonIgnore |
| | | protected boolean isset_id = false; |
| | | |
| | | // 属性列表 |
| | | private Long transBusinessId = null; |
| | | @JsonIgnore |
| | | protected boolean isset_transBusinessId = false; |
| | | |
| | | private Long operatorId = null; |
| | | @JsonIgnore |
| | | protected boolean isset_operatorId = false; |
| | | |
| | | private String operatorName = null; |
| | | @JsonIgnore |
| | | protected boolean isset_operatorName = false; |
| | | |
| | | private Long dealTime = null; |
| | | @JsonIgnore |
| | | protected boolean isset_dealTime = false; |
| | | |
| | | /** |
| | | * 默认构造函数 |
| | | */ |
| | | public LWhProcureModelUserRecord() { |
| | | } |
| | | |
| | | /** |
| | | * 根据主键构造对象 |
| | | */ |
| | | public LWhProcureModelUserRecord(Long id) { |
| | | this.setId(id); |
| | | } |
| | | |
| | | /** |
| | | * 设置主键值 |
| | | */ |
| | | @Override |
| | | public void setPkValue(Object value) { |
| | | this.setId((Long) value); |
| | | } |
| | | |
| | | public Long getId() { |
| | | return this.id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | this.isset_id = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyId() { |
| | | return this.id == null; |
| | | } |
| | | |
| | | public Long getTransBusinessId() { |
| | | return this.transBusinessId; |
| | | } |
| | | |
| | | public void setTransBusinessId(Long transBusinessId) { |
| | | this.transBusinessId = transBusinessId; |
| | | this.isset_transBusinessId = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyTransBusinessId() { |
| | | return this.transBusinessId == null; |
| | | } |
| | | |
| | | public Long getOperatorId() { |
| | | return this.operatorId; |
| | | } |
| | | |
| | | public void setOperatorId(Long operatorId) { |
| | | this.operatorId = operatorId; |
| | | this.isset_operatorId = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyOperatorId() { |
| | | return this.operatorId == null; |
| | | } |
| | | |
| | | public String getOperatorName() { |
| | | return this.operatorName; |
| | | } |
| | | |
| | | public void setOperatorName(String operatorName) { |
| | | this.operatorName = operatorName; |
| | | this.isset_operatorName = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyOperatorName() { |
| | | return this.operatorName == null || this.operatorName.length() == 0; |
| | | } |
| | | |
| | | public Long getDealTime() { |
| | | return this.dealTime; |
| | | } |
| | | |
| | | public void setDealTime(Long dealTime) { |
| | | this.dealTime = dealTime; |
| | | this.isset_dealTime = true; |
| | | } |
| | | |
| | | @JsonIgnore |
| | | public boolean isEmptyDealTime() { |
| | | return this.dealTime == null; |
| | | } |
| | | |
| | | /** |
| | | * 重写 toString() 方法 |
| | | */ |
| | | @Override |
| | | public String toString() { |
| | | return new StringBuilder() |
| | | .append("id=").append(this.id) |
| | | .append("transBusinessId=").append(this.transBusinessId) |
| | | .append("operatorId=").append(this.operatorId) |
| | | .append("operatorName=").append(this.operatorName) |
| | | .append("dealTime=").append(this.dealTime) |
| | | .toString(); |
| | | } |
| | | |
| | | /** |
| | | * 克隆 |
| | | */ |
| | | public LWhProcureModelUserRecord $clone() { |
| | | LWhProcureModelUserRecord l_wh_procure_model_user_record = new LWhProcureModelUserRecord(); |
| | | |
| | | // 数据库名称 |
| | | //l_wh_procure_model_user_record.setDatabaseName_(this.getDatabaseName_()); |
| | | |
| | | // 主键 |
| | | if (this.isset_id) { |
| | | l_wh_procure_model_user_record.setId(this.getId()); |
| | | } |
| | | // 普通属性 |
| | | if (this.isset_transBusinessId) { |
| | | l_wh_procure_model_user_record.setTransBusinessId(this.getTransBusinessId()); |
| | | } |
| | | if (this.isset_operatorId) { |
| | | l_wh_procure_model_user_record.setOperatorId(this.getOperatorId()); |
| | | } |
| | | if (this.isset_operatorName) { |
| | | l_wh_procure_model_user_record.setOperatorName(this.getOperatorName()); |
| | | } |
| | | if (this.isset_dealTime) { |
| | | l_wh_procure_model_user_record.setDealTime(this.getDealTime()); |
| | | } |
| | | return l_wh_procure_model_user_record; |
| | | } |
| | | } |
New file |
| | |
| | | package com.consum.model.po; |
| | | |
| | | import com.walker.jdbc.BaseMapper; |
| | | import com.walker.jdbc.ResultSetUtils; |
| | | import com.walker.jdbc.SqlAndParameters; |
| | | import com.walker.jdbc.sqlgen.DeleteBuilder; |
| | | 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; |
| | | import java.sql.SQLException; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 表名:L_WH_PROCURE_MODEL_USER_RECORD * |
| | | * @author genrator |
| | | */ |
| | | public class LWhProcureModelUserRecord_mapper extends LWhProcureModelUserRecord implements BaseMapper<LWhProcureModelUserRecord> { |
| | | // 序列化版本号 |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | public static final RowMapper<LWhProcureModelUserRecord> ROW_MAPPER = new LWhProcureModelUserRecordRowMapper(); |
| | | |
| | | // 主键 |
| | | public static final String Id = "id"; |
| | | // 普通属性 |
| | | public static final String TransBusinessId = "trans_business_id"; |
| | | public static final String OperatorId = "operator_id"; |
| | | public static final String OperatorName = "operator_name"; |
| | | public static final String DealTime = "deal_time"; |
| | | |
| | | /** |
| | | * 默认构造函数 |
| | | */ |
| | | public LWhProcureModelUserRecord_mapper(LWhProcureModelUserRecord lWhProcureModelUserRecord) { |
| | | if (lWhProcureModelUserRecord == null) { |
| | | throw new IllegalArgumentException("po参数不允许为空!"); |
| | | } |
| | | //主键 |
| | | if (lWhProcureModelUserRecord.isset_id) { |
| | | this.setId(lWhProcureModelUserRecord.getId()); |
| | | } |
| | | //普通属性 |
| | | if (lWhProcureModelUserRecord.isset_transBusinessId) { |
| | | this.setTransBusinessId(lWhProcureModelUserRecord.getTransBusinessId()); |
| | | } |
| | | if (lWhProcureModelUserRecord.isset_operatorId) { |
| | | this.setOperatorId(lWhProcureModelUserRecord.getOperatorId()); |
| | | } |
| | | if (lWhProcureModelUserRecord.isset_operatorName) { |
| | | this.setOperatorName(lWhProcureModelUserRecord.getOperatorName()); |
| | | } |
| | | if (lWhProcureModelUserRecord.isset_dealTime) { |
| | | this.setDealTime(lWhProcureModelUserRecord.getDealTime()); |
| | | } |
| | | // 去掉,2022-09-07 |
| | | // this.setDatabaseName_(l_wh_procure_model_user_record.getDatabaseName_()); |
| | | } |
| | | |
| | | /** |
| | | * 获取表名 |
| | | */ |
| | | @Override |
| | | public String getTableName_() { |
| | | String tableName = "l_wh_procure_model_user_record"; |
| | | /** |
| | | if (StringUtils.isNotEmpty(this.getDatabaseName_())) { |
| | | return this.getDatabaseName_() + "." + tableName; |
| | | } else { |
| | | return tableName; |
| | | } |
| | | */ |
| | | return tableName; |
| | | } |
| | | |
| | | /** |
| | | * 获取主键名称 |
| | | */ |
| | | @Override |
| | | public String getPkName_() { |
| | | return Id; |
| | | } |
| | | |
| | | /** |
| | | * 获取主键值 |
| | | */ |
| | | @Override |
| | | public Object getPkValue_() { |
| | | return this.getId(); |
| | | } |
| | | |
| | | /** |
| | | * 获取插入语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getInsertSql_() { |
| | | InsertBuilder ib = new InsertBuilder(this.getTableName_()); |
| | | ib.set(Id, this.getId()); |
| | | ib.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); |
| | | ib.set(OperatorId, this.getOperatorId(), this.isset_operatorId); |
| | | ib.set(OperatorName, this.getOperatorName(), this.isset_operatorName); |
| | | ib.set(DealTime, this.getDealTime(), this.isset_dealTime); |
| | | return ib.genMapSql(); |
| | | } |
| | | |
| | | /** |
| | | * 获取更新语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getUpdateSql_() { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); |
| | | ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId); |
| | | ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName); |
| | | ub.set(DealTime, this.getDealTime(), this.isset_dealTime); |
| | | ub.where(this.getPkName_(), this.getPkValue_()); |
| | | return ub.genMapSql(); |
| | | } |
| | | |
| | | /** |
| | | * 获取更新语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getUpdateSql_(String where, Map<String, Object> parameters) { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); |
| | | ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId); |
| | | ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName); |
| | | ub.set(DealTime, this.getDealTime(), this.isset_dealTime); |
| | | return ub.genMapSql(where, parameters); |
| | | } |
| | | |
| | | /** |
| | | * 获取更新语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getUpdateSql_(String where, Object[] parameters) { |
| | | UpdateBuilder ub = new UpdateBuilder(this.getTableName_()); |
| | | ub.set(TransBusinessId, this.getTransBusinessId(), this.isset_transBusinessId); |
| | | ub.set(OperatorId, this.getOperatorId(), this.isset_operatorId); |
| | | ub.set(OperatorName, this.getOperatorName(), this.isset_operatorName); |
| | | ub.set(DealTime, this.getDealTime(), this.isset_dealTime); |
| | | return ub.genArraySql(where, parameters); |
| | | } |
| | | |
| | | /** |
| | | * 获取删除语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getDeleteSql_() { |
| | | DeleteBuilder db = new DeleteBuilder(this.getTableName_()); |
| | | db.where(this.getPkName_(), this.getPkValue_()); |
| | | return db.genMapSql(); |
| | | } |
| | | |
| | | /** |
| | | * 获取删除语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getDeleteSql_(String where, Map<String, Object> parameters) { |
| | | DeleteBuilder db = new DeleteBuilder(this.getTableName_()); |
| | | return db.genMapSql(where, parameters); |
| | | } |
| | | |
| | | /** |
| | | * 获取删除语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Object[]> getDeleteSql_(String where, Object[] parameters) { |
| | | DeleteBuilder db = new DeleteBuilder(this.getTableName_()); |
| | | return db.genArraySql(where, parameters); |
| | | } |
| | | |
| | | /** |
| | | * 获取单行查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSingleSql_() { |
| | | SelectBuilder sb = new SelectBuilder(this.getTableName_()); |
| | | sb.where(this.getPkName_(), this.getPkValue_()); |
| | | return sb.genMapSql(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取查询语句和参数 |
| | | */ |
| | | @Override |
| | | public SqlAndParameters<Map<String, Object>> getSelectSql_(String where, Map<String, Object> parameters) { |
| | | return new SqlAndParameters<>("select id, trans_business_id, 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, trans_business_id, operator_id, operator_name, deal_time from " + this.getTableName_() + " " + where, parameters); |
| | | } |
| | | |
| | | /** |
| | | * 将resultset的一行转化为po |
| | | */ |
| | | @Override |
| | | public LWhProcureModelUserRecord mapRow(ResultSet rs, int i) throws SQLException { |
| | | return ROW_MAPPER.mapRow(rs, i); |
| | | } |
| | | |
| | | /** |
| | | * 克隆 |
| | | */ |
| | | public LWhProcureModelUserRecord toLWhProcureModelUserRecord() { |
| | | return super.$clone(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * l_wh_procure_model_user_record RowMapper |
| | | * |
| | | * @author genrator |
| | | */ |
| | | class LWhProcureModelUserRecordRowMapper implements RowMapper<LWhProcureModelUserRecord> { |
| | | |
| | | @Override |
| | | public LWhProcureModelUserRecord mapRow(ResultSet rs, int i) throws SQLException { |
| | | ResultSetUtils resultSetUtils = new ResultSetUtils(); |
| | | LWhProcureModelUserRecord l_wh_procure_model_user_record = new LWhProcureModelUserRecord(); |
| | | Integer columnIndex; |
| | | //主键 |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhProcureModelUserRecord_mapper.Id); |
| | | if (columnIndex > 0) { |
| | | l_wh_procure_model_user_record.setId(rs.getLong(columnIndex)); |
| | | } |
| | | //普通属性 |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhProcureModelUserRecord_mapper.TransBusinessId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | l_wh_procure_model_user_record.setTransBusinessId(null); |
| | | } else { |
| | | l_wh_procure_model_user_record.setTransBusinessId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhProcureModelUserRecord_mapper.OperatorId); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | l_wh_procure_model_user_record.setOperatorId(null); |
| | | } else { |
| | | l_wh_procure_model_user_record.setOperatorId(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhProcureModelUserRecord_mapper.OperatorName); |
| | | if (columnIndex > 0) { |
| | | l_wh_procure_model_user_record.setOperatorName(rs.getString(columnIndex)); |
| | | } |
| | | columnIndex = resultSetUtils.findColumn(rs, LWhProcureModelUserRecord_mapper.DealTime); |
| | | if (columnIndex > 0) { |
| | | if (rs.getBigDecimal(columnIndex) == null) { |
| | | l_wh_procure_model_user_record.setDealTime(null); |
| | | } else { |
| | | l_wh_procure_model_user_record.setDealTime(rs.getLong(columnIndex)); |
| | | } |
| | | } |
| | | return l_wh_procure_model_user_record; |
| | | } |
| | | } |