| | |
| | | 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); |
| | | } |
| | | |
| | | } |