优化
This commit is contained in:
@@ -215,6 +215,7 @@ public class DailyplanServiceImpl implements DailyplanService {
|
||||
if(jret.size()>0){
|
||||
JSONObject form = new JSONObject();
|
||||
form.put("rows",jret);
|
||||
form.put("query",whereJson);
|
||||
this.submit2(form);
|
||||
}
|
||||
jret = WQL.getWO("QPDM_PRODUCTDAILYPLAN")
|
||||
@@ -437,12 +438,16 @@ public class DailyplanServiceImpl implements DailyplanService {
|
||||
}
|
||||
String captemplate_id = captemplate.getString("id");
|
||||
JSONArray ja = form.getJSONArray("rows");
|
||||
JSONObject query = form.getJSONObject("query");
|
||||
String checked = query.getString("checked");
|
||||
if (StrUtil.isEmpty(checked)) {
|
||||
checked = "false";
|
||||
}
|
||||
|
||||
JSONObject last = MPS_BD_ProductDailyPlan.query("device_id='"+ja.getJSONObject(0).getString("device_id")+"' and status='01'","planstart_date").uniqueResult(0);
|
||||
if(last ==null ){
|
||||
throw new BadRequestException("日计划表此分组设备的最早一个日计划为空,没有可重排数据!");
|
||||
}
|
||||
|
||||
JSONArray ja_new = new JSONArray();
|
||||
for (int i = 0; i < ja.size(); i++) {
|
||||
JSONObject jo = ja.getJSONObject(i);
|
||||
@@ -452,8 +457,21 @@ public class DailyplanServiceImpl implements DailyplanService {
|
||||
MPS_BD_ProductDailyPlan.delete(jo);
|
||||
}
|
||||
}
|
||||
|
||||
String nowstart_date = last.getString("planstart_date");
|
||||
Date date = DateUtil.parse(nowstart_date);
|
||||
if(checked.equals("true")){
|
||||
if (StrUtil.isNotEmpty(query.getString("nowstart_date"))) {
|
||||
String nowstart_date2 = query.getString("nowstart_date").substring(0,10);
|
||||
Date date2 = DateUtil.parse(nowstart_date2);
|
||||
//指定日期小于最晚的日计划日期
|
||||
if(date2.getTime() >= date.getTime()){
|
||||
nowstart_date = nowstart_date2;
|
||||
date = date2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//当天产能是否有剩余
|
||||
double pcsn_num_day = 0;
|
||||
|
||||
@@ -474,7 +492,7 @@ public class DailyplanServiceImpl implements DailyplanService {
|
||||
int totalproducecapacity_qty = series.getInteger("totalproducecapacity_qty");
|
||||
//第一条查数据库
|
||||
if(StrUtil.isNotEmpty(nowstart_date)){
|
||||
JSONObject last2 = MPS_BD_ProductDailyPlan.query("device_id='"+jo.getString("device_id")+"'","planstart_date desc,create_time desc").uniqueResult(0);
|
||||
JSONObject last2 = MPS_BD_ProductDailyPlan.query("device_id='"+jo.getString("device_id")+"' and planstart_date>='"+nowstart_date+"'","planstart_date desc,create_time desc").uniqueResult(0);
|
||||
String standard_mark = jo.getString("standard_mark");
|
||||
if(last2 != null ){
|
||||
nowstart_date = last2.getString("planstart_date");
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
<!--左侧插槽-->
|
||||
<slot name="left" />
|
||||
<el-button slot="left" type="info" @click="dialogVisible = false">关闭</el-button>
|
||||
<el-button slot="left" type="primary" @click="submit">保存</el-button>
|
||||
</span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -99,7 +98,7 @@ export default {
|
||||
cxjList: [],
|
||||
XLList: [],
|
||||
fullscreenLoading: false,
|
||||
queryrow: { device_id: '', status: '01' },
|
||||
queryrow: { device_id: '', status: '01', nowstart_date: '', checked: '' },
|
||||
sortable: null,
|
||||
rows: []
|
||||
}
|
||||
@@ -127,8 +126,10 @@ export default {
|
||||
* 接受父组件传值
|
||||
* @param msg
|
||||
*/
|
||||
getMsg(msg) {
|
||||
getMsg(msg, msg2, msg3) {
|
||||
this.queryrow.device_id = msg
|
||||
this.queryrow.nowstart_date = msg2
|
||||
this.queryrow.checked = msg3
|
||||
this.queryrow.status = '01'
|
||||
},
|
||||
queryStruct() {
|
||||
@@ -172,6 +173,9 @@ export default {
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.queryrow.device_id = ''
|
||||
this.queryrow.nowstart_date = ''
|
||||
this.queryrow.checked = ''
|
||||
this.tableDtl = []
|
||||
this.$emit('update:dialogShow', false)
|
||||
this.$emit('StructIvtClosed', this.rows)
|
||||
|
||||
@@ -99,6 +99,16 @@
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="初始日期">
|
||||
<label slot="label">初始日期:</label>
|
||||
<el-date-picker
|
||||
v-model="query.nowstart_date"
|
||||
type="date"
|
||||
style="width: 200px"
|
||||
placeholder="选择日期">
|
||||
</el-date-picker>
|
||||
<el-checkbox v-model="query.checked">启用</el-checkbox>
|
||||
<rrOperation />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -200,6 +210,7 @@ import workorder from '@/api/wms/pdm/workorder'
|
||||
import crudseriesProcessRoute from '@/api/wms/pdm/seriesProcessRoute'
|
||||
import { download } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
import Date from '@/utils/datetime'
|
||||
|
||||
export default {
|
||||
name: 'dailyplan',
|
||||
@@ -212,7 +223,7 @@ export default {
|
||||
url: 'api/dailyplan',
|
||||
idField: 'dailyplan_id',
|
||||
sort: '',
|
||||
query: { device_id: '' },
|
||||
query: { nowstart_date: new Date(),device_id: '' },
|
||||
crudMethod: { ...dailyplan },
|
||||
optShow: {
|
||||
add: true,
|
||||
@@ -315,7 +326,7 @@ export default {
|
||||
return false
|
||||
}
|
||||
this.form.device_id = this.crud.query.device_id
|
||||
this.$refs.child.getMsg(this.crud.query.device_id)
|
||||
this.$refs.child.getMsg(this.crud.query.device_id, this.crud.query.nowstart_date, this.crud.query.checked)
|
||||
this.structshow = true
|
||||
},
|
||||
downdtl() {
|
||||
|
||||
Reference in New Issue
Block a user