Merge remote-tracking branch 'origin/master'
3 文件已重命名
3个文件已添加
16个文件已修改
| | |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.pojo.BaseCategoryParam; |
| | | import com.consum.base.pojo.ProjectTreeResult; |
| | | import com.consum.base.service.BaseCategoryServiceImpl; |
| | | import com.consum.base.service.BaseCategoryService; |
| | | import com.consum.base.service.BaseGoodsTemplateServiceImpl; |
| | | import com.consum.model.po.BaseCategory; |
| | | import com.iplatform.model.po.S_user_core; |
| | |
| | | public class BaseCategoryController extends BaseController { |
| | | |
| | | @Autowired |
| | | private BaseCategoryServiceImpl baseCategoryService; |
| | | private BaseCategoryService baseCategoryService; |
| | | |
| | | @Autowired |
| | | private BaseGoodsTemplateServiceImpl baseGoodsTemplateService; |
| | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.pojo.FinSysTenantDepartmentParam; |
| | | import com.consum.base.service.FinSysTenantDepartmentServiceImpl; |
| | | import com.consum.base.service.FinSysTenantDepartmentService; |
| | | import com.consum.model.po.FinSysTenantDepartment; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.walker.db.page.GenericPager; |
| | |
| | | public class FinSysTenantDepartmentController extends BaseController { |
| | | |
| | | @Autowired |
| | | private FinSysTenantDepartmentServiceImpl departmentService; |
| | | private FinSysTenantDepartmentService departmentService; |
| | | |
| | | /** |
| | | * @Description 新增 |
| | |
| | | import com.consum.base.pojo.response.FinSysTenantUserVO; |
| | | import com.consum.base.pojo.response.FinSysTenantVO; |
| | | import com.consum.base.pojo.response.UserVO; |
| | | import com.consum.base.service.FinSysTenantDepartmentServiceImpl; |
| | | import com.consum.base.service.FinSysTenantDepartmentService; |
| | | import com.consum.base.service.FinSysTenantServiceImpl; |
| | | import com.consum.base.service.FinSysTenantUserServiceImpl; |
| | | import com.consum.model.po.FinSysTenant; |
| | |
| | | import com.iplatform.model.po.S_role; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.*; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.NumberGenerator; |
| | | import com.walker.infrastructure.utils.PhoneNumberUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.web.ResponseValue; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Field; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.HashMap; |
| | | import java.util.HashSet; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.Optional; |
| | | import java.util.Set; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | import java.io.IOException; |
| | | import java.lang.reflect.Field; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description 系统用户 |
| | |
| | | private RoleServiceImpl roleService; |
| | | |
| | | @Autowired |
| | | private FinSysTenantDepartmentServiceImpl finSysTenantDepartmentService; |
| | | private FinSysTenantDepartmentService finSysTenantDepartmentService; |
| | | |
| | | |
| | | @Autowired |
| | |
| | | import com.consum.base.pojo.response.FormInventoryGoodsVO; |
| | | import com.consum.base.pojo.response.FormInventoryVO; |
| | | import com.consum.base.service.FinSysTenantUserServiceImpl; |
| | | import com.consum.base.service.LWhFormInventoryServiceImpl; |
| | | import com.consum.base.service.LWhFormInventoryService; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormInventory; |
| | | import com.iplatform.model.po.S_user_core; |
| | |
| | | public class LWhFormInventoryController extends BaseController { |
| | | |
| | | @Autowired |
| | | private LWhFormInventoryServiceImpl lWhFormInventoryService; |
| | | private LWhFormInventoryService lWhFormInventoryService; |
| | | @Autowired |
| | | private FinSysTenantUserServiceImpl finSysTenantUserService; |
| | | |
| | |
| | | FinSysTenantUser monitorUserInfo = new FinSysTenantUser(); |
| | | monitorUserInfo.setId(param.getMonitorUserId()); |
| | | FinSysTenantUser monitorUser = finSysTenantUserService.get(monitorUserInfo); |
| | | int result = this.lWhFormInventoryService.add(param, this.getSysInfo(), operatorUser, monitorUser); |
| | | int result = lWhFormInventoryService.add(param, this.getSysInfo(), operatorUser, monitorUser); |
| | | if (result > 0) { |
| | | return ResponseValue.success(); |
| | | } |
| | |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | GenericPager<LWhFormInventory> pager = this.lWhFormInventoryService.queryList(param, sysInfo); |
| | | GenericPager<LWhFormInventory> pager = lWhFormInventoryService.queryList(param, sysInfo); |
| | | return ResponseValue.success(pager); |
| | | } |
| | | |
| | |
| | | return ResponseValue.error("参数不能为空"); |
| | | } |
| | | //通过机构查询相关的模板信息 |
| | | FormInventoryVO formInventoryVO = this.lWhFormInventoryService.queryInventBaseGoodTemplate(id); |
| | | FormInventoryVO formInventoryVO = lWhFormInventoryService.queryInventBaseGoodTemplate(id); |
| | | |
| | | // 保存后返回记录信息 |
| | | List<FormInventoryGoodsVO> result = this.lWhFormInventoryService.saveInventory(formInventoryVO, id); |
| | | FormInventoryVO result = lWhFormInventoryService.saveInventory(formInventoryVO, id); |
| | | return ResponseValue.success(result); |
| | | } |
| | | |
| | |
| | | FinSysTenantUser monitorUserInfo = new FinSysTenantUser(); |
| | | monitorUserInfo.setId(param.getMonitorUserId()); |
| | | FinSysTenantUser monitorUser = finSysTenantUserService.get(monitorUserInfo); |
| | | int result = this.lWhFormInventoryService.add(param, this.getSysInfo(), operatorUser, monitorUser); |
| | | int result = lWhFormInventoryService.add(param, this.getSysInfo(), operatorUser, monitorUser); |
| | | |
| | | if (result > 0) { |
| | | return ResponseValue.success(); |
| | |
| | | return ResponseValue.error("参数错误"); |
| | | } |
| | | |
| | | int num = this.lWhFormInventoryService.updateInventoryInfo(param, 1, null, null); |
| | | int num = lWhFormInventoryService.updateInventoryInfo(param, 1, null, null); |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("暂存失败!"); |
| | | } |
| | | |
| | |
| | | } |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | int num = this.lWhFormInventoryService.updateInventoryInfo(param, 2, currentUser, sysInfo); |
| | | int num = lWhFormInventoryService.updateInventoryInfo(param, 2, currentUser, sysInfo); |
| | | |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("盘点失败!"); |
| | | } |
| | |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | PageUtil<FormInventoryDetailVO> result = this.lWhFormInventoryService.queryPdDetailList(param, sysInfo); |
| | | PageUtil<FormInventoryDetailVO> result = lWhFormInventoryService.queryPdDetailList(param, sysInfo); |
| | | return ResponseValue.success(result); |
| | | } |
| | | |
| | |
| | | |
| | | LWhFormInventory lWhFormInventory = new LWhFormInventory(); |
| | | lWhFormInventory.setId(id); |
| | | LWhFormInventory item = this.lWhFormInventoryService.get(lWhFormInventory); |
| | | LWhFormInventory item = lWhFormInventoryService.get(lWhFormInventory); |
| | | if (Objects.isNull(item)) { |
| | | return ResponseValue.error("盘点单不存在"); |
| | | } |
| | | BeanUtils.copyProperties(item, formInventoryVO); |
| | | List<FormInventoryGoodsVO> formInventoryGoodsVOS = this.lWhFormInventoryService.selectDetailById(id); |
| | | List<FormInventoryGoodsVO> formInventoryGoodsVOS = lWhFormInventoryService.selectDetailById(id); |
| | | formInventoryVO.setFormInventoryGoodsList(formInventoryGoodsVOS); |
| | | return ResponseValue.success(formInventoryVO); |
| | | } |
| | |
| | | import com.consum.base.pojo.response.TransferInfoVO; |
| | | import com.consum.base.service.BaseWarehouseServiceImpl; |
| | | import com.consum.base.service.LWhFormTransferCoreService; |
| | | import com.consum.base.service.LWhFormTransferServiceImpl; |
| | | import com.consum.base.service.LWhFormTransferService; |
| | | import com.consum.base.service.LWhProcureModelService; |
| | | import com.consum.base.service.LWhProcureModelUserRecordServiceImpl; |
| | | import com.consum.base.service.LWhProcureModelUserServiceImpl; |
| | |
| | | public class LWhFormTransferController extends BaseController { |
| | | |
| | | @Autowired |
| | | private LWhFormTransferServiceImpl lWhFormTransferService; |
| | | private LWhFormTransferService lWhFormTransferService; |
| | | @Autowired |
| | | private LWhProcureModelService lWhProcureModelService; |
| | | @Autowired |
| | |
| | | } |
| | | |
| | | } |
| | | // TODO 使用人修改调用 |
| | | |
| | | return ResponseValue.success(); |
| | | } |
| | |
| | | return ResponseValue.success(result); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "查询部门下的分发单", notes = "查询部门下的分发单") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "agencyId", value = "机构id", required = true, dataType = "Long", paramType = "query") |
| | | }) |
| | | @GetMapping("/query/detail") |
| | | public ResponseValue queryDepartmentTransferOrder(Long agencyId) { |
| | | |
| | | TransferInfoVO transferInfoVO = new TransferInfoVO(); |
| | | |
| | | lWhFormTransferService.queryDepartmentTransferOrder(); |
| | | return ResponseValue.success(transferInfoVO); |
| | | } |
| | | |
| | | @ApiOperation(value = "查询部门下的分发单", notes = "查询部门下的分发单") |
| | | @ApiImplicitParams({ |
| | |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.WhWarning; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import org.apache.commons.collections4.CollectionUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | |
| | | /** |
| | |
| | | return; |
| | | } |
| | | List<Long> allChangModelList = baseModelIdList.stream() |
| | | .distinct() |
| | | .collect(Collectors.toList()); |
| | | .distinct() |
| | | .collect(Collectors.toList()); |
| | | baseModelIdList = allChangModelList; |
| | | |
| | | // 将数据插入库存预警【WH_WARNING】 |
| | |
| | | private String KU_CUN_NORMAL_MODEL = "update WH_WARNING set STATES=2 where WAREHOUSE_TYPE=? and BASE_WAREHOUSE_ID=?"; |
| | | |
| | | /** |
| | | * |
| | | * @param warehouseType |
| | | * @param warehouseId |
| | | * @param normalBaseModelIdList 库存正常的 |
| | |
| | | |
| | | StringBuilder sql = new StringBuilder(KU_CUN_NORMAL_MODEL); |
| | | if (!org.springframework.util.CollectionUtils.isEmpty(normalBaseModelIdList)) { |
| | | sql.append(" and BASE_GOODS_MODELS_ID in(").append( org.apache.commons.lang3.StringUtils.join(normalBaseModelIdList, ",")).append(")"); |
| | | sql.append(" and BASE_GOODS_MODELS_ID in(").append(org.apache.commons.lang3.StringUtils.join(normalBaseModelIdList, ",")).append(")"); |
| | | } |
| | | return lWhWarningService.update(sql.toString(), params.toArray()); |
| | | } |
| | |
| | | |
| | | private String baseGoodsTemplateName; |
| | | private Integer count; |
| | | private String unit; |
| | | } |
| | |
| | | @Autowired |
| | | private CodeGeneratorService codeGeneratorService; |
| | | @Autowired |
| | | private BaseCategoryServiceImpl baseCategoryService; |
| | | private BaseCategoryService baseCategoryService; |
| | | @Autowired |
| | | private BaseGoodsModelsServiceImpl baseGoodsModelsService; |
| | | |
| | |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Description 仓库管理 |
| | |
| | | @Autowired |
| | | private FinSysTenantServiceImpl finSysTenantService; |
| | | @Autowired |
| | | private FinSysTenantDepartmentServiceImpl departmentService; |
| | | @Autowired |
| | | private FinSysTenantUserServiceImpl userService; |
| | | private FinSysTenantDepartmentService departmentService; |
| | | @Autowired |
| | | private SDictDataServiceImpl sDictDataService; |
| | | |
| | |
| | | import com.consum.base.pojo.LDeptFormScrappedParam; |
| | | import com.consum.base.pojo.query.LDeptFormScrappedQry; |
| | | import com.consum.base.pojo.response.DepFormScrappedExtendVo; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.po.BaseCategory; |
| | | import com.consum.model.po.DepFormScrapped; |
| | | import com.consum.model.po.DepFormScrappedGoods; |
| | | import com.consum.model.po.DepFormScrappedModel; |
| | | import com.consum.model.po.FinSysTenantDepartment; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormTransfer; |
| | | import com.consum.model.po.SDictData; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import com.walker.web.ResponseValue; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * @ClassName DepFormScrappedServiceImpl |
| | |
| | | @Resource |
| | | private CodeGeneratorService codeGeneratorService; |
| | | @Resource |
| | | private FinSysTenantDepartmentServiceImpl departmentService; |
| | | private FinSysTenantDepartmentService departmentService; |
| | | @Resource |
| | | private LWhFormTransferServiceImpl lWhFormTransferService; |
| | | private LWhFormTransferService lWhFormTransferService; |
| | | @Resource |
| | | private BaseCategoryServiceImpl baseCategoryService; |
| | | private BaseCategoryService baseCategoryService; |
| | | @Resource |
| | | private SDictDataServiceImpl sDictDataService; |
| | | @Resource |
| | |
| | | lDeptFormScrapped.setDepartmentId(sysInfo.getSysDeptId()); |
| | | lDeptFormScrapped.setDepartmentName(department.getName()); |
| | | } |
| | | |
| | | |
| | | lDeptFormScrapped.setCreateTime(dealTime); |
| | | lDeptFormScrapped.setStates(1); |
| | |
| | | depFormScrappedModel.setDepFormScrappedGoodsId(scrappedGoodsId); |
| | | List<DepFormScrappedModel> scrappedModelList = select(depFormScrappedModel); |
| | | List<List<DepFormScrappedModel>> modelList = scrappedModelList.stream() |
| | | .collect(Collectors.groupingBy(DepFormScrappedModel::getBaseGoodsModelsId)) |
| | | .values().stream() |
| | | .map(list -> list.stream().collect(Collectors.toList())) |
| | | .collect(Collectors.toList()); |
| | | .collect(Collectors.groupingBy(DepFormScrappedModel::getBaseGoodsModelsId)) |
| | | .values().stream() |
| | | .map(list -> list.stream().collect(Collectors.toList())) |
| | | .collect(Collectors.toList()); |
| | | |
| | | scrappedGoodsMap.put("models", modelList); |
| | | goodsList.add(scrappedGoodsMap); |
| | |
| | | } |
| | | return select(sql.append(EXPORT_SQL_END).toString(), paramts, new MapperUtil()); |
| | | } |
| | | |
| | | public List<Map<String, Object>> listByModel(LDeptFormScrappedQry param) { |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | StringBuilder sql = new StringBuilder(EXPORT_SQL); |
| | |
| | | paramts.put("businessFormCode", param.getBusinessFormCode()); |
| | | } |
| | | //物品名称 |
| | | if (StringUtils.isNotEmpty(param.getGoodsTemplateName())){ |
| | | if (StringUtils.isNotEmpty(param.getGoodsTemplateName())) { |
| | | sql.append(" and model.BASE_GOODS_TEMPLATE_NAME LIKE :goodsTemplateName "); |
| | | paramts.put("goodsTemplateName", StringUtils.CHAR_PERCENT + param.getGoodsTemplateName() + StringUtils.CHAR_PERCENT); |
| | | } |
New file |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.base.pojo.FinSysTenantDepartmentParam; |
| | | import com.consum.model.po.FinSysTenantDepartment; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.jdbc.service.BaseService; |
| | | import java.util.List; |
| | | |
| | | public interface FinSysTenantDepartmentService extends BaseService { |
| | | |
| | | |
| | | FinSysTenantDepartment getByNameAndTenantId(String name, Long tenantId); |
| | | |
| | | /** |
| | | * @Description 新增 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | int add(FinSysTenantDepartmentParam param, FinSysTenantUser sysInfo); |
| | | |
| | | /** |
| | | * @Description 部门列表查询 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | GenericPager<FinSysTenantDepartment> queryList(FinSysTenantDepartmentParam param); |
| | | |
| | | FinSysTenantDepartment selectByCode(String code); |
| | | |
| | | /** |
| | | * @Description 编辑 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | int updateFinSysTenantDepartment(FinSysTenantDepartment department, FinSysTenantUser sysInfo); |
| | | |
| | | /** |
| | | * 根据部门id查询部门详情 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | FinSysTenantDepartment getById(Long id); |
| | | |
| | | /** |
| | | * @param department |
| | | * @param currentUser |
| | | * @Description 根据id删除部门 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | int updateById(FinSysTenantDepartment department, FinSysTenantUser currentUser); |
| | | |
| | | /** |
| | | * 根据机构id查询部门 |
| | | * |
| | | * @param agencyId |
| | | * @return |
| | | */ |
| | | List<FinSysTenantDepartment> getByTenantId(Long agencyId); |
| | | |
| | | } |
| | |
| | | private LWhProcureModelService lWhProcureModelService; |
| | | private BaseGoodsTemplateServiceImpl baseGoodsTemplateService; |
| | | private LWhGoodsService lWhGoodsService; |
| | | private LWhFormInventoryServiceImpl lWhFormInventoryService; |
| | | private LWhFormInventoryService lWhFormInventoryService; |
| | | private LWhFormProcureCoreService lWhFormProcureCoreService; |
| | | private LWhFormOutputServiceImpl lWhFormOutputService; |
| | | |
| | |
| | | LWhProcureModelService lWhProcureModelService, |
| | | BaseGoodsTemplateServiceImpl baseGoodsTemplateService, |
| | | LWhGoodsService lWhGoodsService, |
| | | LWhFormInventoryServiceImpl lWhFormInventoryService, |
| | | LWhFormInventoryService lWhFormInventoryService, |
| | | LWhFormProcureCoreService lWhFormProcureCoreService, |
| | | LWhFormOutputServiceImpl lWhFormOutputService |
| | | |
New file |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.base.core.utils.PageUtil; |
| | | import com.consum.base.pojo.excel.InventoryExcelTemplate; |
| | | import com.consum.base.pojo.query.LWhFormInventoryQry; |
| | | import com.consum.base.pojo.request.FormInventoryParam; |
| | | import com.consum.base.pojo.request.LWhFormInventoryParam; |
| | | import com.consum.base.pojo.response.FormInventoryDetailVO; |
| | | import com.consum.base.pojo.response.FormInventoryGoodsVO; |
| | | import com.consum.base.pojo.response.FormInventoryVO; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormInventory; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.jdbc.service.BaseService; |
| | | import java.util.List; |
| | | |
| | | public interface LWhFormInventoryService extends BaseService { |
| | | |
| | | int add(FormInventoryParam param, FinSysTenantUser currentUser, FinSysTenantUser operatorUser, FinSysTenantUser monitorUser); |
| | | |
| | | /** |
| | | * @Description 盘点单列表查询 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/31 |
| | | */ |
| | | GenericPager<LWhFormInventory> queryList(LWhFormInventoryQry param, FinSysTenantUser sysInfo); |
| | | |
| | | |
| | | FormInventoryVO saveInventory(FormInventoryVO dto, Long id); |
| | | |
| | | |
| | | /** |
| | | * 保存盘点信息 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/31 |
| | | */ |
| | | int updateInventoryInfo(LWhFormInventoryParam dto, Integer state, S_user_core currentUser, FinSysTenantUser sysInfo); |
| | | |
| | | |
| | | /** |
| | | * @return |
| | | * @Description 异常明细列表查询 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/11/1 |
| | | */ |
| | | PageUtil<FormInventoryDetailVO> queryPdDetailList(LWhFormInventoryQry param, FinSysTenantUser sysInfo); |
| | | |
| | | List<FormInventoryGoodsVO> selectDetailById(Long id); |
| | | |
| | | FormInventoryVO queryInventBaseGoodTemplate(Long id); |
| | | |
| | | List<InventoryExcelTemplate> getExportList(Long id); |
| | | |
| | | } |
| | |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | public class LWhFormInventoryServiceImpl extends BaseServiceImpl { |
| | | public class LWhFormInventoryServiceImpl extends BaseServiceImpl implements LWhFormInventoryService { |
| | | |
| | | @Autowired |
| | | private CodeGeneratorService codeGeneratorService; |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/31 |
| | | */ |
| | | @Override |
| | | public int add(FormInventoryParam param, FinSysTenantUser currentUser, FinSysTenantUser operatorUser, FinSysTenantUser monitorUser) { |
| | | //新增盘点单 |
| | | LWhFormInventory lWhFormInventory = new LWhFormInventory(); |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/31 |
| | | */ |
| | | @Override |
| | | public GenericPager<LWhFormInventory> queryList(LWhFormInventoryQry param, FinSysTenantUser sysInfo) { |
| | | StringBuilder sql = new StringBuilder(QUERY_LIST); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | |
| | | } |
| | | |
| | | |
| | | public List<FormInventoryGoodsVO> saveInventory(FormInventoryVO dto, Long id) { |
| | | @Override |
| | | public FormInventoryVO saveInventory(FormInventoryVO dto, Long id) { |
| | | //1.根据盘点单id查询盘点单 |
| | | LWhFormInventory lWhFormInventory = this.get(new LWhFormInventory(id)); |
| | | if (lWhFormInventory == null) { |
| | |
| | | log.error("盘点单物品为空"); |
| | | } |
| | | List<FormInventoryGoodsVO> result = inventoryGoodsService.add(formInventoryGoodsList, id); |
| | | |
| | | return result; |
| | | dto.setFormInventoryGoodsList(result); |
| | | return dto; |
| | | } |
| | | |
| | | |
| | |
| | | * @date 2023/10/31 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public int updateInventoryInfo(LWhFormInventoryParam dto, Integer state, S_user_core currentUser, FinSysTenantUser sysInfo) { |
| | | //1.根据盘点单id查询盘点单 |
| | | LWhFormInventory lWhFormInventory = this.get(new LWhFormInventory(dto.getId())); |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/11/1 |
| | | */ |
| | | @Override |
| | | public PageUtil<FormInventoryDetailVO> queryPdDetailList(LWhFormInventoryQry param, FinSysTenantUser sysInfo) { |
| | | StringBuilder sql = new StringBuilder(QUERY_PD_DETAIL_LIST); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | |
| | | return pageUtil; |
| | | } |
| | | |
| | | @Override |
| | | public List<FormInventoryGoodsVO> selectDetailById(Long id) { |
| | | |
| | | String sql = "select fig.id, fig.BASE_GOODS_TEMPLATE_ID,fig.GOODS_TEMPLATE_NAME,fig.BASE_GOODS_MODELS_NAME," |
| | |
| | | return result; |
| | | } |
| | | |
| | | @Override |
| | | public FormInventoryVO queryInventBaseGoodTemplate(Long id) { |
| | | FormInventoryVO formInventoryVO = new FormInventoryVO(); |
| | | |
| | |
| | | return formInventoryVO; |
| | | } |
| | | |
| | | @Override |
| | | public List<InventoryExcelTemplate> getExportList(Long id) { |
| | | String sql = "SELECT\n" |
| | | + "\tfi.INVENTORY_DATE createTime,\n" |
| | |
| | | goodsModelNumList.forEach(itemModelInfo -> { |
| | | // 需要调拨的物品的某个型号 |
| | | Long baseGoodsModelsId = itemModelInfo.getBaseGoodsModelsId(); |
| | | allChangModelList.add(baseGoodsModelsId); |
| | | |
| | | //TODO 为空时不加入更新列表 |
| | | if (baseGoodsModelsId != null) { |
| | | allChangModelList.add(baseGoodsModelsId); |
| | | } |
| | | // 需要调拨的物品某个型号的数量 |
| | | Integer counts = itemModelInfo.getCounts(); |
| | | |
| | |
| | | import com.consum.base.pojo.response.FormScrappedGoodsVO; |
| | | import com.consum.base.pojo.response.GoodsModelVO; |
| | | import com.consum.base.pojo.response.LWhFormScrappedExtendVO; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.po.BaseGoodsModels; |
| | | import com.consum.model.po.BaseGoodsTemplate; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantDepartment; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormScrapped; |
| | | import com.consum.model.po.LWhFormScrappedGoods; |
| | | import com.consum.model.po.SDictData; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | 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 java.util.stream.Collectors; |
| | | 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.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Description 报废单 |
| | |
| | | @Autowired |
| | | private BaseWarehouseServiceImpl baseWarehouseService; |
| | | @Autowired |
| | | private FinSysTenantDepartmentServiceImpl departmentService; |
| | | private FinSysTenantDepartmentService departmentService; |
| | | @Autowired |
| | | private LWhGoodsService lWhGoodsService; |
| | | @Autowired |
| | |
| | | * @return 1.新增报废单 2.新增报废单物品 |
| | | */ |
| | | |
| | | public int add(LWhFormScrappedParam param, S_user_core currentUser, FinSysTenantUser sysInfo) { |
| | | public int add(LWhFormScrappedParam param, S_user_core currentUser, FinSysTenantUser sysInfo) { |
| | | //1.新增报废单记录 |
| | | LWhFormScrapped lWhFormScrapped = new LWhFormScrapped(); |
| | | //报废单id |
| | |
| | | return 0; |
| | | } |
| | | wareHouseName = warehouse.getWarehouseName(); |
| | | // if (0 == 0) { |
| | | // warehouseId = param.getWarehouseId(); |
| | | // //根据仓库id查询仓库 |
| | | // BaseWarehouse warehouse = this.baseWarehouseService.getById(warehouseId); |
| | | // if (warehouse == null) { |
| | | // log.error("仓库不存在"); |
| | | // return 0; |
| | | // } |
| | | // wareHouseName = warehouse.getWarehouseName(); |
| | | // } else { |
| | | // // 查询部门名称 |
| | | // warehouseId = param.getDepartmentId(); |
| | | // FinSysTenantDepartment sysTenantDepartment = departmentService.getById(warehouseId); |
| | | // if (sysTenantDepartment == null) { |
| | | // log.error("部门不存在"); |
| | | // return 0; |
| | | // } |
| | | // wareHouseName = sysTenantDepartment.getName(); |
| | | // } |
| | | lWhFormScrapped.setWarehouseId(warehouseId); |
| | | lWhFormScrapped.setWarehouseName(wareHouseName); |
| | | lWhFormScrapped.setAgencyId(Long.valueOf(sysInfo.getTenantId())); |
| | |
| | | import com.consum.base.core.service.LWhWarningCoreServiceImpl; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.core.utils.LockManage; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.po.LGoodsUserRecord; |
| | | 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.consum.model.po.LWhProcureModelUser; |
| | | 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.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import javax.annotation.Resource; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Propagation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.transaction.interceptor.TransactionAspectSupport; |
| | | |
| | | /** |
| | | * @ClassName LWhFormTransferCoreService |
| | |
| | | public class LWhFormTransferCoreService { |
| | | |
| | | @Resource |
| | | private LWhFormTransferServiceImpl lWhFormTransferService; |
| | | private LWhFormTransferService lWhFormTransferService; |
| | | @Resource |
| | | private LWhFormOutputCoreService lWhFormOutputCoreService; |
| | | @Resource |
| | |
| | | String nickName = currentUser.getNick_name(); |
| | | // 出库单流水id |
| | | Long outWarehouseFlowId = lWhFormTransfer.getOutWarehouseFlowId(); |
| | | if (outWarehouseFlowId == null){ |
| | | if (outWarehouseFlowId == null) { |
| | | log.error("调拨失败!未找到出库单"); |
| | | return; |
| | | } |
| | |
| | | synchronized (warehouseModelLockObj) { |
| | | // 根据出库流水ID 查询 出库的物品ID |
| | | outGoodsIds = getGoodsidByFlowId(outWarehouseFlowId, oldRecordId); |
| | | if (CollectionUtils.isEmpty(outGoodsIds)){ |
| | | if (CollectionUtils.isEmpty(outGoodsIds)) { |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | throw new RuntimeException("入库单失败,未查询到物品!"); |
| | | } |
| | |
| | | lWhProcureModelUser.setTransBusinessId(whFormTransferId); |
| | | lWhProcureModelUser.setBaseGoodsModelsId(baseGoodsModelsId); |
| | | List<LWhProcureModelUser> goodsUserInfo = goodsBaseService.select(lWhProcureModelUser); |
| | | if (CollectionUtils.isEmpty(goodsUserInfo)){ |
| | | if (CollectionUtils.isEmpty(goodsUserInfo)) { |
| | | continue; |
| | | } |
| | | int totalGoodsNum = goodsUserInfo.stream().filter(item -> item.getGoodsNum() != null).mapToInt(LWhProcureModelUser::getGoodsNum).sum(); |
| | |
| | | //将保管仓库信息更新到 物品仓库保管记录【L_GOODS_WH_RECORD】 |
| | | lGoodsWhRecordService.insertNewRecord(outGoodsIds, inWarehouseFlowId, dealTime); |
| | | |
| | | |
| | | LWhGoodsRecordDetails lWhGoodsRecordDetails = new LWhGoodsRecordDetails(); |
| | | lWhGoodsRecordDetails.setWhGoodsRecordId(oldRecordId); |
| | | List<LWhGoodsRecordDetails> goodsRecordDetailsList = lWhGoodsRecordDetailsService.select(lWhGoodsRecordDetails); |
| | |
| | | lWhFormTransferService.update(lWhFormTransfer); |
| | | |
| | | //当库存变动时调用该方法 |
| | | if (inWarehouseType == 0){ |
| | | if (inWarehouseType == 0) { |
| | | lWhWarningCoreService.updateKuCun(Convert.toShort(inWarehouseType, (short) 0), inWarehouseId, allChangModelList, null, dealTime); |
| | | } |
| | | log.info("调拨单:{} 入库完成", whFormTransferId); |
New file |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.base.pojo.excel.TransferExcelTemplate; |
| | | import com.consum.base.pojo.query.TransferQry; |
| | | import com.consum.base.pojo.request.LWhFormTransferParam; |
| | | import com.consum.base.pojo.response.LWHFromTransferExtendVO; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormTransfer; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.jdbc.service.BaseService; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface LWhFormTransferService extends BaseService { |
| | | |
| | | long add(LWhFormTransferParam param, FinSysTenantUser sysInfo) throws Exception; |
| | | |
| | | |
| | | /** |
| | | * @Description 列表查询 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/30 |
| | | */ |
| | | GenericPager<LWhFormTransfer> queryFormTransferList(TransferQry param); |
| | | |
| | | /** |
| | | * @Description 根据id查询详情 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/30 |
| | | */ |
| | | LWHFromTransferExtendVO getById(Long id); |
| | | |
| | | |
| | | /** |
| | | * @Description 导出调拨出库单 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/31 |
| | | */ |
| | | List<TransferExcelTemplate> export(Long id, Integer type); |
| | | |
| | | /** |
| | | * 撤销 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/31 |
| | | */ |
| | | int updateStatus(Long id); |
| | | |
| | | GenericPager<Map<String, Object>> queryTransferInfo(TransferQry transferQry); |
| | | |
| | | |
| | | GenericPager<Map<String, Object>> queryFormTransferDetailList(TransferQry param); |
| | | |
| | | List<Map<String, Object>> queryDepartmentTransferOrder(); |
| | | |
| | | LWhFormTransfer selectById(Long id); |
| | | } |
File was renamed from consum-base/src/main/java/com/consum/base/service/BaseCategoryServiceImpl.java |
| | |
| | | package com.consum.base.service; |
| | | package com.consum.base.service.impl; |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.pojo.BaseCategoryParam; |
| | | import com.consum.base.pojo.ProjectTreeResult; |
| | | import com.consum.base.service.BaseCategoryService; |
| | | import com.consum.model.po.BaseCategory; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | |
| | | * @Date 2023/10/23 |
| | | */ |
| | | @Service |
| | | public class BaseCategoryServiceImpl extends BaseServiceImpl { |
| | | public class BaseCategoryServiceImpl extends BaseServiceImpl implements BaseCategoryService { |
| | | |
| | | private static final String QUERY_TREE_ALL = "select * from base_category where states = 1 order by FATHER_CATEGORY_ID, LEVELS ASC"; |
| | | |
File was renamed from consum-base/src/main/java/com/consum/base/service/FinSysTenantDepartmentServiceImpl.java |
| | |
| | | package com.consum.base.service; |
| | | package com.consum.base.service.impl; |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.pojo.FinSysTenantDepartmentParam; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.pojo.FinSysTenantDepartmentParam; |
| | | import com.consum.base.service.FinSysTenantDepartmentService; |
| | | import com.consum.model.po.FinSysTenantDepartment; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @Description 部门管理 |
| | |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @Service |
| | | public class FinSysTenantDepartmentServiceImpl extends BaseServiceImpl { |
| | | public class FinSysTenantDepartmentServiceImpl extends BaseServiceImpl implements FinSysTenantDepartmentService { |
| | | |
| | | private static final String QUERY_BY_CODE = "SELECT * FROM fin_sys_tenant_department WHERE CODE = ?"; |
| | | |
| | | /** |
| | | * @Description 根据 部门名称和机构id 查询部门 |
| | | * @Description 根据 部门名称和机构id 查询部门 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | public FinSysTenantDepartment getByNameAndTenantId(String name,Long tenantId) { |
| | | @Override |
| | | public FinSysTenantDepartment getByNameAndTenantId(String name, Long tenantId) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM fin_sys_tenant_department WHERE 1 = 1 "); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * @Description 新增 |
| | | * @Description 新增 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @Override |
| | | public int add(FinSysTenantDepartmentParam param, FinSysTenantUser sysInfo) { |
| | | FinSysTenantDepartment department = new FinSysTenantDepartment(); |
| | | BeanUtils.copyProperties(param, department); |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @Override |
| | | public GenericPager<FinSysTenantDepartment> queryList(FinSysTenantDepartmentParam param) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM fin_sys_tenant_department WHERE 1 = 1 and is_delete = 0 "); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | |
| | | return selectSplit(sql.toString(), paramts, new FinSysTenantDepartment()); |
| | | } |
| | | |
| | | @Override |
| | | public FinSysTenantDepartment selectByCode(String code) { |
| | | List<FinSysTenantDepartment> select = this.select(QUERY_BY_CODE, new Object[]{code}, new FinSysTenantDepartment()); |
| | | if (StringUtils.isEmptyList(select)) { |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @Override |
| | | public int updateFinSysTenantDepartment(FinSysTenantDepartment department, FinSysTenantUser sysInfo) { |
| | | department.setUpdateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | department.setUpdateBy(sysInfo.getUserName()); |
| | |
| | | |
| | | /** |
| | | * 根据部门id查询部门详情 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | | @Override |
| | | public FinSysTenantDepartment getById(Long id) { |
| | | return this.get(new FinSysTenantDepartment(id)); |
| | | } |
| | | |
| | | /** |
| | | * @param department |
| | | * @param currentUser |
| | | * @Description 根据id删除部门 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | * @param department |
| | | * @param currentUser |
| | | */ |
| | | @Override |
| | | public int updateById(FinSysTenantDepartment department, FinSysTenantUser currentUser) { |
| | | department.setIsDelete(Constants.IS_DELETE_YES); |
| | | //删除时间 |
| | |
| | | |
| | | /** |
| | | * 根据机构id查询部门 |
| | | * |
| | | * @param agencyId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<FinSysTenantDepartment> getByTenantId(Long agencyId) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM fin_sys_tenant_department WHERE 1 = 1 and is_delete = 0 "); |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
File was renamed from consum-base/src/main/java/com/consum/base/service/LWhFormTransferServiceImpl.java |
| | |
| | | package com.consum.base.service; |
| | | package com.consum.base.service.impl; |
| | | |
| | | import com.consum.base.core.CodeGeneratorEnum; |
| | | import com.consum.base.core.CodeGeneratorService; |
| | |
| | | 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.base.service.BaseGoodsModelsServiceImpl; |
| | | import com.consum.base.service.BaseWarehouseManagerService; |
| | | import com.consum.base.service.BaseWarehouseServiceImpl; |
| | | import com.consum.base.service.FinSysTenantServiceImpl; |
| | | import com.consum.base.service.LWhFormOutputServiceImpl; |
| | | import com.consum.base.service.LWhFormTransferService; |
| | | import com.consum.base.service.LWhGoodsService; |
| | | import com.consum.base.service.LWhProcureModelService; |
| | | import com.consum.base.service.LWhProcureModelUserRecordServiceImpl; |
| | | import com.consum.base.service.LWhProcureModelUserServiceImpl; |
| | | 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.LWhFormTransfer; |
| | | import com.consum.model.po.LWhProcureModel; |
| | | import com.consum.model.po.LWhProcureModelUser; |
| | | import com.consum.model.po.LWhProcureModelUserRecord; |
| | | import com.walker.db.page.GenericPager; |
| | | 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.transaction.interceptor.TransactionAspectSupport; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description 调拨管理 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/30 |
| | | */ |
| | | @Service |
| | | public class LWhFormTransferServiceImpl extends BaseServiceImpl { |
| | | public class LWhFormTransferServiceImpl extends BaseServiceImpl implements LWhFormTransferService { |
| | | |
| | | @Autowired |
| | | private BaseWarehouseServiceImpl baseWarehouseService; |
| | |
| | | @Autowired |
| | | private LWhProcureModelService lWhProcureModelService; |
| | | @Autowired |
| | | private LWhFormOutputCoreService lWhFormOutputCoreService; |
| | | @Autowired |
| | | private LWhFormOutputServiceImpl lWhFormOutputService; |
| | | @Autowired |
| | | private LWhGoodsRecordService lWhGoodsRecordService; |
| | | @Autowired |
| | | private BaseGoodsModelsServiceImpl baseGoodsModelsService; |
| | | @Autowired |
| | |
| | | private LWhProcureModelUserRecordServiceImpl lWhProcureModelUserRecordService; |
| | | @Autowired |
| | | private BaseWarehouseManagerService baseWarehouseManagerService; |
| | | @Autowired |
| | | private BaseGoodsTemplateServiceImpl baseGoodsTemplateService; |
| | | |
| | | private static String QUERY_FORM_TRANSFER_LIST = "SELECT ft.* FROM l_wh_form_transfer ft " |
| | | + "left join L_WH_PROCURE_MODEL pm on pm.BUSINESS_ID = ft.id " |
| | |
| | | List<FormTransferGoodsVO> formTransferGoods = Lists.newArrayList(); |
| | | for (Map<String, Object> map : procureModelList) { |
| | | FormTransferGoodsVO procureTemplateInfoVO = MapUtils.convertMapToObj(map, FormTransferGoodsVO.class); |
| | | |
| | | Long baseGoodsTemplateId = procureTemplateInfoVO.getId(); |
| | | // 查询型号数量 |
| | | List<GoodsModelVO> goodsModelVOList = Lists.newArrayList(); |
| | | String sql2 = "SELECT pm.id,pm.BASE_GOODS_MODELS_NAME,bgm.UNIT,COUNTS,total_amount " |
| | | + "FROM l_wh_procure_model pm LEFT JOIN base_goods_models bgm ON bgm.id = pm.BASE_GOODS_MODELS_ID " |
| | | + "LEFT JOIN base_goods_template bgt ON bgt.id = bgm.GOODS_TEMPLATES_ID " + "WHERE pm.BUSINESS_ID =:id"; |
| | | List<Map<String, Object>> modelList = lWhFormOutputService.select(sql2, paramMap, new MapperUtil()); |
| | | + "LEFT JOIN base_goods_template bgt ON bgt.id = bgm.GOODS_TEMPLATES_ID " + "WHERE pm.BUSINESS_ID =:id and bgt.id =:baseGoodsTemplateId"; |
| | | Map<String, Object> goodsModelParamMap = new HashMap<>(); |
| | | goodsModelParamMap.put("id", result.getId()); |
| | | goodsModelParamMap.put("baseGoodsTemplateId", baseGoodsTemplateId); |
| | | List<Map<String, Object>> modelList = lWhFormOutputService.select(sql2, goodsModelParamMap, new MapperUtil()); |
| | | modelList.forEach(item -> { |
| | | GoodsModelVO goodsModelVO = MapUtils.convertMapToObj(item, GoodsModelVO.class); |
| | | Integer businessType = result.getBusinessType(); |
| | |
| | | |
| | | } |
| | | goodsModelVOList.add(goodsModelVO); |
| | | procureTemplateInfoVO.setModels(goodsModelVOList); |
| | | }); |
| | | |
| | | procureTemplateInfoVO.setModels(goodsModelVOList); |
| | | formTransferGoods.add(procureTemplateInfoVO); |
| | | } |
| | | result.setFormTransferGoods(formTransferGoods); |
| | |
| | | return select; |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public LWhFormTransfer selectById(Long id) { |
| | | LWhFormTransfer lWhFormTransfer = new LWhFormTransfer(); |
| | | lWhFormTransfer.setId(id); |
| | | return this.get(lWhFormTransfer); |
| | | } |
| | | } |
| | |
| | | import com.consum.base.pojo.response.UsingFormBackGoodsTemplateInfo; |
| | | import com.consum.base.pojo.response.UsingFormBackModelInfo; |
| | | import com.consum.base.pojo.response.UsingFormBackVO; |
| | | import com.consum.base.service.BaseCategoryServiceImpl; |
| | | import com.consum.base.service.BaseCategoryService; |
| | | import com.consum.base.service.FinSysTenantDepartmentService; |
| | | import com.consum.base.service.LWhFormTransferService; |
| | | import com.consum.base.service.UsingFormBackGoodsService; |
| | | import com.consum.base.service.UsingFormBackModelService; |
| | | import com.consum.base.service.UsingFormBackService; |
| | | import com.consum.model.po.BaseCategory; |
| | | import com.consum.model.po.FinSysTenantDepartment; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormTransfer; |
| | | import com.consum.model.po.UsingFormBack; |
| | | import com.consum.model.po.UsingFormBackGoods; |
| | | import com.consum.model.po.UsingFormBackModel; |
| | |
| | | @Autowired |
| | | private CodeGeneratorService codeGeneratorService; |
| | | @Autowired |
| | | private BaseCategoryServiceImpl baseCategoryService; |
| | | private BaseCategoryService baseCategoryService; |
| | | @Autowired |
| | | private UsingFormBackModelService usingFormBackModelService; |
| | | @Autowired |
| | | private UsingFormBackGoodsService usingFormBackGoodsService; |
| | | |
| | | @Autowired |
| | | private FinSysTenantDepartmentService finSysTenantDepartmentService; |
| | | @Autowired |
| | | private LWhFormTransferService lWhFormTransferService; |
| | | |
| | | @Override |
| | | public void add(UsingFormBackParam usingFormBackParam, FinSysTenantUser sysInfo) { |
| | | |
| | | Long departmentId = usingFormBackParam.getDepartmentId(); |
| | | String departmentName = usingFormBackParam.getDepartmentName(); |
| | | FinSysTenantDepartment department = finSysTenantDepartmentService.getById(departmentId); |
| | | if (department == null) { |
| | | throw new RuntimeException("部门不存在"); |
| | | } |
| | | String departmentName = department.getName(); |
| | | Long operatorId = usingFormBackParam.getOperatorId(); |
| | | String operatorName = usingFormBackParam.getOperatorName(); |
| | | Long backTime = usingFormBackParam.getDealTime(); |
| | |
| | | usingFormBackGoods.setClassification(classification); |
| | | usingFormBackGoods.setTransBusinessId(transBusinessId); |
| | | usingFormBackGoods.setBusinessFormCode(businessFormCode); |
| | | // usingFormBackGoods.setTransOutWarehouseType(); |
| | | // usingFormBackGoods.setTransOutWarehouseId(); |
| | | |
| | | LWhFormTransfer lWhFormTransfer = lWhFormTransferService.selectById(transBusinessId); |
| | | Integer outWarehouseType = lWhFormTransfer.getOutWarehouseType(); |
| | | Long outWarehouseId = lWhFormTransfer.getOutWarehouseId(); |
| | | usingFormBackGoods.setTransOutWarehouseType(outWarehouseType); |
| | | usingFormBackGoods.setTransOutWarehouseId(outWarehouseId); |
| | | |
| | | usingFormBackModelService.insert(usingFormBackGoods); |
| | | for (baseGoodModel model : backingGoodsInfo.getModels()) { |
| | |
| | | map.put("agencyId", agencyId); |
| | | } |
| | | if (StringUtils.isNotEmpty(createName)) { |
| | | sql.append("AND ufb.CREATE_NAME = :createName "); |
| | | sql.append("AND ufb.OPERATOR_NAME = :createName "); |
| | | map.put("createName", createName); |
| | | } |
| | | sql.append("ORDER BY ufb.CREATE_TIME DESC "); |
| | |
| | | Long id = usingFormBackVO.getId(); |
| | | StringBuilder countSql = new StringBuilder("SELECT \n" |
| | | + "\tufbg.BASE_GOODS_TEMPLATE_NAME,\n" |
| | | + "\tsum(ufbm.COUNTS) count\n" |
| | | + "\tsum(ufbm.COUNTS) count,\n" |
| | | + "\tufbm.UNIT\n" |
| | | + "FROM\n" |
| | | + "\tusing_form_back_goods ufbg\n" |
| | | + "\tLEFT JOIN using_form_back_model ufbm ON ufbg.ID = ufbm.USING_FORM_BACK_GOODS_ID\n" |
| | |
| | | map.put("agencyId", agencyId); |
| | | } |
| | | if (StringUtils.isNotEmpty(createName)) { |
| | | sql.append("AND ufb.CREATE_NAME = :createName "); |
| | | sql.append("AND ufb.OPERATOR_NAME = :createName "); |
| | | map.put("createName", createName); |
| | | } |
| | | sql.append("ORDER BY ufb.CREATE_TIME DESC "); |
| | |
| | | UsingFormBack usingFormBack = new UsingFormBack(); |
| | | usingFormBack.setId(IdUtil.generateId()); |
| | | usingFormBack.setBusinessFormCode(codeGeneratorService.createBusinessFormCode(CodeGeneratorEnum.GOBACK)); |
| | | // usingFormBack.setOutWarehouseType(); |
| | | // usingFormBack.setOutWarehouseId(); |
| | | // usingFormBack.setOutWarehouseName(); |
| | | usingFormBack.setOutWarehouseType(1); |
| | | usingFormBack.setOutWarehouseId(departmentId); |
| | | usingFormBack.setOutWarehouseName(departmentName); |
| | | |
| | | String tenantId = sysInfo.getTenantId(); |
| | | String tenantName = sysInfo.getTenantName(); |
| | |
| | | usingFormBack.setCreateTime(DateUtils.getDateTimeNumber(System.currentTimeMillis())); |
| | | usingFormBack.setStates(1); |
| | | |
| | | usingFormBack.setDepartmentId(departmentId); |
| | | usingFormBack.setDepartmentName(departmentName); |
| | | usingFormBack.setOperatorId(operatorId); |
| | | Long sysDeptId = sysInfo.getSysDeptId(); |
| | | FinSysTenantDepartment department = finSysTenantDepartmentService.getById(sysDeptId); |
| | | if (department == null) { |
| | | throw new RuntimeException("部门不存在"); |
| | | } |
| | | usingFormBack.setDepartmentId(department.getId()); |
| | | usingFormBack.setDepartmentName(department.getName()); |
| | | usingFormBack.setOperatorId(sysInfo.getId()); |
| | | usingFormBack.setOperatorName(operatorName); |
| | | usingFormBack.setDealTime(backTime); |
| | | usingFormBack.setProcureDoc(procureDoc); |