File was renamed from consum-base/src/main/java/com/consum/base/service/LWhFormOutputServiceImpl.java |
| | |
| | | package com.consum.base.service; |
| | | package com.consum.base.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | |
| | | |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.context.annotation.Lazy; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | |
| | | import com.consum.base.core.CodeGeneratorService; |
| | | import com.consum.base.core.WhBusinessEnum; |
| | | import com.consum.base.core.param.BaseWarehouseParam1; |
| | | import com.consum.base.core.type.GoodsModelType; |
| | | import com.consum.base.core.type.OutPutStatesType; |
| | | import com.consum.base.core.utils.CurrencyUtil; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.core.utils.MapUtils; |
| | |
| | | import com.consum.base.pojo.LWhFormOutputParam; |
| | | import com.consum.base.pojo.excel.OutputExcelTemplate; |
| | | import com.consum.base.pojo.query.LWhFormOutputQry; |
| | | import com.consum.base.service.BaseGoodsModelsService; |
| | | import com.consum.base.service.BaseWarehouseService; |
| | | import com.consum.base.service.LWhFormOutputCoreService; |
| | | import com.consum.base.service.LWhFormOutputService; |
| | | import com.consum.base.service.LWhGoodsService; |
| | | import com.consum.base.service.LWhProcureModelService; |
| | | import com.consum.model.po.BaseGoodsModels; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormOutput; |
| | | import com.consum.model.po.LWhProcureModel; |
| | | import com.consum.model.po.WhFormOutput; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class LWhFormOutputServiceImpl extends BaseServiceImpl { |
| | | public class LWhFormOutputServiceImpl extends BaseServiceImpl implements LWhFormOutputService { |
| | | |
| | | @Autowired |
| | | private CodeGeneratorService codeGeneratorService; |
| | |
| | | @Autowired |
| | | private LWhProcureModelService lWhProcureModelService; |
| | | @Autowired |
| | | @Lazy |
| | | private LWhFormOutputCoreService lWhFormOutputCoreService; |
| | | @Autowired |
| | | private BaseGoodsModelsService baseGoodsModelsService; |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/27 |
| | | */ |
| | | @Override |
| | | public int add(LWhFormOutputParam param, S_user_core currentUser, FinSysTenantUser sysInfo) { |
| | | // 1.新增出库单记录 |
| | | LWhFormOutput lWhFormOutput = new LWhFormOutput(); |
| | |
| | | lWhFormOutput.setOperatorId(sysInfo.getId()); |
| | | lWhFormOutput.setOperatorName(sysInfo.getUserName()); |
| | | lWhFormOutput.setDealTime(param.getDealTime()); |
| | | lWhFormOutput.setStates(1); |
| | | lWhFormOutput.setStates(OutPutStatesType.OUT_PENDING.getValue()); |
| | | lWhFormOutput.setOutputDoc(param.getProcureDoc()); |
| | | int flag1 = this.insert(lWhFormOutput); |
| | | if (flag1 == 0) { |
| | |
| | | for (LWFormsOutputGoodsModelParam model : models) { |
| | | LWhProcureModel lWhProcureModel = new LWhProcureModel(); |
| | | lWhProcureModel.setId(IdUtil.generateId()); |
| | | lWhProcureModel.setBusinessType(3); |
| | | lWhProcureModel.setBusinessType(GoodsModelType.OUT_PUT.getValue()); |
| | | lWhProcureModel.setBusinessId(lWhFormOutputId); |
| | | lWhProcureModel.setBaseGoodsModelsId(model.getBaseGoodsModelsId()); |
| | | // 根据型号id查询型号 |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/30 |
| | | */ |
| | | @Override |
| | | public GenericPager queryFormOutputList(LWhFormOutputQry param) { |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | StringBuilder sql = new StringBuilder(QUERY_FORM_OUTPUT_LIST); |
| | |
| | | return genericPager; |
| | | } |
| | | |
| | | @Override |
| | | public GenericPager<Map<String, Object>> queryFormOutputDetailList(LWhFormOutputQry param) { |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | StringBuilder sql = |
| | |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public List<OutputExcelTemplate> getExportList(Long id) { |
| | | String sql = "SELECT\n" + "\tfo.BUSINESS_FORM_CODE,\n" + "\tfo.AGENCY_NAME tenantName,\n" |
| | | + "\tGOODS_NAME templateName,\n" + "\tpm.BASE_GOODS_MODELS_NAME baseModelName,\n" + "\tcounts num,\n" |
| | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 通过调拨单查询出库单id |
| | | * |
| | | * @param transBusinessId |
| | | * @return |
| | | */ |
| | | private static String QUEYR_ID_BY_TRANSFERID = |
| | | "select id from L_WH_FORM_OUTPUT where TRANS_BUSINESS_ID =:transBusinessId limit 1"; |
| | | |
| | | @Override |
| | | public Long queyrIdByTransferId(Long transBusinessId) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("transBusinessId", transBusinessId); |
| | | List<WhFormOutput> whFormOutputs = select(QUEYR_ID_BY_TRANSFERID, map, new WhFormOutput()); |
| | | if (CollectionUtils.isEmpty(whFormOutputs)) { |
| | | return null; |
| | | } |
| | | return whFormOutputs.get(0).getId(); |
| | | } |
| | | |
| | | } |