代码更新

This commit is contained in:
2022-11-16 09:22:05 +08:00
parent abd645a41b
commit 01cc33b59d
9 changed files with 199 additions and 37 deletions

View File

@@ -152,7 +152,7 @@ public class RawFoilServiceImpl implements RawFoilService {
if (StrUtil.equals(point_location, "1")) map.put("point_location", "0"); if (StrUtil.equals(point_location, "1")) map.put("point_location", "0");
JSONObject jsonIvt_tow = WQL.getWO("PDA_RAWFOIL_01").addParamMap(map).process().uniqueResult(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"); start_pint_code = jsonIvt_tow.getString("empty_point_code");
} else { } else {
start_pint_code = jsonIvt.getString("empty_point_code"); start_pint_code = jsonIvt.getString("empty_point_code");

View File

@@ -43,4 +43,11 @@ public class CoolOutController {
public ResponseEntity<Object> confirmInstor(@RequestBody JSONObject whereJson){ public ResponseEntity<Object> confirmInstor(@RequestBody JSONObject whereJson){
return new ResponseEntity<>(coolOutService.confirmInstor(whereJson),HttpStatus.OK); 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);
}
} }

View File

@@ -23,4 +23,11 @@ public interface CoolOutService {
* @return JSONObject / * @return JSONObject /
*/ */
JSONObject confirmInstor(JSONObject whereJson); JSONObject confirmInstor(JSONObject whereJson);
/**
* 区域下拉框查询
* @param whereJson /
* @return JSONObject /
*/
JSONObject areaQuery(JSONObject whereJson);
} }

View File

