| | |
| | | import com.consum.base.pojo.response.FormTransferGoodsVO; |
| | | import com.consum.base.pojo.response.GoodsModelVO; |
| | | import com.consum.base.pojo.response.LWHFromTransferExtendVO; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.po.BaseGoodsModels; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.BaseWarehouseManager; |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormOutput; |
| | | import com.consum.model.po.LWhFormTransfer; |
| | | import com.consum.model.po.LWhGoodsRecord; |
| | | import com.consum.model.po.LWhProcureModel; |
| | | import com.consum.model.po.LWhProcureModelUser; |
| | | import com.consum.model.po.LWhProcureModelUserRecord; |
| | | import com.consum.model.vo.LWhFormOutputVo; |
| | | import com.consum.model.vo.LWhGoodsRecordVo; |
| | | import com.iplatform.model.po.S_user_core; |
| | |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description 调拨管理 |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/30 |
| | | */ |
| | | public int add(LWhFormTransferParam param, FinSysTenantUser sysInfo) throws Exception { |
| | | public long add(LWhFormTransferParam param, FinSysTenantUser sysInfo) throws Exception { |
| | | //1.新增调拨单记录 |
| | | LWhFormTransfer lWhFormTransfer = new LWhFormTransfer(); |
| | | //调拨单id |
| | |
| | | // TODO 枚举字典 |
| | | lWhFormTransfer.setBusinessType(businessType); |
| | | CodeGeneratorEnum codeGeneratorEnum = null; |
| | | if (businessType == 0){ |
| | | if (businessType == 0) { |
| | | codeGeneratorEnum = CodeGeneratorEnum.Transfer; |
| | | } else if (businessType == 1){ |
| | | } else if (businessType == 1) { |
| | | codeGeneratorEnum = CodeGeneratorEnum.Distribute; |
| | | } else if (businessType == 2){ |
| | | } else if (businessType == 2) { |
| | | codeGeneratorEnum = CodeGeneratorEnum.GOBACK; |
| | | } |
| | | |
| | |
| | | FinSysTenant finSysTenant = finSysTenantService.get(new FinSysTenant(param.getOutAgencyId())); |
| | | if (finSysTenant == null) { |
| | | log.error("调拨机构不存在"); |
| | | return 0; |
| | | } |
| | | lWhFormTransfer.setOutAgencyId(finSysTenant.getId()); |
| | | lWhFormTransfer.setOutAgencyName(finSysTenant.getName()); |
| | |
| | | int flag1 = this.insert(lWhFormTransfer); |
| | | if (flag1 == 0) { |
| | | log.error("新增调拨单失败"); |
| | | return 0; |
| | | } |
| | | |
| | | //2.新增物品型号记录 |
| | |
| | | if (procureInsertNum != procureModelUserList.size()) { |
| | | log.error("新增物品使用信息失败"); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return 0; |
| | | } |
| | | |
| | | } |
| | |
| | | if (flag2 != modelList.size()) { |
| | | log.error("新增物品型号失败"); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return 0; |
| | | } |
| | | |
| | | return 1; |
| | | return lWhFormTransferId; |
| | | } |
| | | |
| | | |
| | |
| | | if (param.getEndTime() != null) { |
| | | sql.append(" and IN_TIME <:inTimeEnd "); |
| | | paramts.put("inTimeEnd", param.getEndTime() * 1000000 + 240000); |
| | | } |
| | | //分发部门 |
| | | if (param.getInWarehouseId() != null) { |
| | | sql.append("and ft.IN_WAREHOUSE_ID = :inWarehouseId "); |
| | | paramts.put("inWarehouseId", param.getInWarehouseId()); |
| | | } |
| | | |
| | | sql.append(" ORDER BY ft.CREATE_TIME DESC"); |
| | |
| | | sql.append("AND OUT_AGENCY_ID = :OUT_AGENCY_ID "); |
| | | paramts.put("OUT_AGENCY_ID", transferQry.getOutAgencyId()); |
| | | } |
| | | |
| | | //分发部门 |
| | | if (transferQry.getInWarehouseId() != null) { |
| | | sql.append("and ft.IN_WAREHOUSE_ID = :inWarehouseId "); |
| | | paramts.put("inWarehouseId", transferQry.getInWarehouseId()); |
| | | } |
| | | //创建人 |
| | | if (StringUtils.isNotEmpty(transferQry.getOperatorName())) { |
| | | sql.append("AND ft.OPERATOR_NAME =:OPERATOR_NAME "); |