工令批次号修改
This commit is contained in:
@@ -92,4 +92,11 @@ public class WorkOrderController {
|
||||
public ResponseEntity<Object> createPcsn(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(workOrdereService.createPcsn(whereJson),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("获取明细list")
|
||||
@ApiOperation("获取Bom明细list")
|
||||
@GetMapping("/getDepts")
|
||||
public ResponseEntity<Object> getDepts(@RequestParam Map whereJson) {
|
||||
return new ResponseEntity<>(workOrdereService.getDepts(whereJson),HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -64,4 +64,9 @@ public interface WorkOrdereService {
|
||||
* @param whereJson /
|
||||
*/
|
||||
JSONObject createPcsn(Map whereJson);
|
||||
/**
|
||||
* 提交
|
||||
* @param whereJson /
|
||||
*/
|
||||
JSONArray getDepts(Map whereJson);
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
if (StrUtil.isNotEmpty(end_time)) {
|
||||
map.put("end_time", end_time.substring(0,10)+" 23:59:59");
|
||||
}
|
||||
JSONObject json = WQL.getWO("QPDM_WORKORDER01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "WorkOrder.workorder_code");
|
||||
JSONObject json = WQL.getWO("QPDM_WORKORDER01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "WorkOrder.planstart_time,WorkOrder.workorder_code");
|
||||
return json;
|
||||
}
|
||||
@Override
|
||||
@@ -75,7 +75,7 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
if (StrUtil.isNotEmpty(material_id)) {
|
||||
map.put("material_id", "%" + material_id + "%");
|
||||
}
|
||||
JSONObject json = WQL.getWO("QPDM_WORKORDER01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "WorkOrder.workorder_code");
|
||||
JSONObject json = WQL.getWO("QPDM_WORKORDER01").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "WorkOrder.planstart_time,WorkOrder.workorder_code");
|
||||
return json;
|
||||
}
|
||||
@Override
|
||||
@@ -621,6 +621,14 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
if(StrUtil.isEmpty(material_id)){
|
||||
throw new BadRequestException("产品id不能为空!");
|
||||
}
|
||||
String org_id = map.get("org_id");
|
||||
if(StrUtil.isEmpty(org_id)){
|
||||
throw new BadRequestException("所属组织不能为空!");
|
||||
}
|
||||
String is_experiment = map.get("is_experiment");
|
||||
if(StrUtil.isEmpty(is_experiment)){
|
||||
throw new BadRequestException("是否实验粉不能为空!");
|
||||
}
|
||||
WQLObject wo_param = WQLObject.getWQLObject("sys_param");
|
||||
JSONObject param = wo_param.query("is_active='1' and is_delete='0' and code='PCSN_NUM'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(param)) {
|
||||
@@ -635,11 +643,27 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
if(StrUtil.isEmpty(old_mark)){
|
||||
throw new BadRequestException("成品物料扩展信息表牌号不能为空!");
|
||||
}
|
||||
WQLObject pdm_bi_productdeptpcsn = WQLObject.getWQLObject("pdm_bi_productdeptpcsn");
|
||||
JSONObject org = pdm_bi_productdeptpcsn.query("org_id='"+org_id+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(org)) {
|
||||
throw new BadRequestException("生产事业部批次代码查询失败!");
|
||||
}
|
||||
String org_pcsn = org.getString("org_pcsn");
|
||||
if(StrUtil.isEmpty(org_pcsn)){
|
||||
throw new BadRequestException("生产事业部批次代码不能为空!");
|
||||
}
|
||||
org_pcsn = org_pcsn.replace(" ","");
|
||||
String technology_code = mater.getString("technology_code");
|
||||
|
||||
if(StrUtil.isEmpty(technology_code)){
|
||||
technology_code = "";
|
||||
}
|
||||
technology_code = technology_code.replace(" ","");
|
||||
|
||||
WQLObject PDM_BI_BrandMaxPCSN = WQLObject.getWQLObject("PDM_BI_BrandMaxPCSN");
|
||||
DateTime now = DateTime.now();
|
||||
String year = now.year()+"";
|
||||
JSONObject jo_pcsn = PDM_BI_BrandMaxPCSN.query("brand_code='"+old_mark+"' and year='"+year+"'").uniqueResult(0);
|
||||
JSONObject jo_pcsn = PDM_BI_BrandMaxPCSN.query("brand_code='"+old_mark+"' and year='"+year+"' and org_id='"+org_id+"'").uniqueResult(0);
|
||||
JSONObject ret = new JSONObject();
|
||||
if(jo_pcsn==null){
|
||||
String value = "";
|
||||
@@ -651,6 +675,11 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
}
|
||||
value += max_sn;
|
||||
value = year.substring(2)+value;
|
||||
value = org_pcsn+value;
|
||||
value = value+technology_code;
|
||||
if("1".equals(is_experiment)){
|
||||
value = value+"S";
|
||||
}
|
||||
ret.put("pcsn",value);
|
||||
}else{
|
||||
String value = "";
|
||||
@@ -665,6 +694,12 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
}
|
||||
value += max_sn;
|
||||
value = year.substring(2)+value;
|
||||
value = org_pcsn+value;
|
||||
value = value+technology_code;
|
||||
|
||||
if("1".equals(is_experiment)){
|
||||
value = value+"S";
|
||||
}
|
||||
ret.put("pcsn",value);
|
||||
}
|
||||
return ret;
|
||||
@@ -676,6 +711,15 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
if(StrUtil.isEmpty(material_id)){
|
||||
throw new BadRequestException("产品id不能为空!");
|
||||
}
|
||||
String org_id = from.getString("org_id");
|
||||
if(StrUtil.isEmpty(org_id)){
|
||||
throw new BadRequestException("所属组织不能为空!");
|
||||
}
|
||||
WQLObject wo_param = WQLObject.getWQLObject("sys_param");
|
||||
JSONObject param = wo_param.query("is_active='1' and is_delete='0' and code='PCSN_NUM'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(param)) {
|
||||
throw new BadRequestException("批次序号的位数系统参数查询失败!");
|
||||
}
|
||||
WQLObject md_me_producmaterialext = WQLObject.getWQLObject("md_me_producmaterialext");
|
||||
JSONObject mater = md_me_producmaterialext.query("material_id='"+material_id+"'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(mater)) {
|
||||
@@ -688,18 +732,21 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
WQLObject PDM_BI_BrandMaxPCSN = WQLObject.getWQLObject("PDM_BI_BrandMaxPCSN");
|
||||
DateTime now = DateTime.now();
|
||||
String year = now.year()+"";
|
||||
JSONObject jo_pcsn = PDM_BI_BrandMaxPCSN.query("brand_code='"+old_mark+"' and year='"+year+"'").uniqueResult(0);
|
||||
JSONObject jo_pcsn = PDM_BI_BrandMaxPCSN.query("brand_code='"+old_mark+"' and year='"+year+"' and org_id='"+org_id+"'").uniqueResult(0);
|
||||
if(jo_pcsn == null){
|
||||
JSONObject ret = new JSONObject();
|
||||
ret.put("brandmax_id", IdUtil.getSnowflake(1, 1).nextId());
|
||||
ret.put("brand_code",old_mark);
|
||||
ret.put("year",year);
|
||||
pcsn = pcsn.substring(2,pcsn.length());
|
||||
ret.put("org_id",org_id);
|
||||
int length = param.getInteger("value");
|
||||
pcsn = pcsn.substring(3,3+length);
|
||||
int max_sn = Integer.parseInt(pcsn);
|
||||
ret.put("max_sn",max_sn);
|
||||
PDM_BI_BrandMaxPCSN.insert(ret);
|
||||
}else{
|
||||
pcsn = pcsn.substring(2,pcsn.length());
|
||||
int length = param.getInteger("value");
|
||||
pcsn = pcsn.substring(3,3+length);
|
||||
int max_sn = Integer.parseInt(pcsn);
|
||||
if(jo_pcsn.getInteger("max_sn") == max_sn){
|
||||
throw new BadRequestException("工令牌号此生产批次已存在!");
|
||||
@@ -709,4 +756,12 @@ public class WorkOrderServiceImpl implements WorkOrdereService {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray getDepts(Map json) {
|
||||
HashMap<String, String> map = new HashMap<>(json);
|
||||
map.put("flag", "14");
|
||||
JSONArray ret = WQL.getWO("QPDM_WORKORDER01").addParamMap(map).process().getResultJSONArray(0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.workorder_code TYPEAS s_string
|
||||
输入.org_id TYPEAS s_string
|
||||
输入.material_id TYPEAS s_string
|
||||
输入.workorder_type TYPEAS s_string
|
||||
输入.status TYPEAS s_string
|
||||
@@ -83,6 +84,9 @@
|
||||
OPTION 输入.end_time <> ""
|
||||
WorkOrder.planstart_time <= 输入.end_time
|
||||
ENDOPTION
|
||||
OPTION 输入.org_id <> ""
|
||||
WorkOrder.org_id = 输入.org_id
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
@@ -182,5 +186,20 @@
|
||||
ENDIF
|
||||
|
||||
|
||||
IF 输入.flag = "14"
|
||||
QUERY
|
||||
SELECT
|
||||
productdeptpcsn.org_id AS id,
|
||||
productdeptpcsn.org_code AS code,
|
||||
productdeptpcsn.org_name AS name
|
||||
FROM
|
||||
pdm_bi_productdeptpcsn productdeptpcsn
|
||||
WHERE
|
||||
1 = 1
|
||||
ENDSELECT
|
||||
ENDQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -54,4 +54,11 @@ export function createPcsn(params) {
|
||||
params
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, submit, confirmWork, openWork, createPcsn }
|
||||
export function getDepts(params) {
|
||||
return request({
|
||||
url: 'api/workorder/getDepts',
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export default { add, edit, del, submit, confirmWork, openWork, createPcsn, getDepts }
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
:visible.sync="crud.status.cu > 0 || crud.status.view > 0"
|
||||
@close="close"
|
||||
>
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="85px" label-suffix=":">
|
||||
<el-form ref="form" style="border: 1px solid #cfe0df;margin-top: 10px;padding-top: 10px;" :inline="true" :model="form" :rules="rules" size="mini" label-width="105px" label-suffix=":">
|
||||
<el-form-item label="工令号" prop="workorder_code">
|
||||
<label slot="label">工 令 号:</label>
|
||||
<el-input v-model="form.workorder_code" disabled placeholder="系统生成" clearable style="width: 210px" />
|
||||
@@ -49,12 +49,32 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属组织" prop="org_id">
|
||||
<el-select
|
||||
v-model="form.org_id"
|
||||
placeholder=""
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
@change="storChange"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in Depts"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否实验粉" prop="is_experiment">
|
||||
<label slot="label">是否实验粉:</label>
|
||||
<el-radio v-model="form.is_experiment" label="1" @change="storChange">是</el-radio>
|
||||
<el-radio v-model="form.is_experiment" label="0" @change="storChange">否</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产批次" prop="pcsn">
|
||||
<label slot="label">生产批次:</label>
|
||||
<el-input v-model="form.pcsn" style="width: 210px" disabled class="input-with-select">
|
||||
<el-button slot="append" @click="createPcsn" v-show="crud.status.add === 1" >生成</el-button>
|
||||
</el-input>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="总重量" prop="workorder_qty">
|
||||
<label slot="label">总 重 量:</label>
|
||||
@@ -104,10 +124,12 @@ const defaultForm = {
|
||||
device_name:'',
|
||||
device_id:'',
|
||||
pcsn:'',
|
||||
org_id:'',
|
||||
status: '10',
|
||||
product_series_id:'',
|
||||
workorder_qty: '500',
|
||||
workorder_type: '01',
|
||||
is_experiment: '0',
|
||||
remark: '',
|
||||
planstart_time: ''
|
||||
}
|
||||
@@ -127,15 +149,22 @@ export default {
|
||||
dialogVisible: false,
|
||||
dtlShow: false,
|
||||
materType: '05',
|
||||
XLList:[],
|
||||
XLList: [],
|
||||
Depts: [],
|
||||
materShow: false,
|
||||
rules: {
|
||||
pcsn: [
|
||||
{ required: true, message: '批次不能为空', trigger: 'blur' }
|
||||
],
|
||||
planstart_time: [
|
||||
{ required: true, message: '计划开始时间不能为空', trigger: 'blur' }
|
||||
],
|
||||
workorder_type: [
|
||||
{ required: true, message: '工令类型不能为空', trigger: 'blur' }
|
||||
],
|
||||
org_id: [
|
||||
{ required: true, message: '所属组织不能为空', trigger: 'blur' }
|
||||
],
|
||||
material_code: [
|
||||
{ required: true, message: '产品不能为空', trigger: 'blur' }
|
||||
],
|
||||
@@ -159,6 +188,9 @@ export default {
|
||||
crudseriesProcessRoute.getXLlist2().then(res => {
|
||||
this.XLList = res
|
||||
})
|
||||
workorder.getDepts().then(res => {
|
||||
this.Depts = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
@@ -183,7 +215,11 @@ export default {
|
||||
this.crud.notify('请选择产品!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
workorder.createPcsn({ 'material_id': this.form.material_id}).then(res => {
|
||||
if (this.form.org_id === '') {
|
||||
this.crud.notify('请选择所属组织!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
workorder.createPcsn({ 'material_id': this.form.material_id, 'org_id': this.form.org_id, 'is_experiment': this.form.is_experiment }).then(res => {
|
||||
this.crud.notify('操作成功!')
|
||||
this.form.pcsn = res.pcsn
|
||||
})
|
||||
@@ -194,10 +230,10 @@ export default {
|
||||
this.form.product_series_id = row.product_series
|
||||
this.form.qty_unit_id = row.base_unit_id
|
||||
this.form.qty_unit_name = row.base_unit_id_name
|
||||
this.form.pscn = ''
|
||||
workorder.createPcsn({ 'material_id': this.form.material_id}).then(res => {
|
||||
this.form.pcsn = res.pcsn
|
||||
})
|
||||
this.form.pcsn = ''
|
||||
},
|
||||
storChange(row) {
|
||||
this.form.pcsn = ''
|
||||
},
|
||||
tableChanged(row) {
|
||||
this.form.device_id = row.device_id
|
||||
|
||||
@@ -39,13 +39,34 @@
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dict.product_serie"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
v-for="item in XLList"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="所属组织" prop="org_id">
|
||||
<el-select
|
||||
v-model="form.org_id"
|
||||
placeholder=""
|
||||
style="width: 210px"
|
||||
class="filter-item"
|
||||
disabled
|
||||
>
|
||||
<el-option
|
||||
v-for="item in Depts"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否实验粉" prop="is_experiment">
|
||||
<label slot="label">是否实验粉:</label>
|
||||
<el-radio v-model="form.is_experiment" label="1" disabled>是</el-radio>
|
||||
<el-radio v-model="form.is_experiment" label="0" disabled>否</el-radio>
|
||||
</el-form-item>
|
||||
<el-form-item label="生产批次" prop="pcsn">
|
||||
<label slot="label">生产批次:</label>
|
||||
<el-input v-model="form.pcsn" style="width: 210px" disabled />
|
||||
@@ -210,6 +231,9 @@
|
||||
|
||||
<script>
|
||||
|
||||
import crudseriesProcessRoute from "@/api/wms/pdm/seriesProcessRoute";
|
||||
import workorder from "@/api/wms/pdm/workorder";
|
||||
|
||||
export default {
|
||||
name: 'ViewDialog',
|
||||
components: { },
|
||||
@@ -226,6 +250,8 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
Depts: [],
|
||||
XLList: [],
|
||||
form: {}
|
||||
}
|
||||
},
|
||||
@@ -241,11 +267,22 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
crudseriesProcessRoute.getXLlist2().then(res => {
|
||||
this.XLList = res
|
||||
})
|
||||
workorder.getDepts().then(res => {
|
||||
this.Depts = res
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
close() {
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.form = {}
|
||||
this.$emit('AddChanged')
|
||||
},
|
||||
storChange() {
|
||||
return false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,24 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="所属组织">
|
||||
<el-select
|
||||
v-model="query.org_id"
|
||||
clearable
|
||||
size="mini"
|
||||
placeholder="所属组织"
|
||||
class="filter-item"
|
||||
@change="crud.toQuery"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in Depts"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<rrOperation />
|
||||
</el-form>
|
||||
</div>
|
||||
@@ -179,6 +197,7 @@
|
||||
<el-link type="warning" @click="toView(scope.$index, scope.row)">{{ scope.row.workorder_code }}</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="org_id" :formatter="orgFormat" min-width="120" label="所属组织" />
|
||||
<el-table-column prop="workorder_type" :formatter="bill_typeFormat" min-width="80" label="工令类型" />
|
||||
<el-table-column :formatter="stateFormat" min-width="100" prop="status" label="工令状态" />
|
||||
<el-table-column prop="device_name" min-width="130" label="设备"/>
|
||||
@@ -197,6 +216,11 @@
|
||||
<el-table-column min-width="100" prop="source_bill_type" label="源类型" />
|
||||
<el-table-column prop="source_bill_code" label="来源单据编号" min-width="100" />
|
||||
<el-table-column min-width="100" prop="workprocedure_name" label="当前工序" />
|
||||
<el-table-column prop="remark" min-width="100" label="备注"/>
|
||||
<el-table-column prop="startwork_name" min-width="100" label="开工人"/>
|
||||
<el-table-column prop="endwork_name" min-width="100" label="完工人"/>
|
||||
<el-table-column prop="create_name" min-width="100" label="创建人"/>
|
||||
<el-table-column prop="update_optname" min-width="100" label="修改人"/>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
@@ -226,7 +250,6 @@ export default {
|
||||
components: { ChangeDialog, ViewDialog, AddDialog, crudOperation, rrOperation, udOperation, pagination },
|
||||
cruds() {
|
||||
return CRUD({ title: '工令', idField: 'workorder_id', url: 'api/workorder', crudMethod: { ...workorder },
|
||||
//query:{createTime:[new Date(), new Date().daysLater(2)]},
|
||||
optShow: {
|
||||
add: true,
|
||||
edit: false,
|
||||
@@ -253,7 +276,8 @@ export default {
|
||||
open_flag: true,
|
||||
confirm_flag: true,
|
||||
mstrow: {},
|
||||
XLList:[],
|
||||
XLList: [],
|
||||
Depts: [],
|
||||
viewShow: false,
|
||||
changeShow: false,
|
||||
currentRow: null,
|
||||
@@ -270,7 +294,10 @@ export default {
|
||||
crudseriesProcessRoute.getXLlist2().then(res => {
|
||||
this.XLList = res
|
||||
})
|
||||
this.crud.query.createTime= [new Date(), new Date().daysLater(2)]
|
||||
workorder.getDepts().then(res => {
|
||||
this.Depts = res
|
||||
})
|
||||
this.crud.query.createTime = [new Date(), new Date().daysLater(2)]
|
||||
this.crud.toQuery()
|
||||
},
|
||||
methods: {
|
||||
@@ -330,6 +357,13 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
orgFormat(row) {
|
||||
for (const item of this.Depts) {
|
||||
if (item.id === row.org_id) {
|
||||
return item.name
|
||||
}
|
||||
}
|
||||
},
|
||||
workorder_dateFormat(row) {
|
||||
return row.planstart_time.substring(0, 10)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user