fix:出入库流程修改
This commit is contained in:
@@ -48,8 +48,8 @@ public class StoragevehicleinfoController {
|
||||
@Log("修改载具")
|
||||
|
||||
//@PreAuthorize("@el.check('mdPbStoragevehicleinfo:edit')")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody StoragevehicleinfoDto dto) {
|
||||
storagevehicleinfoService.update(dto);
|
||||
public ResponseEntity<Object> update(@RequestBody JSONObject map) {
|
||||
storagevehicleinfoService.update(map);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ public interface StoragevehicleinfoService {
|
||||
*
|
||||
* @param dto /
|
||||
*/
|
||||
void update(StoragevehicleinfoDto dto);
|
||||
void update(JSONObject dto);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
|
||||
@@ -160,24 +160,47 @@ public class StoragevehicleinfoServiceImpl implements StoragevehicleinfoService
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(StoragevehicleinfoDto dto) {
|
||||
public void update(JSONObject dto) {
|
||||
WQLObject wo = WQLObject.getWQLObject("md_pb_storagevehicleinfo");
|
||||
JSONObject jsonObject = wo.query("storagevehicle_code = '" + dto.getStoragevehicle_code() + "' and is_delete = '0'").uniqueResult(0);
|
||||
WQLObject veExtTab = WQLObject.getWQLObject("md_pb_storagevehicleext");
|
||||
JSONObject jsonObject = wo.query("storagevehicle_code = '" + dto.getString("storagevehicle_code") + "' and is_delete = '0' AND storagevehicle_id != '" + dto.getString("storagevehicle_id") + "'").uniqueResult(0);
|
||||
if (!ObjectUtil.isEmpty(jsonObject)) {
|
||||
throw new BadRequestException("此载具已存在");
|
||||
}
|
||||
StoragevehicleinfoDto entity = this.findById(dto.getStoragevehicle_id());
|
||||
if (entity == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
String qty = dto.getString("qty");
|
||||
String pcsn = dto.getString("pcsn");
|
||||
if (StrUtil.isNotEmpty(qty) || StrUtil.isNotEmpty(pcsn)) {
|
||||
JSONObject ext_jo = veExtTab.query("storagevehicle_code = '"+dto.getString("storagevehicle_code")+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(ext_jo)) {
|
||||
//新增一条记录
|
||||
JSONObject jsonVeExt = new JSONObject();
|
||||
jsonVeExt.put("storagevehicleext_id", org.nl.common.utils.IdUtil.getLongId());
|
||||
jsonVeExt.put("storagevehicle_id", dto.getLongValue("storagevehicle_id"));
|
||||
jsonVeExt.put("storagevehicle_code", dto.getString("storagevehicle_code"));
|
||||
jsonVeExt.put("storagevehicle_type", dto.getString("storagevehicle_type"));
|
||||
if (StrUtil.isNotEmpty(pcsn)) {
|
||||
jsonVeExt.put("pcsn", pcsn);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(qty)) {
|
||||
jsonVeExt.put("qty", qty);
|
||||
}
|
||||
jsonVeExt.put("device_uuid", org.nl.common.utils.IdUtil.getLongId());
|
||||
jsonVeExt.put("update_time", DateUtil.now());
|
||||
veExtTab.insert(jsonVeExt);
|
||||
} else {
|
||||
if (StrUtil.isNotEmpty(pcsn)) {
|
||||
ext_jo.put("pcsn", pcsn);
|
||||
}
|
||||
if (StrUtil.isNotEmpty(qty)) {
|
||||
ext_jo.put("qty", qty);
|
||||
}
|
||||
veExtTab.update(ext_jo);
|
||||
}
|
||||
}
|
||||
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
|
||||
@@ -45,6 +45,9 @@
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
s.*,
|
||||
ext.pcsn,
|
||||
ext.qty,
|
||||
ext.update_time AS change_time,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
point.point_code,
|
||||
@@ -56,6 +59,7 @@
|
||||
LEFT JOIN ST_IVT_StructIvt ivt ON point.source_id = ivt.struct_id
|
||||
LEFT JOIN md_me_materialbase mater ON mater.material_id = ivt.material_id
|
||||
LEFT JOIN md_pb_classstandard class ON class.class_code = s.storagevehicle_type
|
||||
LEFT JOIN md_pb_storagevehicleext ext ON ext.storagevehicle_code = s.storagevehicle_code
|
||||
WHERE
|
||||
s.is_delete = '0'
|
||||
ENDOPTION
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user