| | |
| | | package com.consum.base.service.impl; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | 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.CodeGeneratorEnum; |
| | | import com.consum.base.core.CodeGeneratorService; |
| | | import com.consum.base.core.WhBusinessEnum; |
| | | import com.consum.base.core.param.BaseWarehouseParam1; |
| | | import com.consum.base.core.service.LWhWarningCoreServiceImpl; |
| | | 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.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.consum.base.service.*; |
| | | import com.consum.model.po.*; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | |
| | | import lombok.extern.slf4j.Slf4j; |
| | | 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 javax.annotation.Resource; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description 出库单 |
| | |
| | | private LWhFormOutputCoreService lWhFormOutputCoreService; |
| | | @Autowired |
| | | private BaseGoodsModelsService baseGoodsModelsService; |
| | | |
| | | @Resource |
| | | private LWhWarningCoreServiceImpl lWhWarningCoreService; |
| | | private static String QUERY_FORM_OUTPUT_LIST = "SELECT * FROM l_wh_form_output WHERE 1 = 1"; |
| | | |
| | | /** |
| | |
| | | lWhFormOutput.setOperatorName(sysInfo.getUserName()); |
| | | lWhFormOutput.setDealTime(param.getDealTime()); |
| | | lWhFormOutput.setStates(OutPutStatesType.OUT_PENDING.getValue()); |
| | | lWhFormOutput.setOutputDoc(param.getProcureDoc()); |
| | | lWhFormOutput.setOutputDoc(param.getDoc()); |
| | | int flag1 = this.insert(lWhFormOutput); |
| | | if (flag1 == 0) { |
| | | log.error("新增出库单记录"); |
| | | return 0; |
| | | } |
| | | // 2.新增物品型号记录 |
| | | Set<Long> allChangModelList = new HashSet<>(); |
| | | List<LWFormsOutputGoodsInfoParam> goodsList = param.getGoods(); |
| | | List<LWhProcureModel> modelList = new ArrayList<>(); |
| | | for (LWFormsOutputGoodsInfoParam goods : goodsList) { |
| | |
| | | lWhProcureModel.setBusinessType(GoodsModelType.OUT_PUT.getValue()); |
| | | lWhProcureModel.setBusinessId(lWhFormOutputId); |
| | | lWhProcureModel.setBaseGoodsModelsId(model.getBaseGoodsModelsId()); |
| | | allChangModelList.add(model.getBaseGoodsModelsId()); |
| | | // 根据型号id查询型号 |
| | | BaseGoodsModels baseGoodsModels = |
| | | this.baseGoodsModelsService.get(new BaseGoodsModels(model.getBaseGoodsModelsId())); |
| | |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return 0; |
| | | } |
| | | // 4 预警 |
| | | //当库存变动时调用该方法 |
| | | // lWhWarningCoreService.updateKuCun((short) 0, warehouseId, new ArrayList<>(allChangModelList), null, DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | |
| | | |
| | | return 1; |
| | | } |