4 文件已重命名
9个文件已添加
4个文件已删除
18个文件已修改
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.MapUtils; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.pojo.BaseGoodsTemplateParam; |
| | | import com.consum.base.pojo.response.GoodsTemplateVO; |
| | | import com.consum.base.service.BaseGoodsTemplateServiceImpl; |
| | | import com.consum.base.service.BaseWarehouseServiceImpl; |
| | | import com.consum.base.service.LWhGoodsService; |
| | | import com.consum.model.po.BaseGoodsModels; |
| | | import com.consum.model.po.BaseGoodsTemplate; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.SDictData; |
| | | import com.consum.model.vo.BaseGoodsTemplateVo; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.web.ResponseValue; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | 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.util.CollectionUtils; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | |
| | | |
| | | @Autowired |
| | | private BaseGoodsTemplateServiceImpl baseGoodsTemplateService; |
| | | |
| | | @Autowired |
| | | private LWhGoodsService lWhGoodsService; |
| | | |
| | | @Autowired |
| | | private BaseWarehouseServiceImpl baseWarehouseService; |
| | | |
| | | /** |
| | | * @Description 新增物品模板 |
| | |
| | | |
| | | @GetMapping("/query/goodsTemplate") |
| | | public ResponseValue queryGoodsTemplateByCategoryId(Long agencyId, Long categoryId) { |
| | | // if (agencyId == null) { |
| | | // return ResponseValue.error("机构id为空"); |
| | | // } |
| | | List<BaseGoodsTemplate> list = this.baseGoodsTemplateService.queryGoodsTemplateByCategoryId(agencyId, categoryId); |
| | | if (list == null) { |
| | | return ResponseValue.error("查询失败!"); |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "查询机构下默认仓库下的分类模板信息", notes = "查询机构下默认仓库下的分类模板信息") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "agencyId", value = "父级机构id", required = true, dataType = "Long", paramType = "query"), |
| | | @ApiImplicitParam(name = "categoryId", value = "分类id", required = true, dataType = "Long", paramType = "query") |
| | | }) |
| | | @GetMapping("/query/warehouse/goods") |
| | | public ResponseValue queryWarehouseGoods(Long agencyId, Long categoryId) { |
| | | |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("categoryId", categoryId); |
| | | |
| | | List<BaseWarehouse> baseWarehouseList = baseWarehouseService.getByAgencyId(agencyId); |
| | | baseWarehouseList.forEach(baseWarehouse -> { |
| | | Integer isDefault = baseWarehouse.getIsDefault(); |
| | | if (isDefault == 1) { |
| | | map.put("warehouseId", baseWarehouse.getId()); |
| | | } |
| | | }); |
| | | |
| | | String sql = "SELECT DISTINCT bgt.id,bgt.GOODS_NAME FROM l_wh_goods g LEFT JOIN base_goods_template bgt ON g.BASE_GOODS_TEMPLATE_ID = bgt.id " |
| | | + "WHERE WAREHOUSE_TYPE = 0 " |
| | | + "AND WAREHOUSE_ID = :warehouseId " |
| | | + "AND CATEGORY_ID = :categoryId " |
| | | // 1:集采,2:自退货 |
| | | + "AND BUY_TYPE =1"; |
| | | |
| | | List<GoodsTemplateVO> resultList = Lists.newArrayList(); |
| | | List<Map<String, Object>> goodsTemplateList = lWhGoodsService.select(sql, map, new MapperUtil()); |
| | | goodsTemplateList.forEach(item -> { |
| | | GoodsTemplateVO goodsTemplateVO = MapUtils.convertMapToObj(item, GoodsTemplateVO.class); |
| | | resultList.add(goodsTemplateVO); |
| | | }); |
| | | return ResponseValue.success("查询成功!", resultList); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | import com.alibaba.excel.event.AnalysisEventListener; |
| | | import com.alibaba.excel.exception.ExcelDataConvertException; |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.FinSysTenantUtils; |
| | | import com.consum.base.pojo.FinSysTenantParam; |
| | | import com.consum.base.pojo.FinSysTenantSearchParam; |
| | | import com.consum.base.service.FinSysTenantServiceImpl; |
| | | import com.consum.base.service.FinSysTenantUserServiceImpl; |
| | | import com.consum.base.core.utils.FinSysTenantUtils; |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.vo.FinSysTenantUserResult; |
| | |
| | | import com.walker.infrastructure.tree.TreeNode; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.web.ResponseValue; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.Iterator; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.TreeMap; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.core.io.ClassPathResource; |
| | |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.http.ResponseEntity; |
| | | 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.io.InputStream; |
| | | import java.net.URLEncoder; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description 区划 |
| | |
| | | // 省进入 查询 省和地市 ;地市进入 查询自己地市 |
| | | // TODO Long.valueOf(getSysInfo().getTenantId()) |
| | | FinSysTenant finSysTenant = |
| | | this.finSysTenantService.get(new FinSysTenant(Long.valueOf(getSysInfo().getTenantId()))); |
| | | this.finSysTenantService.get(new FinSysTenant(Long.valueOf(getSysInfo().getTenantId()))); |
| | | if (finSysTenant.getLv() == 3) { |
| | | return ResponseValue.error("县区级别无法查看"); |
| | | } |
| | | List<FinSysTenant> finSysTenantList = |
| | | this.finSysTenantService.queryTreeById(finSysTenant.getId(), finSysTenant.getLv()); |
| | | this.finSysTenantService.queryTreeById(finSysTenant.getId(), finSysTenant.getLv()); |
| | | List<TreeNode> treeNodeList = new ArrayList<>(); |
| | | // 省查本身及以下 市查本级 县无权查看 |
| | | if (finSysTenant.getLv() == 1) { |
| | |
| | | } |
| | | } else { |
| | | TreeNode treeNode = new TreeNode(finSysTenantList.get(0).getId(), finSysTenantList.get(0).getName(), |
| | | new ArrayList<>(), finSysTenantList.get(0).getParentId(), finSysTenantList.get(0).getCode()); |
| | | new ArrayList<>(), finSysTenantList.get(0).getParentId(), finSysTenantList.get(0).getCode()); |
| | | treeNodeList.add(treeNode); |
| | | } |
| | | return ResponseValue.success(treeNodeList); |
| | |
| | | // 省进入 查询 省和地市 ;地市进入 查询自己地市 |
| | | // TODO Long.valueOf(getSysInfo().getTenantId()) |
| | | FinSysTenant finSysTenant = |
| | | this.finSysTenantService.get(new FinSysTenant(Long.valueOf(getSysInfo().getTenantId()))); |
| | | this.finSysTenantService.get(new FinSysTenant(Long.valueOf(getSysInfo().getTenantId()))); |
| | | if (finSysTenant.getLv() == 3) { |
| | | return ResponseValue.error("县区级别无法查看"); |
| | | } |
| | | Map<Long, List<FinSysTenant>> finSysTenantList = |
| | | this.finSysTenantService.queryCountyByCityCode(finSysTenant.getId(), finSysTenant.getLv()); |
| | | this.finSysTenantService.queryCountyByCityCode(finSysTenant.getId(), finSysTenant.getLv()); |
| | | return ResponseValue.success(finSysTenantList); |
| | | } |
| | | |
| | |
| | | |
| | | protected TreeNode toTreeNode(FinSysTenant entity) { |
| | | TreeNode treeNode = |
| | | new TreeNode(entity.getId(), entity.getName(), (List) null, entity.getParentId(), entity.getCode()); |
| | | new TreeNode(entity.getId(), entity.getName(), (List) null, entity.getParentId(), entity.getCode()); |
| | | return treeNode; |
| | | } |
| | | |
| | |
| | | @RequestMapping("/select/allList") |
| | | public ResponseValue allList(FinSysTenantSearchParam param) { |
| | | StringBuilder whStr = new StringBuilder("where 1=1 and status = 1 and is_delete = 0 "); |
| | | HashMap parameter = new HashMap<>(); |
| | | HashMap parameter = new HashMap<>(); |
| | | if (param.getFirstZmS() != null && !param.getFirstZmS().equals("")) { |
| | | whStr.append(" and name is not null and("); |
| | | String upperCase = param.getFirstZmS().toUpperCase(); |
| | |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/4 |
| | | */ |
| | |
| | | if (param.getId() == null) { |
| | | return ResponseValue.error("机构id为空"); |
| | | } |
| | | int num =this.finSysTenantService.updateById(param,this.getSysInfo()); |
| | | return num>0 ? ResponseValue.success(1):ResponseValue.error("删除失败!"); |
| | | int num = this.finSysTenantService.updateById(param, this.getSysInfo()); |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("删除失败!"); |
| | | } |
| | | |
| | | /** |
| | | * 添加机构 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/4 |
| | | */ |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody FinSysTenantParam param){ |
| | | public ResponseValue add(@RequestBody FinSysTenantParam param) { |
| | | if (param == null) { |
| | | return ResponseValue.error("参数为空"); |
| | | } |
| | |
| | | if (lv > 4) { |
| | | return ResponseValue.error("不能创建支局以下机构"); |
| | | } |
| | | int num = this.finSysTenantService.addFinSysTenant(param,this.getSysInfo(),lv); |
| | | if(num>0) return ResponseValue.success(1); |
| | | int num = this.finSysTenantService.addFinSysTenant(param, this.getSysInfo(), lv); |
| | | if (num > 0) { |
| | | return ResponseValue.success(1); |
| | | } |
| | | return ResponseValue.error("插入失败!"); |
| | | } |
| | | |
| | |
| | | InputStreamResource resourceToDownload = new InputStreamResource(inputStream); |
| | | // 返回带有文件输入流的ResponseEntity对象 |
| | | return ResponseEntity |
| | | .status(HttpStatus.OK) |
| | | .headers(headers) |
| | | .body(resourceToDownload); |
| | | .status(HttpStatus.OK) |
| | | .headers(headers) |
| | | .body(resourceToDownload); |
| | | } |
| | | |
| | | |
| | |
| | | InputStreamResource resourceToDownload = new InputStreamResource(inputStream); |
| | | // 返回带有文件输入流的ResponseEntity对象 |
| | | return ResponseEntity |
| | | .status(HttpStatus.OK) |
| | | .headers(headers) |
| | | .body(resourceToDownload); |
| | | .status(HttpStatus.OK) |
| | | .headers(headers) |
| | | .body(resourceToDownload); |
| | | } |
| | | |
| | | |
| | | @PostMapping("import") |
| | | public ResponseValue upload(@RequestParam Long pid, MultipartFile file) throws IOException { |
| | | String originalFilename = file.getOriginalFilename(); |
| | | if (!"xls".equals(originalFilename.substring(originalFilename.lastIndexOf(".") + 1))){ |
| | | if (!"xls".equals(originalFilename.substring(originalFilename.lastIndexOf(".") + 1))) { |
| | | return ResponseValue.error("文件格式有误!"); |
| | | } |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo==null){ |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("当前登录用户为空"); |
| | | } |
| | | String parentIdStr = pid + ""; |
| | |
| | | |
| | | EasyExcel.read(file.getInputStream(), FinSysTenantParam.class, new AnalysisEventListener<FinSysTenantParam>() { |
| | | LinkedList<FinSysTenantParam> finSysTenantParams = new LinkedList<>(); |
| | | |
| | | @Override |
| | | public void invoke(FinSysTenantParam finSysTenantParam, AnalysisContext analysisContext) { |
| | | if (StringUtils.isEmpty(finSysTenantParam.getCode())||finSysTenantParam.getCode().length()>20){ |
| | | IllegalStateException exception = new IllegalStateException("第" + analysisContext.readSheetHolder().getRowIndex() + "行,机构编号不能为空或长度大于20"); |
| | | if (StringUtils.isEmpty(finSysTenantParam.getCode()) || finSysTenantParam.getCode().length() > 20) { |
| | | IllegalStateException exception = new IllegalStateException( |
| | | "第" + analysisContext.readSheetHolder().getRowIndex() + "行,机构编号不能为空或长度大于20"); |
| | | throw exception; |
| | | } |
| | | if (null!=finSysTenantService.selectByTenantId(finSysTenantParam.getCode())){ |
| | | if (null != finSysTenantService.selectByTenantId(finSysTenantParam.getCode())) { |
| | | throw new IllegalStateException("第" + analysisContext.readSheetHolder().getRowIndex() + "行,机构编号已存在"); |
| | | } |
| | | if (StringUtils.isEmpty(finSysTenantParam.getName())||finSysTenantParam.getName().length()>100){ |
| | | IllegalStateException exception = new IllegalStateException("第" + analysisContext.readSheetHolder().getRowIndex() + "行,机构名称不能为空或长度大于100"); |
| | | if (StringUtils.isEmpty(finSysTenantParam.getName()) || finSysTenantParam.getName().length() > 100) { |
| | | IllegalStateException exception = new IllegalStateException( |
| | | "第" + analysisContext.readSheetHolder().getRowIndex() + "行,机构名称不能为空或长度大于100"); |
| | | throw exception; |
| | | } |
| | | finSysTenantParam.setParentId(pid); |
| | |
| | | finSysTenantParam.setSummary("系统导入"); |
| | | finSysTenantParams.add(finSysTenantParam); |
| | | } |
| | | |
| | | @Override |
| | | public void doAfterAllAnalysed(AnalysisContext analysisContext) { |
| | | finSysTenantService.insertFinSysTenantBatch(finSysTenantParams,sysInfo,lv); |
| | | finSysTenantService.insertFinSysTenantBatch(finSysTenantParams, sysInfo, lv); |
| | | } |
| | | |
| | | @Override |
| | | public void onException(Exception exception, AnalysisContext context) { |
| | | // 如果是某一个单元格的转换异常 能获取到具体行号 |
| | | if (exception instanceof ExcelDataConvertException) { |
| | | ExcelDataConvertException excelDataConvertException = (ExcelDataConvertException)exception; |
| | | logger.error("第{}行,第{}列解析异常,数据为:{}",excelDataConvertException.getRowIndex(), |
| | | excelDataConvertException.getColumnIndex()+1, excelDataConvertException.getCellData().getStringValue()); |
| | | throw new IllegalStateException("第"+(excelDataConvertException.getRowIndex()+1)+"行,第"+(excelDataConvertException.getColumnIndex()+1)+"列解析异常,异常数据为:[ "+excelDataConvertException.getCellData().getStringValue()+" ]"); |
| | | ExcelDataConvertException excelDataConvertException = (ExcelDataConvertException) exception; |
| | | logger.error("第{}行,第{}列解析异常,数据为:{}", excelDataConvertException.getRowIndex(), |
| | | excelDataConvertException.getColumnIndex() + 1, excelDataConvertException.getCellData().getStringValue()); |
| | | throw new IllegalStateException( |
| | | "第" + (excelDataConvertException.getRowIndex() + 1) + "行,第" + (excelDataConvertException.getColumnIndex() + 1) + "列解析异常,异常数据为:[ " |
| | | + excelDataConvertException.getCellData().getStringValue() + " ]"); |
| | | } |
| | | if (exception instanceof IllegalStateException){ |
| | | throw (IllegalStateException)exception; |
| | | if (exception instanceof IllegalStateException) { |
| | | throw (IllegalStateException) exception; |
| | | } |
| | | |
| | | } |
| | | |
| | | }).doReadAll(); |
| | | |
| | | return ResponseValue.success("导入成功!",1); |
| | | return ResponseValue.success("导入成功!", 1); |
| | | } |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/6 |
| | | */ |
| | |
| | | // if (finSysTenant1.getLv() != 1) { |
| | | // return ResponseValue.error("暂无修改权限"); |
| | | // } |
| | | int num = this.finSysTenantService.updateFinSysTenant(finSysTenant,this.getSysInfo()); |
| | | return num>0 ? ResponseValue.success(1):ResponseValue.error("编辑失败!"); |
| | | int num = this.finSysTenantService.updateFinSysTenant(finSysTenant, this.getSysInfo()); |
| | | return num > 0 ? ResponseValue.success(1) : ResponseValue.error("编辑失败!"); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | return ResponseValue.success(finSysTenantUserResults); |
| | | } |
| | | |
| | | @ApiOperation(value = "获取父级机构", notes = "获取父级机构") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "Authorization", value = "token", dataType = "String", paramType = "header"), |
| | | }) |
| | | @GetMapping("/get/parent/tenant") |
| | | public ResponseValue getParentTenant() { |
| | | FinSysTenantUser sysInfo = getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | String tenantId = sysInfo.getTenantId(); |
| | | FinSysTenant finSysTenant = new FinSysTenant(); |
| | | finSysTenant.setTempId(Long.valueOf(tenantId)); |
| | | FinSysTenant userTenant = this.finSysTenantService.get(finSysTenant); |
| | | Long parentId = userTenant.getParentId(); |
| | | //第一级 |
| | | if (parentId == 0) { |
| | | return ResponseValue.success(userTenant); |
| | | } else { |
| | | FinSysTenant param = new FinSysTenant(); |
| | | param.setTempId(Long.valueOf(parentId)); |
| | | FinSysTenant result = this.finSysTenantService.get(param); |
| | | return ResponseValue.success(result); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.MapUtils; |
| | | import com.consum.base.pojo.LWarehouseFlowParam; |
| | | import com.consum.base.pojo.response.WarehouseFlowVO; |
| | | import com.consum.base.service.LWarehouseFlowService; |
| | | import com.consum.base.core.utils.MapUtils; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.web.ResponseValue; |
| | |
| | | |
| | | return ResponseValue.success(genericPager); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/detail/list") |
| | | public ResponseValue queryFormProcureList1(LWarehouseFlowParam param) { |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | GenericPager<Map<String, Object>> genericPager = lWarehouseFlowService.queryBusinessFlow(param); |
| | | return ResponseValue.success(genericPager); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.core.utils.MapUtils; |
| | | import com.consum.base.pojo.LWhFormOutputInsertParam; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.pojo.LWhFormOutputParam; |
| | | import com.consum.base.pojo.query.LWhFormOutputQry; |
| | | import com.consum.base.pojo.response.FormOutputGoodsVO; |
| | | import com.consum.base.pojo.response.FormOutputTemplateInfoVO; |
| | | import com.consum.base.pojo.response.FormOutputVO; |
| | | import com.consum.base.pojo.response.GoodsModelVO; |
| | | import com.consum.base.pojo.response.LWhFormOutputExtendVO; |
| | | import com.consum.base.service.LWarehouseFlowService; |
| | | import com.consum.base.service.LWhFormOutputServiceImpl; |
| | | import com.consum.base.service.LWhGoodsService; |
| | | import com.consum.base.service.LWhProcureModelService; |
| | |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import javax.annotation.Resource; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | private LWhProcureModelService lWhProcureModelService; |
| | | @Autowired |
| | | private LWhGoodsService lWhGoodsService; |
| | | @Resource |
| | | private LWarehouseFlowService lWarehouseFlowService; |
| | | |
| | | /** |
| | | * @Description 新增出库单 |
| | |
| | | }) |
| | | @PostMapping("/add") |
| | | public ResponseValue add() { |
| | | LWhFormOutputInsertParam param = CommonUtil.getObjFromReqBody(LWhFormOutputInsertParam.class); |
| | | LWhFormOutputParam param = CommonUtil.getObjFromReqBody(LWhFormOutputParam.class); |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | |
| | | + "WHERE pm.BUSINESS_ID =:id GROUP BY bgm.GOODS_TEMPLATES_ID"; |
| | | Map<String, Object> paramMap = new HashMap<>(); |
| | | paramMap.put("id", item.getId()); |
| | | List<Map<String, Object>> procureModelList = lWhProcureModelService.select(sql, paramMap); |
| | | List<Map<String, Object>> procureModelList = lWhProcureModelService.select(sql, paramMap, new MapperUtil()); |
| | | for (Map<String, Object> map : procureModelList) { |
| | | FormOutputTemplateInfoVO procureTemplateInfoVO = MapUtils.convertMapToObj(MapUtils.toReplaceKeyLow(map), FormOutputTemplateInfoVO.class); |
| | | FormOutputTemplateInfoVO procureTemplateInfoVO = MapUtils.convertMapToObj(map, FormOutputTemplateInfoVO.class); |
| | | procureTemplateInfoList.add(procureTemplateInfoVO); |
| | | } |
| | | formOutputVO.setFormOutputTemplateInfoList(procureTemplateInfoList); |
| | |
| | | + "WHERE pm.BUSINESS_ID =:id GROUP BY bgt.id "; |
| | | Map<String, Object> paramMap = new HashMap<>(); |
| | | paramMap.put("id", lWhFormOutputExtendVO.getId()); |
| | | List<Map<String, Object>> procureModelList = lWhFormOutputService.select(sql, paramMap); |
| | | List<Map<String, Object>> procureModelList = lWhFormOutputService.select(sql, paramMap, new MapperUtil()); |
| | | List<FormOutputGoodsVO> fromOutputGoods = Lists.newArrayList(); |
| | | for (Map<String, Object> map : procureModelList) { |
| | | FormOutputGoodsVO procureTemplateInfoVO = MapUtils.convertMapToObj(MapUtils.toReplaceKeyLow(map), FormOutputGoodsVO.class); |
| | | FormOutputGoodsVO procureTemplateInfoVO = MapUtils.convertMapToObj(map, FormOutputGoodsVO.class); |
| | | |
| | | // 查询型号数量 |
| | | List<GoodsModelVO> goodsModelVOList = Lists.newArrayList(); |
| | |
| | | + "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); |
| | | List<Map<String, Object>> modelList = lWhFormOutputService.select(sql2, paramMap, new MapperUtil()); |
| | | modelList.forEach(item -> { |
| | | GoodsModelVO goodsModelVO = MapUtils.convertMapToObj(MapUtils.toReplaceKeyLow(item), GoodsModelVO.class); |
| | | GoodsModelVO goodsModelVO = MapUtils.convertMapToObj(item, GoodsModelVO.class); |
| | | goodsModelVOList.add(goodsModelVO); |
| | | }); |
| | | procureTemplateInfoVO.setModels(goodsModelVOList); |
| | |
| | | |
| | | @ApiOperation(value = "查询出库单详情明细", notes = "查询出库单详情明细") |
| | | @ApiImplicitParam(name = "formOutputQry", value = "出库单详情查询条件", required = true, dataType = "LWhFormOutputQry", paramType = "query") |
| | | @GetMapping("detail/list") |
| | | @GetMapping("/detail/list") |
| | | public ResponseValue queryFormOutputDetailList() { |
| | | LWhFormOutputQry formOutputQry = CommonUtil.getObjFromReq(LWhFormOutputQry.class); |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | |
| | | GenericPager genericPager = lWhFormOutputService.queryFormOutputDetailList(formOutputQry); |
| | | return ResponseValue.success(genericPager); |
| | | GenericPager<Map<String, Object>> mapGenericPager = lWarehouseFlowService.queryBusinessFlowDetail(formOutputQry); |
| | | return ResponseValue.success(mapGenericPager); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.core.utils.MapUtils; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.pojo.LWhFormProcureGoodsParams; |
| | | import com.consum.base.pojo.LWhFormProcureGoodsInfoParam; |
| | | import com.consum.base.pojo.LWhFormProcureParam; |
| | | import com.consum.base.pojo.LWhProcureModelParams; |
| | | import com.consum.base.pojo.LWhProcureModelParam; |
| | | import com.consum.base.pojo.query.FormProcureQry; |
| | | import com.consum.base.pojo.response.FormProcureVO; |
| | | import com.consum.base.pojo.response.FromProcureTemplateInfoVO; |
| | |
| | | String tenantId = sysTenantUser.getTenantId(); |
| | | String tenantName = sysTenantUser.getTenantName(); |
| | | |
| | | List<LWhFormProcureGoodsParams> procureGoods = param.getProcureGoods(); |
| | | List<LWhFormProcureGoodsInfoParam> procureGoods = param.getProcureGoods(); |
| | | if (CollectionUtils.isEmpty(procureGoods)) { |
| | | return ResponseValue.error("采购单不能为空"); |
| | | } |
| | |
| | | ArrayList<LWhProcureModel> procureModelList = new ArrayList<>(); |
| | | |
| | | for (int i = 0; i < procureGoods.size(); i++) { |
| | | LWhFormProcureGoodsParams procureGoodT = procureGoods.get(i); |
| | | LWhFormProcureGoodsInfoParam procureGoodT = procureGoods.get(i); |
| | | Long baseCategoryId = procureGoodT.getBaseCategoryId(); |
| | | Long baseGoodsTemplateId = procureGoodT.getBaseGoodsTemplateId(); |
| | | String supplier = procureGoodT.getSupplier(); |
| | |
| | | supplierList.add(supplier); |
| | | } |
| | | |
| | | List<LWhProcureModelParams> models = procureGoodT.getModels(); |
| | | List<LWhProcureModelParam> models = procureGoodT.getModels(); |
| | | if (CollectionUtils.isEmpty(models)) { |
| | | return ResponseValue.error("采购单不能为空"); |
| | | } |
| | |
| | | procureGood.setGoodsTemplateName(procureGoodT.getGoodsTemplateName()); |
| | | procureGood.setSupplier(supplier); |
| | | procureGood.setSort(i); |
| | | for (LWhProcureModelParams modelT : models) { |
| | | for (LWhProcureModelParam modelT : models) { |
| | | Integer counts = modelT.getCounts(); |
| | | if (counts == null || counts <= 0) { |
| | | return ResponseValue.error("型号的采购数量只能为正整数"); |
| | |
| | | + "where fpg.WH_FORM_PROCURE_ID =:id group by pm.FROM_PROCURE_GOODS_ID"; |
| | | Map<String, Object> paramMap = new HashMap<>(); |
| | | paramMap.put("id", item.getId()); |
| | | List<Map<String, Object>> procureModelList = lWhProcureModelService.select(sql, paramMap); |
| | | List<Map<String, Object>> procureModelList = lWhProcureModelService.select(sql, paramMap, new MapperUtil()); |
| | | for (Map<String, Object> map : procureModelList) { |
| | | FromProcureTemplateInfoVO procureTemplateInfoVO = MapUtils.convertMapToObj(MapUtils.toReplaceKeyLow(map), FromProcureTemplateInfoVO.class); |
| | | FromProcureTemplateInfoVO procureTemplateInfoVO = MapUtils.convertMapToObj(map, FromProcureTemplateInfoVO.class); |
| | | procureTemplateInfoList.add(procureTemplateInfoVO); |
| | | } |
| | | fromProcureVO.setFromProcureTemplateInfoList(procureTemplateInfoList); |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.pojo.*; |
| | | import com.consum.base.pojo.LWhFormScrappedExtend; |
| | | import com.consum.base.pojo.LWhFormScrappedParam; |
| | | import com.consum.base.service.LWhFormScrappedGoodsService; |
| | | import com.consum.base.service.LWhFormScrappedServiceImpl; |
| | | import com.consum.model.po.*; |
| | | import com.consum.model.vo.LWhFormOutputVo; |
| | | import com.consum.model.vo.LWhFormTransferVo; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormScrapped; |
| | | import com.consum.model.po.LWhFormScrappedGoods; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | | import com.walker.web.ResponseValue; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | 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.RestController; |
| | | |
| | | /** |
| | | * @Description 报废单 |
| | |
| | | private LWhFormScrappedGoodsService scrappedGoodsService; |
| | | |
| | | /** |
| | | * @Description 新增报废单 |
| | | * @Description 新增报废单 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/11/1 |
| | | */ |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody LWhFormScrappedParam param) { |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | int result = this.lWhFormScrappedService.add(param, this.getCurrentUser(),sysInfo); |
| | | if (result > 0) return ResponseValue.success(1); |
| | | int result = this.lWhFormScrappedService.add(param, this.getCurrentUser(), sysInfo); |
| | | if (result > 0) { |
| | | return ResponseValue.success(1); |
| | | } |
| | | return ResponseValue.error("新增失败!"); |
| | | } |
| | | |
| | | /** |
| | | * @Description 列表查询 |
| | | * @Description 列表查询 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/11/02 |
| | | */ |
| | |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | |
| | | GenericPager genericPager = lWhFormScrappedService.queryList(param,sysInfo); |
| | | GenericPager genericPager = lWhFormScrappedService.queryList(param, sysInfo); |
| | | List<LWhFormScrapped> datas = genericPager.getDatas(); |
| | | ArrayList<LWhFormScrappedExtend> newDatas = new ArrayList<>(); |
| | | if (!CollectionUtils.isEmpty(datas)) { |
| | |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据id查询详情 |
| | | * @Description 根据id查询详情 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/11/2 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 报废明细 |
| | | * |
| | | * @param param |
| | | * @return |
| | | */ |
| | |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | GenericPager<Map<String, Object>> genericPager = lWhFormScrappedService.queryDetailList(param,sysInfo); |
| | | GenericPager<Map<String, Object>> genericPager = lWhFormScrappedService.queryDetailList(param, sysInfo); |
| | | return ResponseValue.success(genericPager); |
| | | } |
| | | |
| | | /** |
| | | * @Description 导出报废登记单 |
| | | * @Description 导出报废登记单 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/11/2 |
| | | */ |
| | |
| | | if (id == null) { |
| | | return ResponseValue.error("报废单id为空"); |
| | | } |
| | | LWhFormScrappedExtend scrappedExtend = this.lWhFormScrappedService.export(id,this.getSysInfo()); |
| | | LWhFormScrappedExtend scrappedExtend = this.lWhFormScrappedService.export(id, this.getSysInfo()); |
| | | return ResponseValue.success(scrappedExtend); |
| | | } |
| | | |
| | |
| | | package com.consum.base.controller; |
| | | |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.core.utils.MapUtils; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.pojo.LWhFormTransferGoodsInfoParam; |
| | | import com.consum.base.pojo.LWhFormTransferParam; |
| | | import com.consum.base.pojo.LWhProcureModelParams; |
| | | import com.consum.base.pojo.ProcureModelInfoDto; |
| | | import com.consum.base.pojo.UseRecordDto; |
| | | import com.consum.base.pojo.UseRecordSkuDto; |
| | | import com.consum.base.pojo.query.TransferQry; |
| | | import com.consum.base.pojo.response.FormTransferVO; |
| | | import com.consum.base.pojo.response.FromTransferTemplateInfoVO; |
| | | import com.consum.base.pojo.response.LWHFromTransferExtendVO; |
| | | import com.consum.base.pojo.response.TransferInfoVO; |
| | | import com.consum.base.service.BaseGoodsModelsServiceImpl; |
| | | import com.consum.base.service.BaseWarehouseServiceImpl; |
| | | import com.consum.base.service.LWhFormTransferCoreService; |
| | | import com.consum.base.service.LWhFormTransferServiceImpl; |
| | | import com.consum.base.service.LWhProcureModelService; |
| | | import com.consum.base.service.LWhProcureModelUserRecordServiceImpl; |
| | | import com.consum.base.service.LWhProcureModelUserServiceImpl; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.model.po.BaseGoodsModels; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormTransfer; |
| | |
| | | import com.consum.model.po.LWhProcureModelUser; |
| | | import com.consum.model.po.LWhProcureModelUserRecord; |
| | | import com.consum.model.vo.LWhFormOutputVo; |
| | | import com.consum.model.vo.LWhFormTransferVo; |
| | | import com.consum.model.vo.LWhProcureModelVo; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.CollectionUtils; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.lang.reflect.Field; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import org.apache.commons.compress.utils.Lists; |
| | |
| | | @Autowired |
| | | private LWhFormTransferServiceImpl lWhFormTransferService; |
| | | @Autowired |
| | | private BaseWarehouseServiceImpl baseWarehouseService; |
| | | @Autowired |
| | | private LWhProcureModelService lWhProcureModelService; |
| | | @Autowired |
| | | private LWhFormTransferCoreService lWhFormTransferCoreService; |
| | |
| | | @ApiOperation(value = "单据新增", notes = "单据新增") |
| | | @ApiImplicitParam(name = "param", value = "单据新增", required = true, dataType = "LWhFormTransferParam") |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody LWhFormTransferParam param) { |
| | | public ResponseValue add(@RequestBody LWhFormTransferParam param) throws Exception { |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | List<LWhProcureModelParams> transferGoods = param.getModels(); |
| | | List<LWhFormTransferGoodsInfoParam> transferGoods = param.getTransferGoods(); |
| | | if (CollectionUtils.isEmpty(transferGoods)) { |
| | | return ResponseValue.error("调拨单不能为空"); |
| | | } |
| | | int result = this.lWhFormTransferService.add(param, currentUser, this.getSysInfo()); |
| | | int result = this.lWhFormTransferService.add(param, this.getSysInfo()); |
| | | if (result > 0) { |
| | | return ResponseValue.success(1); |
| | | } |
| | |
| | | * @Description 列表查询(调拨明细) |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/30 |
| | | * <p> |
| | | * 1.查询调拨单 |
| | | * <p> |
| | | * 2.查询物品型号 |
| | | */ |
| | | // 1.查询调拨单 |
| | | // 2.查询物品型号 |
| | | @ApiOperation(value = "单据列表查询", notes = "单据列表查询") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "page", value = "页码", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "size", value = "每页条数", required = true, dataType = "int"), |
| | | @ApiImplicitParam(name = "param", value = "条件参数", required = true, dataType = "TransferQry"), |
| | | }) |
| | | @GetMapping("/list") |
| | | public ResponseValue queryFormTransferList(TransferQry param) { |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | FinSysTenantUser sysInfo = getSysInfo(); |
| | | |
| | | //只能查询本级 及以下机构的调拨单 |
| | | //?????? |
| | | |
| | | GenericPager genericPager = lWhFormTransferService.queryFormTransferList(param); |
| | | List<LWhFormTransfer> datas = genericPager.getDatas(); |
| | | ArrayList<LWhFormTransferVo> newDatas = new ArrayList<>(); |
| | | ArrayList<FormTransferVO> result = new ArrayList<>(); |
| | | if (!CollectionUtils.isEmpty(datas)) { |
| | | datas.forEach(item -> { |
| | | FormTransferVO formTransferVO = new FormTransferVO(); |
| | | BeanUtils.copyProperties(item, formTransferVO); |
| | | |
| | | List<FromTransferTemplateInfoVO> templateInfoList = Lists.newArrayList(); |
| | | |
| | | // 查询型号数量 |
| | | String sql = "SELECT bgt.id,bgm.GOODS_TEMPLATES_ID,GOODS_NAME,sum( counts ) count FROM " |
| | | + "l_wh_procure_model pm LEFT JOIN base_goods_models bgm ON pm.BASE_GOODS_MODELS_ID = bgm.id " |
| | | + "LEFT JOIN base_goods_template bgt ON bgm.GOODS_TEMPLATES_ID = bgt.id " |
| | | + "WHERE pm.BUSINESS_ID =:id GROUP BY bgm.GOODS_TEMPLATES_ID"; |
| | | Map<String, Object> paramMap = new HashMap<>(); |
| | | paramMap.put("id", item.getId()); |
| | | List<Map<String, Object>> procureModelList = lWhProcureModelService.select(sql, paramMap, new MapperUtil()); |
| | | for (Map<String, Object> map : procureModelList) { |
| | | FromTransferTemplateInfoVO procureTemplateInfoVO = MapUtils.convertMapToObj(map, FromTransferTemplateInfoVO.class); |
| | | templateInfoList.add(procureTemplateInfoVO); |
| | | } |
| | | formTransferVO.setFromTransferTemplateInfoList(templateInfoList); |
| | | |
| | | result.add(formTransferVO); |
| | | |
| | | |
| | | /*// 查询型号数量 |
| | | LWhProcureModel lWhProcureModel = new LWhProcureModel(); |
| | | Integer businessType = item.getBusinessType(); |
| | | // TODO 调拨=0 分发=1 退回=2 |
| | |
| | | break; |
| | | } |
| | | lWhProcureModel.setBusinessId(item.getId()); |
| | | |
| | | LWhFormTransferVo formTransferExtend = new LWhFormTransferVo(); |
| | | BeanUtils.copyProperties(item, formTransferExtend); |
| | | |
| | | List<LWhProcureModel> models = lWhProcureModelService.select(lWhProcureModel); |
| | | List<LWhProcureModelVo> lWhProcureModelVoList = new ArrayList<>(); |
| | | if (!CollectionUtils.isEmpty(models)) { |
| | |
| | | lWhProcureModelVoList.add(lWhProcureModelVo); |
| | | }); |
| | | } |
| | | |
| | | formTransferExtend.setModels(lWhProcureModelVoList); |
| | | newDatas.add(formTransferExtend); |
| | | newDatas.add(formTransferExtend);*/ |
| | | }); |
| | | } |
| | | try { |
| | | Field fieldDatas = GenericPager.class.getDeclaredField("datas"); |
| | | fieldDatas.setAccessible(true); |
| | | fieldDatas.set(genericPager, newDatas); |
| | | fieldDatas.set(genericPager, result); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/30 |
| | | */ |
| | | @ApiOperation(value = "根据id查询详情", notes = "根据id查询详情") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "调拨单id", required = true, dataType = "Long"), |
| | | }) |
| | | @GetMapping("/detail") |
| | | public ResponseValue getById(Long id) { |
| | | if (id == null) { |
| | | return ResponseValue.error("调拨单id为空"); |
| | | } |
| | | LWhFormTransferVo vo = this.lWhFormTransferService.getById(id); |
| | | LWHFromTransferExtendVO vo = this.lWhFormTransferService.getById(id); |
| | | return ResponseValue.success(vo); |
| | | } |
| | | |
| | |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/31 |
| | | */ |
| | | @ApiOperation(value = "撤销", notes = "撤销") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "调拨单id", required = true, dataType = "Long"), |
| | | }) |
| | | @PostMapping("/updStatus") |
| | | public ResponseValue updateStatus(Long id) { |
| | | if (id == null) { |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/31 |
| | | */ |
| | | @ApiOperation(value = "调拨入库", notes = "调拨入库") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "调拨单id", required = true, dataType = "Long"), |
| | | }) |
| | | @PostMapping("/income") |
| | | public ResponseValue income(Long id) { |
| | | lWhFormTransferCoreService.doTransferInPut(id, getCurrentUser()); |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/31 |
| | | */ |
| | | @ApiOperation(value = "调拨出库", notes = "调拨出库") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "调拨单id", required = true, dataType = "Long"), |
| | | }) |
| | | @PostMapping("/output") |
| | | public ResponseValue output(Long id) { |
| | | lWhFormTransferCoreService.doTransferOutPut(id, getCurrentUser()); |
| | |
| | | }) |
| | | @GetMapping("/query/detail") |
| | | public ResponseValue queryDepartmentTransferOrder(Long agencyId) { |
| | | |
| | | |
| | | |
| | | |
| | | TransferInfoVO transferInfoVO = new TransferInfoVO(); |
| | | return ResponseValue.success(transferInfoVO); |
File was renamed from consum-base/src/main/java/com/consum/base/pojo/LWFormsOutputGoodsParam.java |
| | |
| | | */ |
| | | @ApiModel(value = "记录物品信息和规格型号") |
| | | @Data |
| | | public class LWFormsOutputGoodsParam { |
| | | public class LWFormsOutputGoodsInfoParam { |
| | | |
| | | |
| | | /** |
File was renamed from consum-base/src/main/java/com/consum/base/pojo/LWhFormOutputInsertParam.java |
| | |
| | | */ |
| | | @ApiModel(value = "LWhFormOutputInsertParam") |
| | | @Data |
| | | public class LWhFormOutputInsertParam extends ParamRequest { |
| | | public class LWhFormOutputParam extends ParamRequest { |
| | | |
| | | /** |
| | | * 仓库id |
| | |
| | | * 记录物品信息和规格型号 |
| | | */ |
| | | @ApiModelProperty(value = "记录物品信息和规格型号") |
| | | private List<LWFormsOutputGoodsParam> goods; |
| | | private List<LWFormsOutputGoodsInfoParam> goods; |
| | | |
| | | |
| | | } |
File was renamed from consum-base/src/main/java/com/consum/base/pojo/LWhFormProcureGoodsParams.java |
| | |
| | | * @Version 1.0 |
| | | **/ |
| | | @Data |
| | | public class LWhFormProcureGoodsParams extends ParamRequest { |
| | | public class LWhFormProcureGoodsInfoParam extends ParamRequest { |
| | | |
| | | //分类编号 |
| | | private Long baseCategoryId = null; |
| | |
| | | //供应商 |
| | | private String supplier = null; |
| | | |
| | | private List<LWhProcureModelParams> models; |
| | | private List<LWhProcureModelParam> models; |
| | | |
| | | // 主键 |
| | | private Long id = null; |
| | |
| | | /** |
| | | * 采购单型号 |
| | | */ |
| | | private List<LWhFormProcureGoodsParams> procureGoods; |
| | | private List<LWhFormProcureGoodsInfoParam> procureGoods; |
| | | |
| | | public Long getWarehouseId() { |
| | | return warehouseId; |
| | | } |
| | | |
| | | public void setWarehouseId(Long warehouseId) { |
| | | this.warehouseId = warehouseId; |
| | | } |
| | | |
| | | public String getProcureDoc() { |
| | | return procureDoc; |
| | | } |
| | | |
| | | public void setProcureDoc(String procureDoc) { |
| | | this.procureDoc = procureDoc; |
| | | } |
| | | |
| | | public Integer getBuyType() { |
| | | return buyType; |
| | | } |
| | | |
| | | public void setBuyType(Integer buyType) { |
| | | this.buyType = buyType; |
| | | } |
| | | |
| | | public List<LWhFormProcureGoodsParams> getProcureGoods() { |
| | | return procureGoods; |
| | | } |
| | | |
| | | public void setProcureGoods(List<LWhFormProcureGoodsParams> procureGoods) { |
| | | this.procureGoods = procureGoods; |
| | | } |
| | | |
| | | /** |
| | | * 入库单号 |
| | |
| | | */ |
| | | private Long incomeTimeEnd; |
| | | |
| | | public String getBusinessFormCode() { |
| | | return businessFormCode; |
| | | } |
| | | |
| | | public void setBusinessFormCode(String businessFormCode) { |
| | | this.businessFormCode = businessFormCode; |
| | | } |
| | | |
| | | public String getGoodsTemplateName() { |
| | | return goodsTemplateName; |
| | | } |
| | | |
| | | public void setGoodsTemplateName(String goodsTemplateName) { |
| | | this.goodsTemplateName = goodsTemplateName; |
| | | } |
| | | |
| | | public Long getAgencyId() { |
| | | return agencyId; |
| | | } |
| | | |
| | | public void setAgencyId(Long agencyId) { |
| | | this.agencyId = agencyId; |
| | | } |
| | | |
| | | public String getBuyerName() { |
| | | return buyerName; |
| | | } |
| | | |
| | | public void setBuyerName(String buyerName) { |
| | | this.buyerName = buyerName; |
| | | } |
| | | |
| | | public Short getStates() { |
| | | return states; |
| | | } |
| | | |
| | | public void setStates(Short states) { |
| | | this.states = states; |
| | | } |
| | | |
| | | public Long getIncomeTimeStart() { |
| | | return incomeTimeStart; |
| | | } |
| | | |
| | | public void setIncomeTimeStart(Long incomeTimeStart) { |
| | | this.incomeTimeStart = incomeTimeStart; |
| | | } |
| | | |
| | | public Long getIncomeTimeEnd() { |
| | | return incomeTimeEnd; |
| | | } |
| | | |
| | | public void setIncomeTimeEnd(Long incomeTimeEnd) { |
| | | this.incomeTimeEnd = incomeTimeEnd; |
| | | } |
| | | |
| | | public Long getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(Long id) { |
| | | this.id = id; |
| | | } |
| | | } |
New file |
| | |
| | | package com.consum.base.pojo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.util.List; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @ClassName LWhFormProcureGoodsParams |
| | | * @Date 2023/10/27 |
| | | * @Description 调拨单型号 |
| | | * @Version 1.0 |
| | | **/ |
| | | @Data |
| | | @ApiModel(value = "调拨单型号") |
| | | public class LWhFormTransferGoodsInfoParam { |
| | | |
| | | // 主键 |
| | | private Long id; |
| | | //分类编号 |
| | | private Long baseCategoryId; |
| | | //物品模版编号 |
| | | private Long baseGoodsTemplateId; |
| | | //供应商 |
| | | private String supplier; |
| | | |
| | | private String goodsTemplateName; |
| | | |
| | | private Integer sort; |
| | | |
| | | @ApiModelProperty(value = "单据类型 1 采购2 调拨 3出库4部门分发") |
| | | private Integer procureModelBusinessType; |
| | | |
| | | @ApiModelProperty(value = "规格型号编号") |
| | | private Long baseGoodsModelsId; |
| | | |
| | | private List<LWhTransferModelParam> models; |
| | | |
| | | |
| | | } |
| | |
| | | package com.consum.base.pojo; |
| | | |
| | | import com.walker.web.param.ParamRequest; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.util.List; |
| | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class LWhFormTransferParam extends ParamRequest { |
| | | public class LWhFormTransferParam { |
| | | |
| | | @ApiModelProperty(value = "主键") |
| | | private Long id; |
| | |
| | | @ApiModelProperty(value = "调拨手续") |
| | | private String procureDoc; |
| | | /** |
| | | * 调拨单型号 |
| | | */ |
| | | @ApiModelProperty(value = "调拨单型号") |
| | | private List<LWhProcureModelParams> models; |
| | | /** |
| | | * 物品id |
| | | */ |
| | | @ApiModelProperty(value = "物品id") |
| | | private Long baseGoodsTemplateId; |
| | | /** |
| | | * 物品模版名称 |
| | | */ |
| | | @ApiModelProperty(value = "物品模版名称") |
| | | private String goodsTemplateName; |
| | | /** |
| | | * 调拨单号 |
| | | */ |
| | | @ApiModelProperty(value = "调拨单号") |
| | | private String businessFormCode; |
| | | /** |
| | | * 接收机构 |
| | | */ |
| | | @ApiModelProperty(value = "接收机构") |
| | | private Long inAgencyId; |
| | | /** |
| | | * 状态 0=待出库;1=待接收;2=已入库 |
| | | */ |
| | | @ApiModelProperty(value = "状态 0=待出库;1=待接收;2=已入库") |
| | | private Short states; |
| | | /** |
| | | * 创建人 |
| | | */ |
| | | @ApiModelProperty(value = "创建人") |
| | | private String operatorName; |
| | | /** |
| | | * 申请时间 开始 |
| | | */ |
| | | @ApiModelProperty(value = "申请时间 开始") |
| | | private Long createTimeStart; |
| | | /** |
| | | * 申请时间 结束 |
| | | */ |
| | | @ApiModelProperty(value = "申请时间 结束") |
| | | private Long createTimeEnd; |
| | | /** |
| | | * 接收时间 开始 |
| | | */ |
| | | @ApiModelProperty(value = "接收时间 开始") |
| | | private Long inTimeStart; |
| | | /** |
| | | * 接收时间 结束 |
| | | */ |
| | | @ApiModelProperty(value = "接收时间 结束") |
| | | private Long inTimeEnd; |
| | | |
| | | /** |
| | | * 单据类型。0仓库调拨;1部门分发;2部门物品回退 |
| | | */ |
| | | @ApiModelProperty(value = "单据类型。0仓库调拨;1部门分发;2部门物品回退") |
| | | private Integer transferBusinessType; |
| | | |
| | | /** |
| | | * 部门物品使用人 |
| | | * TODO 属性重复 |
| | | * 调拨单型号 |
| | | */ |
| | | @ApiModelProperty(value = "部门物品使用人") |
| | | private List<LWhProcureModelUserDTO> procureModelUserList; |
| | | @ApiModelProperty(value = "调拨单型号") |
| | | private List<LWhFormTransferGoodsInfoParam> transferGoods; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.consum.base.pojo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.util.List; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @ClassName LWhProcureModelParams |
| | | * @Date 2023/10/27 |
| | | * @Description |
| | | * @Version 1.0 |
| | | **/ |
| | | @ApiModel(value = "调拨单规格型号") |
| | | @Data |
| | | public class LWhProcureModelParam { |
| | | |
| | | //规格型号编号 |
| | | @ApiModelProperty(value = "规格型号编号") |
| | | private Long baseGoodsModelsId; |
| | | //价格 |
| | | @ApiModelProperty(value = "价格") |
| | | private Long price; |
| | | //数量 |
| | | @ApiModelProperty(value = "数量") |
| | | private Integer counts; |
| | | // 单据类型 1 采购2 调拨 3出库4部门分发 |
| | | @ApiModelProperty(value = "单据类型 1 采购2 调拨 3出库4部门分发") |
| | | private Integer procureModelBusinessType; |
| | | // 计量单位 |
| | | @ApiModelProperty(value = "计量单位") |
| | | private String baseUnit; |
| | | |
| | | @ApiModelProperty(value = "用户规格型号") |
| | | private List<LWhProcureModelUserParam> procureModelUserList; |
| | | |
| | | } |
File was renamed from consum-base/src/main/java/com/consum/base/pojo/LWhProcureModelUserDTO.java |
| | |
| | | @Data |
| | | @AllArgsConstructor |
| | | @NoArgsConstructor |
| | | public class LWhProcureModelUserDTO { |
| | | public class LWhProcureModelUserParam { |
| | | |
| | | /** |
| | | * 调拨业务ID |
New file |
| | |
| | | package com.consum.base.pojo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.util.List; |
| | | import lombok.Data; |
| | | |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: 调拨单规格型号 |
| | | * @date 2023/11/6 9:28 |
| | | */ |
| | | @ApiModel(value = "调拨单规格型号") |
| | | @Data |
| | | public class LWhTransferModelParam { |
| | | |
| | | // //规格型号编号 |
| | | @ApiModelProperty(value = "规格型号编号") |
| | | private Long baseGoodsModelsId; |
| | | //价格 |
| | | @ApiModelProperty(value = "价格") |
| | | private Long price; |
| | | //数量 |
| | | @ApiModelProperty(value = "数量") |
| | | private Integer counts; |
| | | // 单据类型 1 采购2 调拨 3出库4部门分发 |
| | | @ApiModelProperty(value = "单据类型 1 采购2 调拨 3出库4部门分发") |
| | | private Integer procureModelBusinessType; |
| | | // 计量单位 |
| | | @ApiModelProperty(value = "计量单位") |
| | | private String baseUnit; |
| | | |
| | | @ApiModelProperty(value = "用户规格型号") |
| | | private List<LWhProcureModelUserParam> procureModelUserList; |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "创建人") |
| | | private String createName; |
| | | /** |
| | | * 1=待入库;2=已入库 |
| | | * 采购入库 map.put("1" + "1", "1") |
| | | * 调拨入库 map.put("2" + "1", "2") |
| | | * 调拨出库 map.put("2" + "2", "3") |
| | | * 其他出库 map.put("3" + "1", "4") |
| | | * 其他出库 map.put("3" + "2", "5") |
| | | * 退还入库 map.put("4" + "1", "6") |
| | | * 申领出库 map.put("4" + "2", "7") |
| | | */ |
| | | @ApiModelProperty(value = "1=待入库;2=已入库") |
| | | @ApiModelProperty(value = "1=采购入库,2=调拨入库,") |
| | | private Integer states; |
| | | |
| | | /** |
New file |
| | |
| | | package com.consum.base.pojo.response; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonProperty; |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | import lombok.NoArgsConstructor; |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: TODO |
| | | * @date 2023/11/14 16:52 |
| | | */ |
| | | @NoArgsConstructor |
| | | @Data |
| | | @ApiModel |
| | | public class DetailVO { |
| | | |
| | | @JsonProperty("thisType") |
| | | private Integer thisType; |
| | | @JsonProperty("dealTime") |
| | | private Long dealTime; |
| | | @JsonProperty("businessFormId") |
| | | private Long businessFormId; |
| | | @JsonProperty("totalPrice") |
| | | private Object totalPrice; |
| | | @JsonProperty("businessFormCode") |
| | | private Object businessFormCode; |
| | | @JsonProperty("baseGoodsModelsName") |
| | | private String baseGoodsModelsName; |
| | | @JsonProperty("createdName") |
| | | private Object createdName; |
| | | @JsonProperty("businessType") |
| | | private Integer businessType; |
| | | @JsonProperty("thisCount") |
| | | private Integer thisCount; |
| | | @JsonProperty("goodsTemplateName") |
| | | private String goodsTemplateName; |
| | | @JsonProperty("agencyName") |
| | | private Object agencyName; |
| | | } |
New file |
| | |
| | | package com.consum.base.pojo.response; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import java.util.List; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: 出库单物品模板信息 |
| | | * @date 2023/11/15 18:06 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "FormTransferGoodsVO") |
| | | public class FormTransferGoodsVO { |
| | | |
| | | // 主键 |
| | | private Long id; |
| | | //分类编号 |
| | | private Long categoryId; |
| | | //分类名称 |
| | | private String categoryName; |
| | | //物品模版编号 |
| | | private Long baseGoodsTemplateId; |
| | | |
| | | private String goodsName; |
| | | |
| | | private List<GoodsModelVO> models; |
| | | |
| | | } |
New file |
| | |
| | | package com.consum.base.pojo.response; |
| | | |
| | | import com.consum.model.po.LWhFormTransfer; |
| | | import io.swagger.annotations.ApiModel; |
| | | import java.util.List; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: 调拨单列表信息 |
| | | * @date 2023/11/15 17:27 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "调拨单列表信息") |
| | | public class FormTransferVO extends LWhFormTransfer { |
| | | |
| | | /** |
| | | * 规格型号 |
| | | */ |
| | | private List<FromTransferTemplateInfoVO> fromTransferTemplateInfoList; |
| | | |
| | | } |
New file |
| | |
| | | package com.consum.base.pojo.response; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: 调拨物品模板信息 |
| | | * @modified By |
| | | * @date 2023/11/15 17:35 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "调拨物品模板信息") |
| | | public class FromTransferTemplateInfoVO { |
| | | |
| | | private Long id; |
| | | private Long goodsTemplatesId; |
| | | private String goodsName; |
| | | private Object count; |
| | | } |
| | |
| | | private Integer counts; |
| | | private Integer worehouseCount; |
| | | private Long baseGoodsModelsId; |
| | | private Long totalAmount; |
| | | private Integer totalAmount; |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.consum.base.pojo.response; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: 物品模板信息 |
| | | * @date 2023/11/15 13:38 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "物品模板信息") |
| | | public class GoodsTemplateVO { |
| | | |
| | | private Long id; |
| | | private String goodsName; |
| | | |
| | | } |
New file |
| | |
| | | package com.consum.base.pojo.response; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import java.util.List; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author asus |
| | | * @version 1.0 |
| | | * @description: 调拨单扩展详细信息 |
| | | * @date 2023/11/15 18:02 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "LWHFromTransferExtendVO") |
| | | public class LWHFromTransferExtendVO { |
| | | |
| | | |
| | | // 主键 |
| | | private Long id; |
| | | |
| | | // 属性列表 |
| | | private Long inWarehouseFormId; |
| | | |
| | | private Long inWarehouseFlowId; |
| | | |
| | | private Long outWarehouseFlowId; |
| | | |
| | | private Long outWarehouseFormId; |
| | | |
| | | private Integer businessType; |
| | | |
| | | private String businessFormCode; |
| | | |
| | | private Integer inWarehouseType; |
| | | |
| | | private Long inWarehouseId; |
| | | |
| | | private String inWarehouseName; |
| | | |
| | | private Integer outWarehouseType; |
| | | |
| | | private Long outWarehouseId; |
| | | |
| | | private String outWarehouseName; |
| | | |
| | | private Long inAgencyId; |
| | | |
| | | private String inAgencyName; |
| | | |
| | | private Long outAgencyId; |
| | | |
| | | private String outAgencyName; |
| | | |
| | | private Long operatorId; |
| | | |
| | | private String operatorName; |
| | | |
| | | private Long createTime; |
| | | |
| | | private Integer states; |
| | | |
| | | private Long inOperatorId; |
| | | |
| | | private String inOperatorName; |
| | | |
| | | private Long inTime; |
| | | |
| | | private Long outOperatorId; |
| | | |
| | | private String outOperatorName; |
| | | |
| | | private Long outputTime; |
| | | |
| | | private String procureDoc; |
| | | |
| | | private List<FormTransferGoodsVO> formTransferGoods; |
| | | } |
| | |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM base_goods_template WHERE 1=1 "); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | if (agencyId != null) { |
| | | sql.append("AND AGENCY_ID=:agencyId"); |
| | | sql.append("AND AGENCY_ID=:agencyId "); |
| | | params.put("agencyId", agencyId); |
| | | } |
| | | if (categoryId != null) { |
| | | sql.append("AND CATEGORY_ID=:categoryId"); |
| | | sql.append("AND CATEGORY_ID=:categoryId "); |
| | | params.put("categoryId", categoryId); |
| | | } |
| | | return this.select(sql.toString(), params, new BaseGoodsTemplate()); |
| | |
| | | |
| | | import com.consum.base.Constants; |
| | | import com.consum.base.core.CodeGeneratorService; |
| | | import com.consum.base.pojo.BaseWarehouseParam; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.model.po.*; |
| | | import com.consum.base.pojo.BaseWarehouseParam; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenant; |
| | | import com.consum.model.po.FinSysTenantDepartment; |
| | | import com.consum.model.po.SDictData; |
| | | import com.walker.db.page.GenericPager; |
| | | 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.HashMap; |
| | | import java.util.List; |
| | | import java.util.Set; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Description 仓库管理 |
| | |
| | | |
| | | /** |
| | | * 根据id查询仓库详情 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @Date 2023/10/26 |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据机构id查询机构仓库 |
| | | * @return |
| | | * @Description 根据机构id查询机构仓库 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/27 |
| | | * @return |
| | | */ |
| | | public List<BaseWarehouse> getByAgencyId(Long agencyId) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM base_warehouse WHERE 1 = 1 "); |
| | |
| | | } |
| | | return select(sql.toString(), paramts, new BaseWarehouse()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 根据机构id查询默认仓库 |
| | | * |
| | | * @param agencyId |
| | | * @return |
| | | */ |
| | | public BaseWarehouse getDefaultWarehouseByAgencyId(Long agencyId) { |
| | | StringBuilder sql = new StringBuilder("SELECT * FROM base_warehouse WHERE IS_DEFAULT = 1 and AGENCY_ID =:agencyId "); |
| | | Map<String, Object> param = new HashMap<>(); |
| | | param.put("agencyId", agencyId); |
| | | List<BaseWarehouse> select = select(sql.toString(), param, new BaseWarehouse()); |
| | | Optional<BaseWarehouse> optional = select.stream().findFirst(); |
| | | if (optional.isPresent()) { |
| | | return optional.get(); |
| | | } |
| | | return null; |
| | | } |
| | | } |
| | |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class FinSysTenantServiceImpl extends BaseServiceImpl { |
| | |
| | | |
| | | /** |
| | | * @Author :power |
| | | * @Date : 2023/7/20 20:41 |
| | | * 获取区划信息 主要用于缓存 |
| | | * @Date : 2023/7/20 20:41 获取区划信息 主要用于缓存 |
| | | */ |
| | | public FinSysTenant queryOneByCode(String code) { |
| | | FinSysTenant tenant = new FinSysTenant(); |
| | |
| | | |
| | | /** |
| | | * @Author :power |
| | | * @Date : 2023/7/20 16:34 |
| | | * 根据id 查询下级所有节点 地市查询自己 省查询所有地市 |
| | | * @Date : 2023/7/20 16:34 根据id 查询下级所有节点 地市查询自己 省查询所有地市 |
| | | */ |
| | | public List<FinSysTenant> queryTreeById(Long id, Integer lv) { |
| | | if (lv == 3) { |
| | |
| | | |
| | | /** |
| | | * @Author :power |
| | | * @Date : 2023/7/21 14:46 |
| | | * 特殊数据 禁止其他接口使用 |
| | | * @Date : 2023/7/21 14:46 特殊数据 禁止其他接口使用 |
| | | */ |
| | | public Map<Long, List<FinSysTenant>> queryCountyByCityCode(Long id, Integer lv) { |
| | | Map<String, Object> parameter = new HashMap<>(5); |
| | |
| | | } |
| | | |
| | | /** |
| | | * @Description 根据区划CODE查询区划信息 |
| | | * @Description 根据parentId查询 |
| | | * @Author wh |
| | | * @Date 2023/9/11 19:16 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/4 |
| | | */ |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 添加机构 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/4 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 批量添加机构 |
| | | * |
| | | * @author jlq |
| | | * @date 2023/10/9 |
| | | */ |
| | | public void insertFinSysTenantBatch(List<FinSysTenantParam> params, FinSysTenantUser sysInfo, int lv){ |
| | | public void insertFinSysTenantBatch(List<FinSysTenantParam> params, FinSysTenantUser sysInfo, int lv) { |
| | | for (FinSysTenantParam param : params) { |
| | | addFinSysTenant(param,sysInfo,lv); |
| | | addFinSysTenant(param, sysInfo, lv); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 编辑 |
| | | * |
| | | * @author 卢庆阳 |
| | | * @date 2023/10/6 |
| | | */ |
| | |
| | | package com.consum.base.service; |
| | | |
| | | import com.consum.base.core.utils.MapRowMapper; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.pojo.LWarehouseFlowParam; |
| | | import com.consum.base.pojo.query.LWhFormOutputQry; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.StringUtils; |
| | | import com.walker.jdbc.service.BaseServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * @ClassName LWarehouseFlowService |
| | |
| | | * @param param |
| | | * @return |
| | | */ |
| | | private static String QUERY_BUSINESS_FLOW = "SELECT flow.BUSINESS_TYPE,flow.BUSINESS_FORM_ID,CASE WHEN flow.BUSINESS_TYPE=1 THEN tCaiGou.BUSINESS_FORM_CODE WHEN flow.BUSINESS_TYPE=3 THEN tFormOut.BUSINESS_FORM_CODE END BUSINESS_FORM_CODE,record.GOODS_TEMPLATE_NAME,record.BASE_GOODS_MODELS_NAME,record.THIS_COUNT,record.THIS_TYPE,record.total_price,CASE WHEN flow.BUSINESS_TYPE=1 THEN tCaiGou.AGENCY_NAME WHEN flow.BUSINESS_TYPE=3 THEN tFormOut.AGENCY_NAME END AGENCY_NAME,CASE WHEN flow.BUSINESS_TYPE=1 THEN tCaiGou.BUYER_NAME WHEN flow.BUSINESS_TYPE=3 THEN tFormOut.OPERATOR_NAME END created_Name,flow.DEAL_TIME deal_Time FROM L_WAREHOUSE_FLOW flow LEFT JOIN L_WH_GOODS_RECORD record ON flow.id=record.WAREHOUSE_FLOW_ID LEFT JOIN L_WH_FORM_PROCURE tCaiGou ON flow.BUSINESS_TYPE=1 AND tCaiGou.id=flow.BUSINESS_FORM_ID LEFT JOIN L_WH_FORM_OUTPUT tFormOut ON flow.BUSINESS_TYPE=3 AND tFormOut.id=flow.BUSINESS_FORM_ID WHERE 1=1"; |
| | | private static String QUERY_BUSINESS_FLOW = "SELECT flow.BUSINESS_TYPE,flow.BUSINESS_FORM_ID,CASE WHEN flow.BUSINESS_TYPE=1 THEN tCaiGou.BUSINESS_FORM_CODE WHEN flow.BUSINESS_TYPE=3 THEN tFormOut.BUSINESS_FORM_CODE END BUSINESS_FORM_CODE,record.GOODS_TEMPLATE_NAME,record.BASE_GOODS_MODELS_NAME,record.THIS_COUNT,record.THIS_TYPE,record.total_price,CASE WHEN flow.BUSINESS_TYPE=1 THEN tCaiGou.AGENCY_NAME WHEN flow.BUSINESS_TYPE=3 THEN tFormOut.AGENCY_NAME END AGENCY_NAME,CASE WHEN flow.BUSINESS_TYPE=1 THEN tCaiGou.BUYER_NAME WHEN flow.BUSINESS_TYPE=3 THEN tFormOut.OPERATOR_NAME END created_Name,flow.DEAL_TIME deal_Time FROM L_WAREHOUSE_FLOW flow LEFT JOIN L_WH_GOODS_RECORD record ON flow.id=record.WAREHOUSE_FLOW_ID LEFT JOIN L_WH_FORM_PROCURE tCaiGou ON flow.BUSINESS_TYPE=1 AND tCaiGou.id=flow.BUSINESS_FORM_ID LEFT JOIN L_WH_FORM_OUTPUT tFormOut ON flow.BUSINESS_TYPE=3 AND tFormOut.id=flow.BUSINESS_FORM_ID WHERE 1=1 "; |
| | | |
| | | public GenericPager<Map<String, Object>> queryBusinessFlow(LWarehouseFlowParam param) { |
| | | StringBuilder sql = new StringBuilder(QUERY_BUSINESS_FLOW); |
| | |
| | | } |
| | | return selectSplit(sql.toString(), paramts, param.getPageNum(), param.getPageSize(), new MapRowMapper()); |
| | | } |
| | | |
| | | public GenericPager<Map<String, Object>> queryBusinessFlowDetail(LWhFormOutputQry param) { |
| | | StringBuilder sql = new StringBuilder(QUERY_BUSINESS_FLOW); |
| | | Map<String, Object> paramts = new HashMap<>(); |
| | | if (StringUtils.isNotEmpty(param.getBusinessFormCode())) { |
| | | sql.append("AND CASE WHEN flow.BUSINESS_TYPE = 1 THEN tCaiGou.BUSINESS_FORM_CODE=:businessFormCode" |
| | | + " WHEN flow.BUSINESS_TYPE = 3 THEN tFormOut.BUSINESS_FORM_CODE=:businessFormCode END "); |
| | | paramts.put("businessFormCode", param.getBusinessFormCode()); |
| | | } |
| | | if (StringUtils.isNotEmpty(param.getGoodsName())) { |
| | | sql.append("AND record.GOODS_TEMPLATE_NAME like :goodsTemplateName "); |
| | | paramts.put("goodsTemplateName", StringUtils.CHAR_PERCENT + param.getGoodsName() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | |
| | | if (param.getBaseGoodsModelsId() != null) { |
| | | sql.append("AND record.BASE_GOODS_MODELS_ID =:baseGoodsModelsId "); |
| | | paramts.put("baseGoodsModelsId", param.getBaseGoodsModelsId()); |
| | | } |
| | | if (param.getAgencyId() != null) { |
| | | sql.append("AND tCaiGou.AGENCY_id=:agencyId "); |
| | | paramts.put("agencyId", param.getAgencyId()); |
| | | } |
| | | |
| | | if (StringUtils.isNotEmpty(param.getCreateName())) { |
| | | sql.append("AND CASE WHEN flow.BUSINESS_TYPE = 1 THEN tCaiGou.BUYER_NAME = :createdName" |
| | | + " WHEN flow.BUSINESS_TYPE = 3 THEN tFormOut.OPERATOR_NAME = :createdName END "); |
| | | paramts.put("createdName", param.getCreateName()); |
| | | } |
| | | if (param.getStartTime() != null) { |
| | | sql.append("and flow.DEAL_TIME >=:dealTimeStart "); |
| | | paramts.put("dealTimeStart", param.getStartTime() * 1000000); |
| | | } |
| | | if (param.getEndTime() != null) { |
| | | sql.append("and flow.DEAL_TIME <:dealTimeEnd "); |
| | | paramts.put("dealTimeEnd", param.getEndTime() * 1000000 + 240000); |
| | | } |
| | | if (param.getStates() != null) { |
| | | |
| | | switch (param.getStates()) { |
| | | case 1: |
| | | sql.append("and flow.BUSINESS_TYPE =:businessType"); |
| | | break; |
| | | case 2: |
| | | sql.append("and flow.FLOW_STATE = 2 "); |
| | | break; |
| | | default: |
| | | sql.append("and flow.FLOW_STATE = 3 "); |
| | | } |
| | | |
| | | } |
| | | |
| | | // if (param.getBusinessType() != null) { |
| | | // sql.append(" and flow.BUSINESS_TYPE =:businessType"); |
| | | // paramts.put("businessType", param.getBusinessType()); |
| | | // } |
| | | |
| | | return selectSplit(sql.toString(), paramts, param.getPageNum(), param.getPageSize(), new MapperUtil()); |
| | | } |
| | | } |
| | |
| | | import com.consum.base.core.param.BaseWarehouseParam1; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.pojo.LWFormsOutputGoodsInfoParam; |
| | | import com.consum.base.pojo.LWFormsOutputGoodsModelParam; |
| | | import com.consum.base.pojo.LWFormsOutputGoodsParam; |
| | | import com.consum.base.pojo.LWhFormOutputInsertParam; |
| | | import com.consum.base.pojo.LWhFormOutputParam; |
| | | import com.consum.base.pojo.query.LWhFormOutputQry; |
| | | import com.consum.model.po.*; |
| | | import com.iplatform.model.po.S_user_core; |
| | |
| | | |
| | | private static String QUERY_FORM_OUTPUT_LIST = "SELECT * FROM l_wh_form_output WHERE 1 = 1"; |
| | | |
| | | // /** |
| | | // * @Description 新增出库单 |
| | | // * @Author 卢庆阳 |
| | | // * @Date 2023/10/27 |
| | | // */ |
| | | // public int add(LWhFormOutputParam param, S_user_core currentUser, FinSysTenantUser sysInfo) { |
| | | // //1.新增出库单记录 |
| | | // LWhFormOutput lWhFormOutput = new LWhFormOutput(); |
| | | // //出入库id |
| | | // long lWhFormOutputId = IdUtil.generateId(); |
| | | // lWhFormOutput.setId(lWhFormOutputId); |
| | | // Long warehouseId = param.getWarehouseId(); |
| | | // lWhFormOutput.setWarehouseId(warehouseId); |
| | | // //根据仓库id查询仓库 |
| | | // BaseWarehouse warehouse = this.baseWarehouseService.getById(warehouseId); |
| | | // if (warehouse == null) { |
| | | // log.error("仓库id不存在"); |
| | | // return 0; |
| | | // } |
| | | // lWhFormOutput.setWarehouseName(warehouse.getWarehouseName()); |
| | | // lWhFormOutput.setOutputCode(BaseWarehouseParam1.In_OutPutTypeEnum.Fragmentary_Output.getValue()+""); |
| | | // lWhFormOutput.setOutputName("零星出库"); |
| | | // lWhFormOutput.setAgencyId(Long.valueOf(sysInfo.getTenantId())); |
| | | // lWhFormOutput.setAgencyName(sysInfo.getTenantName()); |
| | | // lWhFormOutput.setOperatorId(sysInfo.getId()); |
| | | // lWhFormOutput.setOperatorName(sysInfo.getUserName()); |
| | | // long dateTimeNumber = DateUtils.getDateTimeNumber(System.currentTimeMillis()); |
| | | // lWhFormOutput.setDealTime(dateTimeNumber); |
| | | // lWhFormOutput.setStates(1); |
| | | // int flag1 = this.insert(lWhFormOutput); |
| | | // |
| | | // //2.根据出库单出库 |
| | | // Long lWarehouseFlowId = this.lWhFormOutputCoreService.outFormByTransId(lWhFormOutput.getId(), currentUser, dateTimeNumber); |
| | | // //3.向出库单 插入 进出库流水总表ID |
| | | // int flag3 = 0; |
| | | // if (flag1 > 0) { |
| | | // LWhFormOutput lWhFormOutput1 = new LWhFormOutput(lWhFormOutputId); |
| | | // lWhFormOutput1.setWarehouseFlowId(lWarehouseFlowId); |
| | | // flag3 = this.update(lWhFormOutput1); |
| | | // } |
| | | // |
| | | // //4.新增l_wh_goods_record记录 |
| | | // List<LWhGoodsRecord> recordList = param.getList(); |
| | | // if (CollectionUtils.isEmpty(recordList)) { |
| | | // log.error("规格型号为空"); |
| | | // return 0; |
| | | // } |
| | | // int flag5 = 0; |
| | | // int number = -1; //出库后,物品剩余数量 |
| | | // for (LWhGoodsRecord record : recordList) { |
| | | // //物品id和物品名称 |
| | | // record.setBaseGoodsTemplateId(param.getBaseGoodsTemplateId()); |
| | | // record.setGoodsTemplateName(param.getGoodsTemplateName()); |
| | | // |
| | | // record.setId(IdUtil.generateId()); |
| | | // record.setWarehouseId(warehouseId); |
| | | // //根据物品型号查询物品库存 |
| | | // int goodsNum = this.lWhGoodsService.queryGoodsModelNum(warehouseId, record.getBaseGoodsModelsId(), (short) 1, null); |
| | | // record.setInitialCount(goodsNum); |
| | | // record.setThisType(2); |
| | | // |
| | | // //判断出库数量是否小于库存 |
| | | // number = goodsNum - record.getThisCount(); |
| | | // if (number < 0) { |
| | | // log.error("库存不足"); |
| | | // break; |
| | | // } |
| | | // record.setEndCount(number); |
| | | // record.setDealTime(dateTimeNumber); |
| | | // record.setWarehouseFlowId(lWarehouseFlowId); |
| | | // |
| | | // //5.新增L_WH_PROCURE_MODEL记录 |
| | | // LWhProcureModel lWhProcureModel = new LWhProcureModel(); |
| | | // lWhProcureModel.setId(IdUtil.generateId()); |
| | | // lWhProcureModel.setBusinessType(3); |
| | | // lWhProcureModel.setBaseGoodsModelsId(record.getBaseGoodsModelsId()); |
| | | // lWhProcureModel.setCounts(record.getThisCount()); |
| | | // lWhProcureModel.setWorehouseCount(goodsNum); |
| | | // int res = this.lWhProcureModelService.insert(lWhProcureModel); |
| | | // flag5 += res; |
| | | // } |
| | | // //如果出库后,剩余库存大于0,新增l_wh_goods_record记录 |
| | | // int flag4 = 0; |
| | | // if (number >= 0){ |
| | | // flag4 = this.lWhGoodsService.insert(recordList); |
| | | // } |
| | | // |
| | | // //如果有一条记录新增失败,则回滚 |
| | | // if (flag1 == 0 || flag3 == 0 || flag4 != recordList.size() || flag5 != recordList.size() || number < 0) { |
| | | // TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | // return 0; |
| | | // } |
| | | // |
| | | // return 1; |
| | | // } |
| | | |
| | | /** |
| | | * @Description 新增出库单 |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/27 |
| | | */ |
| | | public int add(LWhFormOutputInsertParam param, S_user_core currentUser, FinSysTenantUser sysInfo) { |
| | | public int add(LWhFormOutputParam param, S_user_core currentUser, FinSysTenantUser sysInfo) { |
| | | //1.新增出库单记录 |
| | | LWhFormOutput lWhFormOutput = new LWhFormOutput(); |
| | | //出入库id |
| | |
| | | return 0; |
| | | } |
| | | //2.新增物品型号记录 |
| | | List<LWFormsOutputGoodsParam> goodsList = param.getGoods(); |
| | | List<LWFormsOutputGoodsInfoParam> goodsList = param.getGoods(); |
| | | List<LWhProcureModel> modelList = new ArrayList<>(); |
| | | for (LWFormsOutputGoodsParam goods : goodsList) { |
| | | for (LWFormsOutputGoodsInfoParam goods : goodsList) { |
| | | List<LWFormsOutputGoodsModelParam> models = goods.getModels(); |
| | | for (LWFormsOutputGoodsModelParam model : models) { |
| | | LWhProcureModel lWhProcureModel = new LWhProcureModel(); |
| | |
| | | import com.consum.base.core.CodeGeneratorService; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.core.utils.MapRowMapper; |
| | | import com.consum.base.core.utils.MapUtils; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | | import com.consum.base.pojo.LWhFormTransferGoodsInfoParam; |
| | | import com.consum.base.pojo.LWhFormTransferParam; |
| | | import com.consum.base.pojo.LWhProcureModelParams; |
| | | import com.consum.base.pojo.LWhProcureModelUserDTO; |
| | | import com.consum.base.pojo.LWhProcureModelUserParam; |
| | | import com.consum.base.pojo.LWhTransferModelParam; |
| | | import com.consum.base.pojo.query.TransferQry; |
| | | 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.FinSysTenant; |
| | |
| | | import com.consum.model.po.LWhProcureModel; |
| | | import com.consum.model.po.LWhProcureModelUser; |
| | | import com.consum.model.vo.LWhFormOutputVo; |
| | | import com.consum.model.vo.LWhFormTransferVo; |
| | | import com.consum.model.vo.LWhGoodsRecordVo; |
| | | import com.consum.model.vo.LWhProcureModelVo; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | | import com.walker.infrastructure.utils.DateUtils; |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/30 |
| | | */ |
| | | public int add(LWhFormTransferParam param, S_user_core currentUser, FinSysTenantUser sysInfo) { |
| | | public int add(LWhFormTransferParam param, FinSysTenantUser sysInfo) throws Exception { |
| | | //1.新增调拨单记录 |
| | | LWhFormTransfer lWhFormTransfer = new LWhFormTransfer(); |
| | | //调拨单id |
| | |
| | | lWhFormTransfer.setId(lWhFormTransferId); |
| | | |
| | | Integer businessType = param.getTransferBusinessType(); |
| | | // 业务类型 调拨/部门分发/部门退回 单据类型。0仓库调拨;1部门分发;2部门物品回退 |
| | | // 单据类型。0仓库调拨;1部门分发;2部门物品回退 |
| | | // TODO 枚举字典 |
| | | lWhFormTransfer.setBusinessType(businessType); |
| | | |
| | | lWhFormTransfer.setBusinessFormCode(codeGeneratorService.createBusinessFormCode(CodeGeneratorEnum.Transfer)); |
| | | Long warehouseId = param.getInWarehouseId(); |
| | | lWhFormTransfer.setInWarehouseId(warehouseId); |
| | | //根据仓库id查询仓库 |
| | | BaseWarehouse warehouse = this.baseWarehouseService.getById(warehouseId); |
| | | //入库仓库为当前用户的默认仓库 |
| | | String tenantId = sysInfo.getTenantId(); |
| | | BaseWarehouse warehouse = baseWarehouseService.getDefaultWarehouseByAgencyId(Long.valueOf(tenantId)); |
| | | if (warehouse == null) { |
| | | log.error("仓库不存在"); |
| | | return 0; |
| | | throw new Exception("仓库不存在"); |
| | | } |
| | | lWhFormTransfer.setInWarehouseName(warehouse.getWarehouseName()); |
| | | lWhFormTransfer.setInAgencyId(Long.valueOf(sysInfo.getTenantId())); |
| | | lWhFormTransfer.setInAgencyId(Long.valueOf(tenantId)); |
| | | lWhFormTransfer.setInAgencyName(sysInfo.getTenantName()); |
| | | //根据机构id查询调拨机构 |
| | | FinSysTenant finSysTenant = finSysTenantService.get(new FinSysTenant(param.getOutAgencyId())); |
| | |
| | | } |
| | | |
| | | //2.新增物品型号记录 |
| | | List<LWhProcureModelParams> models = param.getModels(); |
| | | List<LWhFormTransferGoodsInfoParam> transferGoods = param.getTransferGoods(); |
| | | List<LWhProcureModel> modelList = new ArrayList<>(); |
| | | for (LWhProcureModelParams model : models) { |
| | | LWhProcureModel lWhProcureModel = new LWhProcureModel(); |
| | | lWhProcureModel.setId(IdUtil.generateId()); |
| | | // 物品型号业务类型 |
| | | lWhProcureModel.setBusinessType(model.getProcureModelBusinessType()); |
| | | lWhProcureModel.setBusinessId(lWhFormTransferId); |
| | | lWhProcureModel.setBaseGoodsModelsId(model.getBaseGoodsModelsId()); |
| | | lWhProcureModel.setCounts(model.getCounts()); |
| | | //根据物品型号查询物品库存 |
| | | int goodsNum = this.lWhGoodsService.queryGoodsModelNum(0, warehouseId, model.getBaseGoodsModelsId(), (short) 1, null); |
| | | lWhProcureModel.setWorehouseCount(goodsNum); |
| | | for (LWhFormTransferGoodsInfoParam transferGoodsInfo : transferGoods) { |
| | | for (LWhTransferModelParam model : transferGoodsInfo.getModels()) { |
| | | LWhProcureModel lWhProcureModel = new LWhProcureModel(); |
| | | lWhProcureModel.setId(IdUtil.generateId()); |
| | | // 物品型号业务类型 |
| | | // 物品类型 1 采购2 调拨 3出库4部门分发 |
| | | switch (businessType) { |
| | | case 0: |
| | | lWhProcureModel.setBusinessType(2); |
| | | break; |
| | | case 1: |
| | | lWhProcureModel.setBusinessType(4); |
| | | break; |
| | | default: |
| | | lWhProcureModel.setBusinessType(null); |
| | | } |
| | | lWhProcureModel.setBusinessId(lWhFormTransferId); |
| | | lWhProcureModel.setBaseGoodsModelsId(model.getBaseGoodsModelsId()); |
| | | lWhProcureModel.setCounts(model.getCounts()); |
| | | //根据型号id查询型号 |
| | | BaseGoodsModels baseGoodsModels = this.baseGoodsModelsService.get(new BaseGoodsModels(model.getBaseGoodsModelsId())); |
| | | if (baseGoodsModels != null) { |
| | | lWhProcureModel.setBaseGoodsModelsName(baseGoodsModels.getModelName()); |
| | | } |
| | | // TODO 价格 |
| | | lWhProcureModel.setPrice(10L); |
| | | //根据物品型号查询物品库存 |
| | | int goodsNum = this.lWhGoodsService.queryGoodsModelNum(0, warehouseId, model.getBaseGoodsModelsId(), (short) 1, null); |
| | | lWhProcureModel.setWorehouseCount(goodsNum); |
| | | |
| | | //3.当业务类型为部门分发时 添加部门分发记录和使用人 |
| | | // 单据类型 1 采购2 调拨 3出库4部门分发 |
| | | if (model.getProcureModelBusinessType() == 4) { |
| | | List<LWhProcureModelUser> procureModelUserList = Lists.newArrayList(); |
| | | for (LWhProcureModelUserDTO lWhProcureModelUserDTO : model.getLWhProcureModelUserList()) { |
| | | LWhProcureModelUser lWhProcureModelUser = new LWhProcureModelUser(); |
| | | lWhProcureModelUser.setId(IdUtil.generateId()); |
| | | lWhProcureModelUser.setTransBusinessId(lWhFormTransferId); |
| | | lWhProcureModelUser.setWhProcureModelId(lWhProcureModel.getId()); |
| | | lWhProcureModelUser.setBaseGoodsModelsId(model.getBaseGoodsModelsId()); |
| | | lWhProcureModelUser.setNowUserName(lWhProcureModelUserDTO.getNowUserName()); |
| | | lWhProcureModelUser.setNowUserPhone(lWhProcureModelUserDTO.getNowUserPhone()); |
| | | lWhProcureModelUser.setGoodsNum(lWhProcureModelUserDTO.getGoodsNum()); |
| | | procureModelUserList.add(lWhProcureModelUser); |
| | | //3.当业务类型为部门分发时 添加部门分发记录和使用人 |
| | | // 单据类型 1 采购2 调拨 3出库4部门分发 |
| | | //TODO 部门分发类型 |
| | | if (businessType == 1) { |
| | | List<LWhProcureModelUser> procureModelUserList = Lists.newArrayList(); |
| | | for (LWhProcureModelUserParam lWhProcureModelUserParam : model.getProcureModelUserList()) { |
| | | LWhProcureModelUser lWhProcureModelUser = new LWhProcureModelUser(); |
| | | lWhProcureModelUser.setId(IdUtil.generateId()); |
| | | lWhProcureModelUser.setTransBusinessId(lWhFormTransferId); |
| | | lWhProcureModelUser.setWhProcureModelId(lWhProcureModel.getId()); |
| | | lWhProcureModelUser.setBaseGoodsModelsId(model.getBaseGoodsModelsId()); |
| | | lWhProcureModelUser.setNowUserName(lWhProcureModelUserParam.getNowUserName()); |
| | | lWhProcureModelUser.setNowUserPhone(lWhProcureModelUserParam.getNowUserPhone()); |
| | | lWhProcureModelUser.setGoodsNum(lWhProcureModelUserParam.getGoodsNum()); |
| | | procureModelUserList.add(lWhProcureModelUser); |
| | | } |
| | | int procureInsertNum = lWhProcureModelUserService.insert(procureModelUserList); |
| | | if (procureInsertNum != procureModelUserList.size()) { |
| | | log.error("新增物品使用信息失败"); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return 0; |
| | | } |
| | | } |
| | | int procureInsertNum = lWhProcureModelUserService.insert(procureModelUserList); |
| | | if (procureInsertNum != procureModelUserList.size()) { |
| | | log.error("新增物品使用信息失败"); |
| | | TransactionAspectSupport.currentTransactionStatus().setRollbackOnly(); |
| | | return 0; |
| | | } |
| | | |
| | | modelList.add(lWhProcureModel); |
| | | } |
| | | |
| | | modelList.add(lWhProcureModel); |
| | | } |
| | | |
| | | int flag2 = this.lWhProcureModelService.insert(modelList); |
| | |
| | | StringBuilder sql = new StringBuilder(QUERY_FORM_TRANSFER_LIST); |
| | | //调拨单号 |
| | | if (!StringUtils.isEmpty(param.getBusinessFormCode())) { |
| | | sql.append(" and BUSINESS_FORM_CODE like :businessFormCode "); |
| | | paramts.put("businessFormCode", StringUtils.CHAR_PERCENT + param.getBusinessFormCode() + StringUtils.CHAR_PERCENT); |
| | | sql.append(" and BUSINESS_FORM_CODE = :businessFormCode "); |
| | | paramts.put("businessFormCode", param.getBusinessFormCode()); |
| | | } |
| | | //物品名称 |
| | | if (!StringUtils.isEmpty(param.getGoodsTemplateName())) { |
| | | sql.append( |
| | | " AND id IN (SELECT BUSINESS_ID FROM L_WH_PROCURE_MODEL procureModel LEFT JOIN BASE_GOODS_MODELS baseModel ON procureModel.BASE_GOODS_MODELS_ID=baseModel.ID LEFT JOIN BASE_GOODS_TEMPLATE baseTemp ON baseModel.GOODS_TEMPLATES_ID=baseTemp.id WHERE procureModel.BUSINESS_TYPE=1 AND baseTemp.GOODS_NAME LIKE :goodsTemplateName)"); |
| | | " AND id IN (SELECT BUSINESS_ID FROM L_WH_PROCURE_MODEL procureModel LEFT JOIN BASE_GOODS_MODELS baseModel ON procureModel.BASE_GOODS_MODELS_ID=baseModel.ID LEFT JOIN BASE_GOODS_TEMPLATE baseTemp ON baseModel.GOODS_TEMPLATES_ID=baseTemp.id WHERE procureModel.BUSINESS_TYPE=2 AND baseTemp.GOODS_NAME LIKE :goodsTemplateName)"); |
| | | paramts.put("goodsTemplateName", StringUtils.CHAR_PERCENT + param.getGoodsTemplateName() + StringUtils.CHAR_PERCENT); |
| | | } |
| | | //调拨机构 |
| | |
| | | * @Author 卢庆阳 |
| | | * @Date 2023/10/30 |
| | | */ |
| | | public LWhFormTransferVo getById(Long id) { |
| | | LWhFormTransferVo vo = new LWhFormTransferVo(); |
| | | public LWHFromTransferExtendVO getById(Long id) { |
| | | LWHFromTransferExtendVO result = new LWHFromTransferExtendVO(); |
| | | //1.查询调拨单 |
| | | LWhFormTransfer lWhFormTransfer = this.get(new LWhFormTransfer(id)); |
| | | if (lWhFormTransfer != null) { |
| | | BeanUtils.copyProperties(lWhFormTransfer, vo); |
| | | BeanUtils.copyProperties(lWhFormTransfer, result); |
| | | } |
| | | //2.查询物品型号 |
| | | // List<LWhProcureModel> models = this.lWhProcureModelService.getModelByForm(WhBusinessEnum.DIAOBO, id); |
| | | |
| | | String sql = "SELECT bgt.id, CATEGORY_ID, CATEGORY_NAME, GOODS_NAME " |
| | | + "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 GROUP BY bgt.id "; |
| | | Map<String, Object> paramMap = new HashMap<>(); |
| | | paramMap.put("id", result.getId()); |
| | | List<Map<String, Object>> procureModelList = lWhFormOutputService.select(sql, paramMap, new MapperUtil()); |
| | | List<FormTransferGoodsVO> formTransferGoods = Lists.newArrayList(); |
| | | for (Map<String, Object> map : procureModelList) { |
| | | FormTransferGoodsVO procureTemplateInfoVO = MapUtils.convertMapToObj(map, FormTransferGoodsVO.class); |
| | | |
| | | // 查询型号数量 |
| | | 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()); |
| | | modelList.forEach(item -> { |
| | | GoodsModelVO goodsModelVO = MapUtils.convertMapToObj(item, GoodsModelVO.class); |
| | | goodsModelVOList.add(goodsModelVO); |
| | | }); |
| | | procureTemplateInfoVO.setModels(goodsModelVOList); |
| | | formTransferGoods.add(procureTemplateInfoVO); |
| | | } |
| | | result.setFormTransferGoods(formTransferGoods); |
| | | |
| | | /*//2.查询物品型号 |
| | | //List<LWhProcureModel> models = this.lWhProcureModelService.getModelByForm(WhBusinessEnum.DIAOBO, id); |
| | | List<LWhProcureModel> models = this.lWhProcureModelService.getModelByForm(null, id); |
| | | |
| | | if (!CollectionUtils.isEmpty(models)) { |
| | |
| | | lWhProcureModelVoList.add(lWhProcureModelVo); |
| | | } |
| | | vo.setModels(lWhProcureModelVoList); |
| | | } |
| | | return vo; |
| | | }*/ |
| | | return result; |
| | | } |
| | | |
| | | |
| | |
| | | public GenericPager<Map<String, Object>> queryTransferInfo(TransferQry transferQry) { |
| | | |
| | | HashMap<String, Object> paramts = new HashMap<>(); |
| | | StringBuilder sql = new StringBuilder("SELECT\n" |
| | | + "\tft.id,\n" |
| | | + "\tft.BUSINESS_FORM_CODE businessCode,\n" |
| | | + "\tbgt.GOODS_NAME goodsName,\n" |
| | | + "\tbgt.CLASSIFICATION goodsType,\n" |
| | | + "\tbgm.id goodsModelId,\n" |
| | | + "\tbgm.MODEL_NAME goodsModelName,\n" |
| | | + "\tpm.COUNTS goodsCount,\n" |
| | | + "\tfst.`name` tennatName,\n" |
| | | + "\tfstd.NAME departmentName,\n" |
| | | + "\tft.OPERATOR_ID distributor,\n" |
| | | + "\tft.CREATE_TIME TIME \n" |
| | | + "FROM\n" |
| | | + "\tl_wh_form_transfer ft\n" |
| | | + "\tLEFT JOIN l_wh_procure_model pm ON ft.ID = pm.BUSINESS_ID\n" |
| | | + "\tLEFT JOIN base_goods_models bgm ON bgm.GOODS_TEMPLATES_ID = pm.BASE_GOODS_MODELS_ID\n" |
| | | + "\tLEFT JOIN base_goods_template bgt ON bgt.id = bgm.GOODS_TEMPLATES_ID\n" |
| | | + "\tLEFT JOIN fin_sys_tenant_user fstu ON fstu.id = ft.OPERATOR_ID\n" |
| | | + "\tLEFT JOIN fin_sys_tenant_department fstd ON fstu.SYS_DEPT_ID = fstd.ID \n" |
| | | + "\tLEFT JOIN fin_sys_tenant fst ON fst.id = fstd.TENANT_ID where 1=1 "); |
| | | StringBuilder sql = new StringBuilder( |
| | | "SELECT\n" + "\tft.id,\n" + "\tft.BUSINESS_FORM_CODE businessCode,\n" + "\tbgt.GOODS_NAME goodsName,\n" + "\tbgt.CLASSIFICATION goodsType,\n" |
| | | + "\tbgm.id goodsModelId,\n" + "\tbgm.MODEL_NAME goodsModelName,\n" + "\tpm.COUNTS goodsCount,\n" + "\tfst.`name` tennatName,\n" |
| | | + "\tfstd.NAME departmentName,\n" + "\tft.OPERATOR_ID distributor,\n" + "\tft.CREATE_TIME TIME \n" + "FROM\n" + "\tl_wh_form_transfer ft\n" |
| | | + "\tLEFT JOIN l_wh_procure_model pm ON ft.ID = pm.BUSINESS_ID\n" |
| | | + "\tLEFT JOIN base_goods_models bgm ON bgm.GOODS_TEMPLATES_ID = pm.BASE_GOODS_MODELS_ID\n" |
| | | + "\tLEFT JOIN base_goods_template bgt ON bgt.id = bgm.GOODS_TEMPLATES_ID\n" |
| | | + "\tLEFT JOIN fin_sys_tenant_user fstu ON fstu.id = ft.OPERATOR_ID\n" |
| | | + "\tLEFT JOIN fin_sys_tenant_department fstd ON fstu.SYS_DEPT_ID = fstd.ID \n" |
| | | + "\tLEFT JOIN fin_sys_tenant fst ON fst.id = fstd.TENANT_ID where 1=1 "); |
| | | //单号 |
| | | if (StringUtils.isNotEmpty(transferQry.getBusinessFormCode())) { |
| | | sql.append("AND BUSINESS_FORM_CODE like :businessFormCode "); |
| | |
| | | |
| | | import com.consum.model.po.LWhFormTransfer; |
| | | import java.util.List; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | public class LWhFormTransferVo extends LWhFormTransfer { |
| | | |
| | | /** |
| | |
| | | */ |
| | | private List<LWhProcureModelVo> models; |
| | | |
| | | public List<LWhProcureModelVo> getModels() { |
| | | return models; |
| | | } |
| | | |
| | | public void setModels(List<LWhProcureModelVo> models) { |
| | | this.models = models; |
| | | } |
| | | } |