rev:增加库存等级修改功能
This commit is contained in:
@@ -944,6 +944,8 @@ public class PdmWorkTaskServiceImpl implements PdmWorkTaskService {
|
||||
//500*0.35
|
||||
double a = NumberUtil.mul(masterbucket_qty, liquid_rate);
|
||||
|
||||
|
||||
|
||||
data2.put("value", NumberUtil.round(NumberUtil.sub(a, QM006_qty), 3));
|
||||
}
|
||||
//卸料酒精每次加量设定值:开单重量*工艺参数"每次卸料酒精加量(改为比例)"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.nl.wms.statistics.rest;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -9,10 +10,7 @@ import org.nl.wms.statistics.service.IvtQueryService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
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.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
@@ -57,4 +55,12 @@ public class IvtQueryController {
|
||||
ivtQueryService.download(whereJson, response);
|
||||
}
|
||||
|
||||
@PostMapping("/updateIvt")
|
||||
@Log("更新库存记录")
|
||||
@ApiOperation("更新库存记录")
|
||||
public ResponseEntity<Object> updateIvt(@RequestBody JSONObject whereJson) {
|
||||
ivtQueryService.updateIvt(whereJson);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.statistics.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
@@ -41,4 +42,13 @@ public interface IvtQueryService {
|
||||
Map<String, Object> bagQuery(Map whereJson, Pageable page);
|
||||
|
||||
void download(Map whereJson, HttpServletResponse response) throws IOException;
|
||||
|
||||
/**
|
||||
* 更新库存记录
|
||||
* @param whereJson {
|
||||
* pcsn: 批次
|
||||
* ivt_level: 库存等级
|
||||
* }
|
||||
*/
|
||||
void updateIvt(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -7,13 +7,16 @@ import com.alibaba.fastjson.JSONArray;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.utils.FileUtil;
|
||||
import org.nl.wms.basedata.master.service.ClassstandardService;
|
||||
import org.nl.wms.statistics.service.IvtQueryService;
|
||||
import org.nl.wql.WQL;
|
||||
import org.nl.wql.core.bean.WQLObject;
|
||||
import org.nl.wql.util.WqlUtil;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
@@ -195,4 +198,27 @@ public class IvtQueryServiceImpl implements IvtQueryService {
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateIvt(JSONObject whereJson) {
|
||||
String pcsn = whereJson.getString("pcsn");
|
||||
String ivt_level = whereJson.getString("ivt_level");
|
||||
if (ObjectUtil.isEmpty(pcsn)) {
|
||||
throw new BadRequestException("批次不能为空!");
|
||||
}
|
||||
if (ObjectUtil.isEmpty(ivt_level)) {
|
||||
throw new BadRequestException("库存等级不能为空!");
|
||||
}
|
||||
|
||||
WQLObject ivtTab = WQLObject.getWQLObject("st_ivt_structivt");
|
||||
WQLObject buckTab = WQLObject.getWQLObject("md_pb_bucketrecord");
|
||||
// 更新库存等级
|
||||
JSONObject jsonParam = new JSONObject();
|
||||
jsonParam.put("ivt_level",ivt_level);
|
||||
ivtTab.update(jsonParam, "pcsn = '"+pcsn+"'");
|
||||
|
||||
// 更新桶记录等级
|
||||
buckTab.update(jsonParam, "pcsn = '"+pcsn+"'");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user