代码更新
This commit is contained in:
@@ -152,7 +152,7 @@ public class RawFoilServiceImpl implements RawFoilService {
|
||||
if (StrUtil.equals(point_location, "1")) map.put("point_location", "0");
|
||||
JSONObject jsonIvt_tow = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(0);
|
||||
|
||||
if (ObjectUtil.isEmpty(jsonIvt_tow)) throw new BadRequestException("库存不足");
|
||||
if (ObjectUtil.isEmpty(jsonIvt_tow)) throw new BadRequestException("没有空卷轴");
|
||||
start_pint_code = jsonIvt_tow.getString("empty_point_code");
|
||||
} else {
|
||||
start_pint_code = jsonIvt.getString("empty_point_code");
|
||||
|
||||
@@ -43,4 +43,11 @@ public class CoolOutController {
|
||||
public ResponseEntity<Object> confirmInstor(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(coolOutService.confirmInstor(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/areaQuery")
|
||||
@Log("半成品出库区域下拉框查询")
|
||||
@ApiOperation("半成品出库区域下拉框查询")
|
||||
public ResponseEntity<Object> areaQuery(@RequestBody JSONObject whereJson){
|
||||
return new ResponseEntity<>(coolOutService.areaQuery(whereJson),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,4 +23,11 @@ public interface CoolOutService {
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject confirmInstor(JSONObject whereJson);
|
||||
|
||||
/**
|
||||
* 区域下拉框查询
|
||||
* @param whereJson /
|
||||
* @return JSONObject /
|
||||
*/
|
||||
JSONObject areaQuery(JSONObject whereJson);
|
||||
}
|
||||
|
||||
@@ -31,9 +31,12 @@ public class CoolInServiceImpl implements CoolInService {
|
||||
|
||||
@Override
|
||||
public JSONObject coolIOQuery(JSONObject whereJson) {
|
||||
String container_name = whereJson.getString("container_name");
|
||||
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("flag", "1");
|
||||
map.put("container_name", whereJson.getString("container_name"));
|
||||
if (ObjectUtil.isNotEmpty(container_name)) map.put("container_name", "%"+container_name+"%");
|
||||
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_COOLIN").addParamMap(map).process().getResultJSONArray(0);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
@@ -80,6 +83,9 @@ public class CoolInServiceImpl implements CoolInService {
|
||||
jsonCool.put("confirm_optname", currentUsername);
|
||||
jsonCool.put("confirm_time", DateUtil.now());
|
||||
coolIvtTab.insert(jsonCool);*/
|
||||
// 校验母卷号是否已存在
|
||||
JSONObject json = coolIvtTab.query("container_name = '" + raw_jo.getString("container_name") + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) throw new BadRequestException("此母卷库存已存在");
|
||||
|
||||
// 更新冷却区库存
|
||||
jsonCoolIvt.put("full_point_status", "02");
|
||||
|
||||
@@ -26,7 +26,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class CoolOutServiceImpl implements CoolOutService {
|
||||
public class CoolOutServiceImpl
|
||||
implements CoolOutService {
|
||||
|
||||
@Override
|
||||
public JSONObject coolIOQuery(JSONObject whereJson) {
|
||||
@@ -66,4 +67,14 @@ public class CoolOutServiceImpl implements CoolOutService {
|
||||
result.put("message", "出库成功!");
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject areaQuery(JSONObject whereJson) {
|
||||
JSONArray resultJSONArray = WQL.getWO("PDA_COOLOUT").addParam("flag","2").process().getResultJSONArray(0);
|
||||
|
||||
JSONObject jo = new JSONObject();
|
||||
jo.put("data", resultJSONArray);
|
||||
jo.put("message", "查询成功!");
|
||||
return jo;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
der.is_delete = '0'
|
||||
|
||||
OPTION 输入.container_name <> ""
|
||||
der.container_name = 输入.container_name
|
||||
der.container_name like 输入.container_name
|
||||
ENDOPTION
|
||||
|
||||
ENDSELECT
|
||||
|
||||
@@ -80,3 +80,17 @@
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
QUERY
|
||||
SELECT
|
||||
value,
|
||||
label
|
||||
FROM
|
||||
sys_dict_detail
|
||||
WHERE
|
||||
name = 'product_area'
|
||||
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
@@ -91,10 +91,25 @@ public class RawfoilworkorderServiceImpl implements RawfoilworkorderService {
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void create(RawfoilworkorderDto dto) {
|
||||
WQLObject pointTab = WQLObject.getWQLObject("ST_IVT_SbPointIvt");
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder");
|
||||
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase");
|
||||
|
||||
String container_name = dto.getContainer_name();
|
||||
JSONObject json = wo.query("container_name = '" + container_name + "' and status <> '09'").uniqueResult(0);
|
||||
if (ObjectUtil.isNotEmpty(json)) throw new BadRequestException("母卷号已存在");
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
|
||||
JSONObject jsonPoint = pointTab.query("ext_code ='" + dto.getResource_name() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("点位设备不存在");
|
||||
|
||||
JSONObject josnMater = materTab.query("material_code ='" + dto.getProduct_name() + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(josnMater)) throw new BadRequestException("物料不存在");
|
||||
|
||||
|
||||
dto.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextId());
|
||||
dto.setCreate_id(currentUserId);
|
||||
dto.setCreate_name(nickName);
|
||||
@@ -102,10 +117,13 @@ public class RawfoilworkorderServiceImpl implements RawfoilworkorderService {
|
||||
dto.setUpdate_optname(nickName);
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
dto.setIs_delete("0");
|
||||
dto.setProduct_area(jsonPoint.getString("product_area"));
|
||||
dto.setPoint_code(jsonPoint.getString("point_code"));
|
||||
dto.setStatus("01");
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.insert(json);
|
||||
JSONObject json1 = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.insert(json1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -114,17 +132,35 @@ public class RawfoilworkorderServiceImpl implements RawfoilworkorderService {
|
||||
RawfoilworkorderDto entity = this.findById(dto.getWorkorder_id());
|
||||
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
|
||||
WQLObject pointTab = WQLObject.getWQLObject("ST_IVT_SbPointIvt");
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder");
|
||||
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase");
|
||||
|
||||
String container_name = dto.getContainer_name();
|
||||
|
||||
|
||||
Long currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
String now = DateUtil.now();
|
||||
|
||||
JSONObject jsonPoint = pointTab.query("ext_code ='" + dto.getResource_name() + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonPoint)) throw new BadRequestException("点位设备不存在");
|
||||
|
||||
JSONObject josnMater = materTab.query("material_code ='" + dto.getProduct_name() + "' and is_delete = '0' and is_used = '1'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(josnMater)) throw new BadRequestException("物料不存在");
|
||||
|
||||
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_optid(currentUserId);
|
||||
dto.setUpdate_optname(nickName);
|
||||
dto.setProduct_area(jsonPoint.getString("product_area"));
|
||||
dto.setPoint_code(jsonPoint.getString("point_code"));
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_rawfoilworkorder");
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
wo.update(json);
|
||||
|
||||
JSONArray resultJSONArray = wo.query("container_name = '" + container_name + "' and status <> '09'").getResultJSONArray(0);
|
||||
if (resultJSONArray.size() > 1) throw new BadRequestException("母卷号已存在");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user