@@ -31,9 +31,12 @@ public class CoolInServiceImpl implements CoolInService {
@Override @Override
public JSONObject coolIOQuery(JSONObject whereJson) { public JSONObject coolIOQuery(JSONObject whereJson) {
String container_name = whereJson.getString("container_name");
JSONObject map = new JSONObject(); JSONObject map = new JSONObject();
map.put("flag", "1"); 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); JSONArray resultJSONArray = WQL.getWO("PDA_COOLIN").addParamMap(map).process().getResultJSONArray(0);
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
@@ -80,6 +83,9 @@ public class CoolInServiceImpl implements CoolInService {
jsonCool.put("confirm_optname", currentUsername); jsonCool.put("confirm_optname", currentUsername);
jsonCool.put("confirm_time", DateUtil.now()); jsonCool.put("confirm_time", DateUtil.now());
coolIvtTab.insert(jsonCool);*/ 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"); jsonCoolIvt.put("full_point_status", "02");

View File

@@ -26,7 +26,8 @@ import org.springframework.transaction.annotation.Transactional;
@Service @Service
@RequiredArgsConstructor @RequiredArgsConstructor
@Slf4j @Slf4j
public class CoolOutServiceImpl implements CoolOutService { public class CoolOutServiceImpl
implements CoolOutService {
@Override @Override
public JSONObject coolIOQuery(JSONObject whereJson) { public JSONObject coolIOQuery(JSONObject whereJson) {
@@ -66,4 +67,14 @@ public class CoolOutServiceImpl implements CoolOutService {
result.put("message", "出库成功!"); result.put("message", "出库成功!");
return result; 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;
}
} }

View File

@@ -74,7 +74,7 @@
der.is_delete = '0' der.is_delete = '0'
OPTION 输入.container_name <> "" OPTION 输入.container_name <> ""
der.container_name = 输入.container_name der.container_name like 输入.container_name
ENDOPTION ENDOPTION
ENDSELECT ENDSELECT

View File

@@ -80,3 +80,17 @@
ENDSELECT ENDSELECT
ENDQUERY ENDQUERY
ENDIF ENDIF
IF 输入.flag = "2"
QUERY
SELECT
value,
label
FROM
sys_dict_detail
WHERE
name = 'product_area'
ENDSELECT
ENDQUERY
ENDIF

View File

@@ -91,10 +91,25 @@ public class RawfoilworkorderServiceImpl implements RawfoilworkorderService {
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void create(RawfoilworkorderDto dto) { 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(); Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName(); String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now(); 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.setWorkorder_id(IdUtil.getSnowflake(1, 1).nextId());
dto.setCreate_id(currentUserId); dto.setCreate_id(currentUserId);
dto.setCreate_name(nickName); dto.setCreate_name(nickName);
@@ -102,10 +117,13 @@ public class RawfoilworkorderServiceImpl implements RawfoilworkorderService {
dto.setUpdate_optname(nickName); dto.setUpdate_optname(nickName);
dto.setUpdate_time(now); dto.setUpdate_time(now);
dto.setCreate_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 json1 = JSONObject.parseObject(JSON.toJSONString(dto));
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); wo.insert(json1);
wo.insert(json);
} }
@Override @Override
@@ -114,17 +132,35 @@ public class RawfoilworkorderServiceImpl implements RawfoilworkorderService {
RawfoilworkorderDto entity = this.findById(dto.getWorkorder_id()); RawfoilworkorderDto entity = this.findById(dto.getWorkorder_id());
if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); 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(); Long currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName(); String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now(); 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_time(now);
dto.setUpdate_optid(currentUserId); dto.setUpdate_optid(currentUserId);
dto.setUpdate_optname(nickName); 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)); JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
wo.update(json); wo.update(json);
JSONArray resultJSONArray = wo.query("container_name = '" + container_name + "' and status <> '09'").getResultJSONArray(0);
if (resultJSONArray.size() > 1) throw new BadRequestException("母卷号已存在");
} }
@Override @Override

View File

@@ -101,33 +101,96 @@
:before-close="crud.cancelCU" :before-close="crud.cancelCU"
:visible.sync="crud.status.cu > 0" :visible.sync="crud.status.cu > 0"
:title="crud.status.title" :title="crud.status.title"
width="500px" width="800px"
> >
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" size="mini" label-width="110px">
<el-form-item label="母卷号" prop="container_name"> <el-row>
<el-input v-model="form.container_name" style="width: 370px;" /> <el-col :span="12">
</el-form-item> <el-form-item label="母卷号" prop="container_name">
<el-form-item label="机台编码" prop="resource_name"> <el-input v-model="form.container_name" style="width: 250px;" />
<el-input v-model="form.resource_name" style="width: 370px;" /> </el-form-item>
</el-form-item> </el-col>
<el-form-item label="生产工单" prop="mfg_order_name"> <el-col :span="12">
<el-input v-model="form.mfg_order_name" style="width: 370px;" /> <el-form-item label="机台编码" prop="resource_name">
</el-form-item> <el-input v-model="form.resource_name" style="width: 250px;" />
<el-form-item label="产品编码" prop="product_name"> </el-form-item>
<el-input v-model="form.product_name" style="width: 370px;" /> </el-col>
</el-form-item> </el-row>
<el-form-item label="产品名称" prop="description">
<el-input v-model="form.description" style="width: 370px;" /> <el-row>
</el-form-item> <el-col :span="12">
<el-form-item label="重量"> <el-form-item label="生产工单" prop="mfg_order_name">
<el-input v-model="form.productin_qty" style="width: 370px;" /> <el-input v-model="form.mfg_order_name" style="width: 250px;" />
</el-form-item> </el-form-item>
<el-form-item label="车号"> </el-col>
<el-input v-model="form.agvno" style="width: 370px;" /> <el-col :span="12">
</el-form-item> <el-form-item label="产品编码" prop="product_name">
<el-form-item label="备注"> <el-input v-model="form.product_name" style="width: 250px;" />
<el-input v-model="form.remark" style="width: 370px;" /> </el-form-item>
</el-form-item> </el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="产品名称" prop="description">
<el-input v-model="form.description" style="width: 250px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="理论长度" prop="theory_height">
<el-input v-model="form.theory_height" style="width: 250px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="设备生产速度" prop="eqp_velocity">
<el-input v-model="form.eqp_velocity" style="width: 250px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="上卷开始时间" prop="up_coiler_date">
<!-- <el-date-picker v-model="form.up_coiler_date" type="date" placeholder="选择日期" style="width: 250px" value-format="yyyy-MM-dd" />-->
<el-date-picker
v-model="form.up_coiler_date"
type="datetime"
placeholder="选择日期时间"
style="width: 250px"
value-format="yyyy-MM-dd HH:mm:ss"
default-time="12:00:00">
</el-date-picker>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="重量">
<el-input v-model="form.productin_qty" style="width: 250px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="车号">
<el-input v-model="form.agvno" style="width: 250px;" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="12">
<el-form-item label="备注">
<el-input v-model="form.remark" style="width: 250px;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否重新更新">
<el-radio v-model="form.is_reload_send" label="0">否</el-radio>
<el-radio v-model="form.is_reload_send" label="1">是</el-radio>
</el-form-item>
</el-col>
</el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="text" @click="crud.cancelCU">取消</el-button> <el-button type="text" @click="crud.cancelCU">取消</el-button>
@@ -192,7 +255,7 @@ const defaultForm = {
theory_height: null, theory_height: null,
eqp_velocity: null, eqp_velocity: null,
up_coiler_date: null, up_coiler_date: null,
is_reload_send: null, is_reload_send: '0',
productin_qty: null, productin_qty: null,
realstart_time: null, realstart_time: null,
realend_time: null, realend_time: null,
@@ -221,7 +284,7 @@ export default {
sort: 'workorder_id,desc', sort: 'workorder_id,desc',
crudMethod: { ...crudRawfoilworkorder }, crudMethod: { ...crudRawfoilworkorder },
optShow: { optShow: {
add: false, add: true,
edit: false, edit: false,
del: false, del: false,
download: false, download: false,
@@ -238,6 +301,24 @@ export default {
], ],
resource_name: [ resource_name: [
{ required: true, message: '机台编码不能为空', trigger: 'blur' } { required: true, message: '机台编码不能为空', trigger: 'blur' }
],
mfg_order_name: [
{ required: true, message: '生产工单不能为空', trigger: 'blur' }
],
product_name: [
{ required: true, message: '产品编码不能为空', trigger: 'blur' }
],
description: [
{ required: true, message: '产品名称不能为空', trigger: 'blur' }
],
theory_height: [
{ required: true, message: '理论长度不能为空', trigger: 'blur' }
],
eqp_velocity: [
{ required: true, message: '设备生产速度不能为空', trigger: 'blur' }
],
p_coiler_date: [
{ required: true, message: '上卷开始时间不能为空', trigger: 'blur' }
] ]
} }
} }