add:外协添加发货状态;todo:手持查询未修改
This commit is contained in:
@@ -42,8 +42,8 @@ public class HandXCOutIvtController {
|
||||
}
|
||||
|
||||
@PostMapping("/confirmoutstore")
|
||||
@Log("确认发货")
|
||||
@ApiOperation("确认发货")
|
||||
@Log("出库确认")
|
||||
@ApiOperation("出库确认")
|
||||
public ResponseEntity<Object> confirmOutStore(@RequestBody Map whereJson) {
|
||||
return new ResponseEntity<>(handXCOutIvtService.confirmOutStore(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -137,9 +137,9 @@ public class HandXCOutIvtServiceImpl implements HandXCOutIvtService {
|
||||
String diskrecord_id = dtl.getString("diskrecord_id");
|
||||
HashMap<String,String> map = new HashMap<String,String>();
|
||||
map.put("is_send","1");
|
||||
map.put("send_id",currentUserId+"");
|
||||
map.put("send_name",userDto.getNickName());
|
||||
map.put("send_time",DateUtil.now());
|
||||
map.put("out_id",currentUserId+"");
|
||||
map.put("out_name",userDto.getNickName());
|
||||
map.put("out_time",DateUtil.now());
|
||||
PDM_BI_ProcedureOffline.update(map,"diskrecord_id='"+diskrecord_id+"'");
|
||||
}
|
||||
JSONObject returnjo = new JSONObject();
|
||||
|
||||
Binary file not shown.
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.statistics.rest;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -33,6 +34,15 @@ public class StatisticalReportController {
|
||||
return new ResponseEntity<>(statisticalReportService.sendOutQuery(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PutMapping("/confirmOutStore")
|
||||
@Log("确认发货")
|
||||
@ApiOperation("确认发货")
|
||||
public ResponseEntity<Object> confirmOutStore(@RequestBody JSONArray whereJson) {
|
||||
return new ResponseEntity<>(statisticalReportService.confirmOutStore(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/productInstor")
|
||||
@Log("PG粉当月入库查询")
|
||||
@ApiOperation("PG粉当月入库查询")
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package org.nl.wms.statistics.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
@@ -49,4 +48,13 @@ public interface StatisticalReportService {
|
||||
JSONArray query3(Map whereJson);
|
||||
|
||||
JSONArray query4(Map whereJson);
|
||||
|
||||
|
||||
/**
|
||||
* 发货确认
|
||||
*
|
||||
* @param jsonObject 条件
|
||||
* @return Map<String, Object>
|
||||
*/
|
||||
Map<String, Object> confirmOutStore(JSONArray jsonObject);
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
package org.nl.wms.statistics.service.impl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUnit;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.map.MapUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.wms.basedata.master.constant.MaterOptTypeEnum;
|
||||
import org.nl.modules.system.service.UserService;
|
||||
import org.nl.modules.system.service.dto.UserDto;
|
||||
import org.nl.pda.exception.PdaRequestException;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.wms.common.util.DataAuthUtil;
|
||||
import org.nl.wms.statistics.service.StatisticalReportService;
|
||||
import org.nl.wms.statistics.service.StifleQueryService;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.nl.wql.util.WqlUtil;
|
||||
@@ -23,7 +23,6 @@ import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -32,6 +31,8 @@ import java.util.stream.Collectors;
|
||||
@Slf4j
|
||||
public class StatisticalReportServiceImpl implements StatisticalReportService {
|
||||
|
||||
private final UserService userService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> sendOutQuery(Map whereJson, Pageable page) {
|
||||
HashMap<String, String> map = new HashMap<>(whereJson);
|
||||
@@ -63,7 +64,7 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
||||
}
|
||||
|
||||
map.put("flag", "5");
|
||||
JSONObject jo = WQL.getWO("statistical_report_query_02").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "material_code");
|
||||
JSONObject jo = WQL.getWO("statistical_report_query_02").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "send_date desc,material_code,pcsn");
|
||||
return jo;
|
||||
}
|
||||
|
||||
@@ -553,4 +554,47 @@ public class StatisticalReportServiceImpl implements StatisticalReportService {
|
||||
.process().getResultJSONArray(0);
|
||||
return ja;
|
||||
}
|
||||
//diskrecord_id ->
|
||||
@Override
|
||||
@Transactional
|
||||
public Map<String, Object> confirmOutStore(JSONArray list) {
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
UserDto userDto = userService.findById(currentUserId);
|
||||
for (Object raw : list) {
|
||||
JSONObject jsonObject = (JSONObject)JSON.toJSON(raw);
|
||||
String storagevehicle_code = (String) jsonObject.get("storagevehicle_code");
|
||||
if (StrUtil.isEmpty(storagevehicle_code)) {
|
||||
throw new PdaRequestException("载具不能为空!");
|
||||
}
|
||||
if (StrUtil.isEmpty(jsonObject.getString("diskrecord_id"))) {
|
||||
throw new PdaRequestException("组盘记录不能为空");
|
||||
}
|
||||
// 仓位属性表【ST_IVT_StructAttr】
|
||||
WQLObject PDM_BI_ProcedureOffline = WQLObject.getWQLObject("PDM_BI_ProcedureOffline");
|
||||
|
||||
JSONObject jo = PDM_BI_ProcedureOffline.query("storagevehicle_code='"+storagevehicle_code+"'").uniqueResult(0);
|
||||
if(jo==null){
|
||||
throw new PdaRequestException("该载具"+storagevehicle_code+"无组盘记录!");
|
||||
}
|
||||
if (!jo.getString("diskrecord_id").equals(jsonObject.getString("diskrecord_id"))){
|
||||
throw new PdaRequestException("该载具"+storagevehicle_code+"对应编号不一致!");
|
||||
}
|
||||
String is_send = jo.getString("is_send");
|
||||
if(!"1".equals(is_send)){
|
||||
throw new PdaRequestException("该载具"+storagevehicle_code+"状态不是已出库状态,不允许发货!");
|
||||
}
|
||||
String diskrecord_id = jsonObject.getString("diskrecord_id");
|
||||
HashMap<String,String> map = new HashMap<String,String>();
|
||||
map.put("is_send","2");
|
||||
map.put("send_id",currentUserId+"");
|
||||
map.put("send_name",userDto.getNickName());
|
||||
map.put("send_time",DateUtil.now());
|
||||
PDM_BI_ProcedureOffline.update(map,"diskrecord_id='"+diskrecord_id+"'");
|
||||
}
|
||||
|
||||
JSONObject returnjo = new JSONObject();
|
||||
returnjo.put("code", "1");
|
||||
returnjo.put("desc", "操作成功!");
|
||||
return returnjo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,6 +194,7 @@
|
||||
SELECT
|
||||
procedureoffline2.num_bucket,
|
||||
procedureoffline2.total_qty,
|
||||
procedureoffline.diskrecord_id,
|
||||
procedureoffline.storagevehicle_code,
|
||||
procedureoffline.is_send AS is_send,
|
||||
procedureoffline.send_name AS send_name,
|
||||
|
||||
Reference in New Issue
Block a user