| | |
| | | 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.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.po.*; |
| | | 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 调拨管理 |
| | |
| | | // 单据类型。0仓库调拨;1部门分发;2部门物品回退 |
| | | // TODO 枚举字典 |
| | | lWhFormTransfer.setBusinessType(businessType); |
| | | CodeGeneratorEnum codeGeneratorEnum = null; |
| | | if (businessType == 0){ |
| | | codeGeneratorEnum = CodeGeneratorEnum.Transfer; |
| | | } else if (businessType == 1){ |
| | | codeGeneratorEnum = CodeGeneratorEnum.Distribute; |
| | | } else if (businessType == 2){ |
| | | codeGeneratorEnum = CodeGeneratorEnum.GOBACK; |
| | | } |
| | | |
| | | lWhFormTransfer.setBusinessFormCode(codeGeneratorService.createBusinessFormCode(CodeGeneratorEnum.Transfer)); |
| | | lWhFormTransfer.setBusinessFormCode(codeGeneratorService.createBusinessFormCode(codeGeneratorEnum)); |
| | | |
| | | Long warehouseId = param.getInWarehouseId(); |
| | | // 调拨类型单据 |
| | |
| | | //从当前登录库管人从库中出库,入到所选部门的下 |
| | | |
| | | //查询库管员信息和相关仓库 |
| | | Long id = sysInfo.getSysUserId(); |
| | | Long id = sysInfo.getId(); |
| | | BaseWarehouseManager manager = new BaseWarehouseManager(); |
| | | manager.setManagerId(id); |
| | | List<BaseWarehouseManager> managerList = baseWarehouseManagerService.select(manager); |
| | | if (CollectionUtils.isEmpty(managerList)) { |
| | | log.error("库管员不存在"); |
| | | throw new Exception("库管员不存在"); |
| | | log.error("该用户不是库管员"); |
| | | throw new Exception("该用户不是库管员"); |
| | | } |
| | | Optional<BaseWarehouseManager> first = managerList.stream().findFirst(); |
| | | if (first.isPresent()) { |
| | |
| | | } |
| | | //状态 |
| | | if (param.getStates() != null) { |
| | | sql.append(" and states =:states "); |
| | | sql.append(" and ft.states =:states "); |
| | | paramts.put("states", param.getStates()); |
| | | } |
| | | //创建人 |
| | |
| | | LWhFormTransfer lWhFormTransfer = this.get(new LWhFormTransfer(id)); |
| | | if (lWhFormTransfer != null) { |
| | | BeanUtils.copyProperties(lWhFormTransfer, result); |
| | | result.setDepartmentName(lWhFormTransfer.getInWarehouseName()); |
| | | } |
| | | |
| | | String sql = "SELECT bgt.id, CATEGORY_ID, CATEGORY_NAME, GOODS_NAME,bgt.CLASSIFICATION type " |
| | |
| | | }); |
| | | goodsModelVO.setUseInfo(departGoodsUseInfoList); |
| | | } |
| | | // TODO 部门名称 |
| | | // result.setDepartmentName(); |
| | | |
| | | } |
| | | goodsModelVOList.add(goodsModelVO); |
| | |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | StringBuilder sql = new StringBuilder( |
| | | "SELECT ft.id,ft.BUSINESS_FORM_CODE,bgt.GOODS_NAME,bgt.CLASSIFICATION type,bgm.id goodsModelId,bgm.MODEL_NAME goodsModelName,pm.COUNTS goodsCount,fst.`name` tenantName," |
| | | + "fstd.NAME departmentName,ft.OPERATOR_ID,ft.CREATE_TIME FROM l_wh_form_transfer ft " |
| | | + "ft.IN_WAREHOUSE_NAME departmentName,ft.OPERATOR_ID,ft.CREATE_TIME,ft.OPERATOR_NAME FROM l_wh_form_transfer ft " |
| | | + "inner JOIN l_wh_procure_model pm ON ft.ID = pm.BUSINESS_ID " + "inner JOIN base_goods_models bgm ON bgm.id = pm.BASE_GOODS_MODELS_ID " |
| | | + "inner JOIN base_goods_template bgt ON bgt.id = bgm.GOODS_TEMPLATES_ID " + "inner JOIN fin_sys_tenant_user fstu ON fstu.id = ft.OPERATOR_ID " |
| | | + "inner JOIN base_goods_template bgt ON bgt.id = bgm.GOODS_TEMPLATES_ID " |
| | | + "inner JOIN fin_sys_tenant_user fstu ON fstu.id = ft.OPERATOR_ID " |
| | | + "inner JOIN fin_sys_tenant_department fstd ON fstu.SYS_DEPT_ID = fstd.ID " |
| | | + "inner JOIN fin_sys_tenant fst ON fst.id = fstd.TENANT_ID where ft.BUSINESS_TYPE =1 "); |
| | | //单号 |