代码更新
This commit is contained in:
@@ -82,4 +82,10 @@ public class ProductplanprocDto implements Serializable {
|
||||
|
||||
/** 更新时间 */
|
||||
private String update_time;
|
||||
|
||||
/** 备注 */
|
||||
private String remark;
|
||||
|
||||
/** 任务号 */
|
||||
private String task_code;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.utils.FileUtil;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata.master.service.MaterialbaseService;
|
||||
@@ -128,7 +129,6 @@ public class ProductplanSumServiceImpl implements ProductplanSumService {
|
||||
}
|
||||
|
||||
WQLObject procTab = WQLObject.getWQLObject("pcs_if_productplanproc");
|
||||
WQLObject planTab = WQLObject.getWQLObject("PCS_IF_ProductPlan");
|
||||
dto.setMaterial_id(Long.valueOf(jsonMater.getString("material_id")));
|
||||
dto.setMaterial_code(material_code);
|
||||
dto.setMaterial_name(jsonMater.getString("material_name"));
|
||||
@@ -143,36 +143,18 @@ public class ProductplanSumServiceImpl implements ProductplanSumService {
|
||||
// 更新接口处理表
|
||||
JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto));
|
||||
procTab.update(json);
|
||||
// 更新接口表
|
||||
JSONObject jsonPlan = planTab.query("plan_id = '" + dto.getPlan_id() + "'").uniqueResult(0);
|
||||
jsonPlan.put("plan_month", dto.getPlan_month());
|
||||
jsonPlan.put("plan_org_code", dto.getPlan_org_code());
|
||||
jsonPlan.put("plan_org_name", dto.getPlan_org_name());
|
||||
jsonPlan.put("material_id", dto.getMaterial_id());
|
||||
jsonPlan.put("material_code", dto.getMaterial_code());
|
||||
jsonPlan.put("material_name", dto.getMaterial_name());
|
||||
jsonPlan.put("material_spec", dto.getMaterial_spec());
|
||||
jsonPlan.put("product_type_name", dto.getProduct_type_name());
|
||||
jsonPlan.put("weight_unit_id", dto.getWeight_unit_id());
|
||||
jsonPlan.put("weight_unit_name", dto.getWeight_unit_name());
|
||||
jsonPlan.put("product_weight", dto.getProduct_weight());
|
||||
jsonPlan.put("plan_finish_date", dto.getPlan_finish_date());
|
||||
planTab.update(jsonPlan);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(Long[] ids) {
|
||||
WQLObject procTab = WQLObject.getWQLObject("pcs_if_productplanproc");
|
||||
WQLObject planTab = WQLObject.getWQLObject("PCS_IF_ProductPlan");
|
||||
for (Long plan_id : ids) {
|
||||
JSONObject jsonProc = procTab.query("plan_id = '" + plan_id + "'").uniqueResult(0);
|
||||
JSONObject jsonPlan = planTab.query("plan_id = '" + plan_id + "'").uniqueResult(0);
|
||||
if (StrUtil.equals(jsonProc.getString("is_proc"), IsProcEnum.GENERATE.getCode())) {
|
||||
procTab.delete(jsonProc);
|
||||
planTab.delete(jsonPlan);
|
||||
} else {
|
||||
throw new BadRequestException("不为生成装填,不可删除");
|
||||
throw new BadRequestException("不为生成状态,不可删除");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -181,7 +163,6 @@ public class ProductplanSumServiceImpl implements ProductplanSumService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void importExcel(String id) {
|
||||
WQLObject planProcTab = WQLObject.getWQLObject("pcs_if_productplanproc");
|
||||
WQLObject planTab = WQLObject.getWQLObject("pcs_if_productplan");
|
||||
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase");
|
||||
JSONObject json = WQL.getWO("QPCS_IF_PRODUCTPLANPROC02").addParam("flag", "1").addParam("id", id).process().uniqueResult(0);
|
||||
//根据路径获取表格里的记录
|
||||
@@ -199,6 +180,7 @@ public class ProductplanSumServiceImpl implements ProductplanSumService {
|
||||
String product_type_name = String.valueOf(map.get(5));
|
||||
Long product_weight = Long.valueOf((String) map.get(6));
|
||||
String plan_finish_date = String.valueOf(map.get(7));
|
||||
String remark = String.valueOf(map.get(8));
|
||||
//校验数据准确性
|
||||
JSONObject jsonTab = WQL.getWO("QPCS_IF_PRODUCTPLANPROC02").addParam("flag", "2").addParam("code", plan_org_code).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonTab)) {
|
||||
@@ -237,42 +219,21 @@ public class ProductplanSumServiceImpl implements ProductplanSumService {
|
||||
dto.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dto.setUpdate_optname(SecurityUtils.getNickName());
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
//月生产计划接口表数据
|
||||
JSONObject jsonPlan = new JSONObject();
|
||||
jsonPlan.put("plan_id", dto.getPlan_id());
|
||||
jsonPlan.put("plan_code", dto.getPlan_code());
|
||||
jsonPlan.put("plan_month", dto.getPlan_month());
|
||||
jsonPlan.put("plan_org_code", dto.getPlan_org_code());
|
||||
jsonPlan.put("plan_org_name", dto.getPlan_org_name());
|
||||
jsonPlan.put("material_id", dto.getMaterial_id());
|
||||
jsonPlan.put("material_code", dto.getMaterial_code());
|
||||
jsonPlan.put("material_name", dto.getMaterial_name());
|
||||
jsonPlan.put("material_spec", dto.getMaterial_spec());
|
||||
jsonPlan.put("product_type_name", dto.getProduct_type_name());
|
||||
jsonPlan.put("weight_unit_id", dto.getWeight_unit_id());
|
||||
jsonPlan.put("weight_unit_name", dto.getWeight_unit_name());
|
||||
jsonPlan.put("product_weight", dto.getProduct_weight());
|
||||
jsonPlan.put("plan_finish_date", dto.getPlan_finish_date());
|
||||
jsonPlan.put("input_optid", dto.getInput_optid());
|
||||
jsonPlan.put("input_optname", dto.getInput_optname());
|
||||
jsonPlan.put("input_time", dto.getInput_time());
|
||||
dto.setRemark(remark);
|
||||
dto.setTask_code(CodeUtil.getNewCode("PCS_TASK_CODE"));
|
||||
//判断表里有没有此条记录
|
||||
JSONObject jsonObject = planProcTab.query("plan_org_code = '" + plan_org_code + "' and plan_month = '" + plan_month + "' and material_code ='" + material_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonObject)) {
|
||||
//如果是空的就插入两张表
|
||||
planProcTab.insert(JSONObject.parseObject(JSON.toJSONString(dto)));
|
||||
planTab.insert(jsonPlan);
|
||||
} else {
|
||||
if (!StrUtil.equals(jsonObject.getString("is_proc"), IsProcEnum.GENERATE.getCode())) {
|
||||
//非生成状态 返回错误信息
|
||||
throw new BadRequestException("此月度计划已存在并不可在修改");
|
||||
} else {
|
||||
//如果是生成状态则将当前记录删除,在重新插入
|
||||
JSONObject deletePlan = planTab.query("plan_id = '" + jsonObject.getString("plan_id") + "'").uniqueResult(0);
|
||||
planProcTab.delete(jsonObject);
|
||||
planTab.delete(deletePlan);
|
||||
planProcTab.insert(JSONObject.parseObject(JSON.toJSONString(dto)));
|
||||
planTab.insert(jsonPlan);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.exception.BadRequestException;
|
||||
import org.nl.modules.system.util.CodeUtil;
|
||||
import org.nl.utils.FileUtil;
|
||||
import org.nl.utils.SecurityUtils;
|
||||
import org.nl.wms.basedata.master.service.MaterialbaseService;
|
||||
@@ -178,7 +179,6 @@ public class ProductplanprocServiceImpl implements ProductplanprocService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void importExcel(String id) {
|
||||
WQLObject planProcTab = WQLObject.getWQLObject("pcs_if_productplanproc");
|
||||
WQLObject planTab = WQLObject.getWQLObject("pcs_if_productplan");
|
||||
WQLObject materTab = WQLObject.getWQLObject("md_me_materialbase");
|
||||
JSONObject json = WQL.getWO("QPCS_IF_PRODUCTPLANPROC02").addParam("flag", "1").addParam("id", id).process().uniqueResult(0);
|
||||
//根据路径获取表格里的记录
|
||||
@@ -196,6 +196,7 @@ public class ProductplanprocServiceImpl implements ProductplanprocService {
|
||||
String product_type_name = String.valueOf(map.get(5));
|
||||
Long product_weight = Long.valueOf((String) map.get(6));
|
||||
String plan_finish_date = String.valueOf(map.get(7));
|
||||
String remark = String.valueOf(map.get(8));
|
||||
//校验数据准确性
|
||||
JSONObject jsonTab = WQL.getWO("QPCS_IF_PRODUCTPLANPROC02").addParam("flag", "2").addParam("code", plan_org_code).process().uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonTab)) {
|
||||
@@ -234,42 +235,21 @@ public class ProductplanprocServiceImpl implements ProductplanprocService {
|
||||
dto.setUpdate_optid(SecurityUtils.getCurrentUserId());
|
||||
dto.setUpdate_optname(SecurityUtils.getNickName());
|
||||
dto.setUpdate_time(DateUtil.now());
|
||||
//月生产计划接口表数据
|
||||
JSONObject jsonPlan = new JSONObject();
|
||||
jsonPlan.put("plan_id", dto.getPlan_id());
|
||||
jsonPlan.put("plan_code", dto.getPlan_code());
|
||||
jsonPlan.put("plan_month", dto.getPlan_month());
|
||||
jsonPlan.put("plan_org_code", dto.getPlan_org_code());
|
||||
jsonPlan.put("plan_org_name", dto.getPlan_org_name());
|
||||
jsonPlan.put("material_id", dto.getMaterial_id());
|
||||
jsonPlan.put("material_code", dto.getMaterial_code());
|
||||
jsonPlan.put("material_name", dto.getMaterial_name());
|
||||
jsonPlan.put("material_spec", dto.getMaterial_spec());
|
||||
jsonPlan.put("product_type_name", dto.getProduct_type_name());
|
||||
jsonPlan.put("weight_unit_id", dto.getWeight_unit_id());
|
||||
jsonPlan.put("weight_unit_name", dto.getWeight_unit_name());
|
||||
jsonPlan.put("product_weight", dto.getProduct_weight());
|
||||
jsonPlan.put("plan_finish_date", dto.getPlan_finish_date());
|
||||
jsonPlan.put("input_optid", dto.getInput_optid());
|
||||
jsonPlan.put("input_optname", dto.getInput_optname());
|
||||
jsonPlan.put("input_time", dto.getInput_time());
|
||||
dto.setRemark(remark);
|
||||
dto.setTask_code(CodeUtil.getNewCode("PCS_TASK_CODE"));
|
||||
//判断表里有没有此条记录
|
||||
JSONObject jsonObject = planProcTab.query("plan_org_code = '" + plan_org_code + "' and plan_month = '" + plan_month + "' and material_code ='" + material_code + "'").uniqueResult(0);
|
||||
if (ObjectUtil.isEmpty(jsonObject)) {
|
||||
//如果是空的就插入两张表
|
||||
planProcTab.insert(JSONObject.parseObject(JSON.toJSONString(dto)));
|
||||
planTab.insert(jsonPlan);
|
||||
} else {
|
||||
if (!StrUtil.equals(jsonObject.getString("is_proc"), IsProcEnum.GENERATE.getCode())) {
|
||||
//非生成状态 返回错误信息
|
||||
throw new BadRequestException("此月度计划已存在并不可在修改");
|
||||
} else {
|
||||
//如果是生成状态则将当前记录删除,在重新插入
|
||||
JSONObject deletePlan = planTab.query("plan_id = '" + jsonObject.getString("plan_id") + "'").uniqueResult(0);
|
||||
planProcTab.delete(jsonObject);
|
||||
planTab.delete(deletePlan);
|
||||
planProcTab.insert(JSONObject.parseObject(JSON.toJSONString(dto)));
|
||||
planTab.insert(jsonPlan);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,9 +39,6 @@ public class DeviceooestatServiceImpl implements DeviceooestatService {
|
||||
String dept_code = MapUtil.getStr(whereJson, "dept_code");
|
||||
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "1");
|
||||
map.put("begin_time", begin_time);
|
||||
map.put("end_time", end_time);
|
||||
if (ObjectUtil.isNotEmpty(device_code)) map.put("device_code","%"+device_code+"%");
|
||||
if (ObjectUtil.isNotEmpty(dept_code)) map.put("dept_code","%"+dept_code+"%");
|
||||
//处理物料当前节点的所有子节点
|
||||
@@ -53,7 +50,16 @@ public class DeviceooestatServiceImpl implements DeviceooestatService {
|
||||
String classIds = classstandardService.getAllChildIdStr(class_idStr);
|
||||
map.put("classIds", classIds);
|
||||
}
|
||||
JSONObject json = WQL.getWO("EM_DEVICEOOESTAT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "run.create_time DESC");
|
||||
|
||||
if (ObjectUtil.isEmpty(begin_time)) {
|
||||
map.put("flag", "1");
|
||||
} else {
|
||||
map.put("flag", "2");
|
||||
map.put("begin_time",begin_time);
|
||||
map.put("end_time",end_time);
|
||||
}
|
||||
JSONObject json = WQL.getWO("EM_DEVICEOOESTAT001").addParamMap(map).pageQuery(WqlUtil.getHttpContext(page), "file.device_code ASC");
|
||||
|
||||
return json;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,5 +86,57 @@
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
IF 输入.flag = "2"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
SUM(run.run_times) AS run_times,
|
||||
SUM(run.prepare_times) AS prepare_times,
|
||||
SUM(run.error_times) AS error_times,
|
||||
SUM(run.adjust_times) AS adjust_times,
|
||||
SUM(run.product_qty) AS product_qty,
|
||||
SUM(run.nok_qty) AS nok_qty,
|
||||
SUM(file.theory_beat) AS theory_beat,
|
||||
SUM(run.oee_value) AS oee_value,
|
||||
class.class_name,
|
||||
file.device_code,
|
||||
file.device_name,
|
||||
file.devicerecord_id,
|
||||
dept.name AS dept_name
|
||||
FROM
|
||||
EM_BI_DeviceRunRecord run
|
||||
LEFT JOIN EM_BI_EquipmentFile file ON file.devicerecord_id = run.devicerecord_id
|
||||
LEFT JOIN md_pb_classstandard class ON file.material_type_id = class.class_id
|
||||
LEFT JOIN sys_dept dept ON file.use_deptid = dept.dept_id
|
||||
WHERE
|
||||
file.is_delete = '0'
|
||||
|
||||
OPTION 输入.device_code <> ""
|
||||
(file.device_code like 输入.device_code or
|
||||
file.device_name like 输入.device_code)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.dept_code <> ""
|
||||
(dept.name like 输入.dept_code or
|
||||
dept.code like 输入.dept_code)
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.classIds <> ""
|
||||
class.class_id in 输入.classIds
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.begin_time <> ""
|
||||
run.run_date >= 输入.begin_time
|
||||
ENDOPTION
|
||||
|
||||
OPTION 输入.end_time <> ""
|
||||
run.run_date <= 输入.end_time
|
||||
ENDOPTION
|
||||
|
||||
group by run.devicerecord_id
|
||||
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -345,13 +345,17 @@ export default {
|
||||
openReceive() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = _selectData[0]
|
||||
crudDevicerepairmst.getDtl(data).then(res => {
|
||||
this.openParam = {
|
||||
'form3': data,
|
||||
'itemData': res
|
||||
}
|
||||
this.receiveDialog = true
|
||||
})
|
||||
if (data.invstatus === '03' || data.invstatus === '04' || data.invstatus === '05') {
|
||||
crudDevicerepairmst.getDtl(data).then(res => {
|
||||
this.openParam = {
|
||||
'form3': data,
|
||||
'itemData': res
|
||||
}
|
||||
this.receiveDialog = true
|
||||
})
|
||||
} else {
|
||||
this.crud.notify('状态不正确', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
:disabled="crud.selections.length !== 1"
|
||||
@click="downloadWord"
|
||||
>
|
||||
下载Word
|
||||
生成鉴定申请表
|
||||
</el-button>
|
||||
</crudOperation>
|
||||
<!--表格渲染-->
|
||||
@@ -282,12 +282,19 @@ export default {
|
||||
}
|
||||
},
|
||||
downloadWord() {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = _selectData[0]
|
||||
download('/api/devicescrap/downloadWord', { 'devicerecord_id': data.devicerecord_id }).then(result => {
|
||||
const name = data.device_name + '报废档案'
|
||||
this.crud.toQuery()
|
||||
downloadFile(result, name, 'docx')
|
||||
const msg = '是否继续'
|
||||
this.$confirm(msg, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
const _selectData = this.$refs.table.selection
|
||||
const data = _selectData[0]
|
||||
download('/api/devicescrap/downloadWord', { 'devicerecord_id': data.devicerecord_id }).then(result => {
|
||||
const name = data.device_name + '报废档案'
|
||||
this.crud.toQuery()
|
||||
downloadFile(result, name, 'docx')
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,6 +91,7 @@ import pagination from '@crud/Pagination'
|
||||
import crudSectattr from '@/api/wms/basedata/st/sectattr'
|
||||
import { download } from '@/api/data'
|
||||
import { downloadFile } from '@/utils'
|
||||
import {getLodop} from "@/assets/js/lodop/LodopFuncs";
|
||||
|
||||
const defaultForm = { stockrecord_id: null, sparepart_only_id: null, material_id: null, pcsn: null, stor_id: null, stor_name: null, struct_id: null, struct_code: null, struct_name: null, ivt_qty: null, qty_unit_id: null, qty_unit_name: null, instorage_time: null }
|
||||
export default {
|
||||
@@ -155,6 +156,35 @@ export default {
|
||||
crud.downloadLoading = false
|
||||
})
|
||||
}
|
||||
},
|
||||
print() {
|
||||
let rows = this.$refs.table.selection
|
||||
if (rows.length === 0) {
|
||||
this.crud.notify('请至少勾选一条记录!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
return
|
||||
}
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
let row = rows[i]
|
||||
debugger
|
||||
if (row.sparepart_only_id === undefined) {
|
||||
return this.crud.notify('备件码为空!', CRUD.NOTIFICATION_TYPE.INFO)
|
||||
}
|
||||
const LODOP = getLodop()
|
||||
LODOP.SET_SHOW_MODE('HIDE_DISBUTTIN_SETUP', 1)// 隐藏那些无效按钮
|
||||
// 打印纸张大小设置https://www.it610.com/article/2094844.html
|
||||
LODOP.PRINT_INIT('')
|
||||
LODOP.SET_PRINT_PAGESIZE(1, '80mm', '60mm', '')
|
||||
LODOP.ADD_PRINT_RECT('1mm', '3mm', '74mm', '54mm', 0, 1)
|
||||
LODOP.SET_PRINT_STYLE('FontSize', 9)
|
||||
LODOP.SET_PRINT_STYLE('Bold', 1)
|
||||
LODOP.ADD_PRINT_BARCODE('10mm', '15mm', '60mm', '20mm', '128A', row.sparepart_only_id)
|
||||
LODOP.ADD_PRINT_TEXT('35mm', '15mm', '80mm', '15mm', '备件名称:' + row.material_name + '')
|
||||
LODOP.ADD_PRINT_TEXT('45mm', '15mm', '80mm', '15mm', '型号:' + row.material_spec + '')
|
||||
LODOP.PRINT()// 打印
|
||||
}
|
||||
|
||||
this.crud.notify('打印成功', CRUD.NOTIFICATION_TYPE.SUCCESS)
|
||||
this.crud.toQuery()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
label-suffix=":"
|
||||
>
|
||||
<el-form-item label="统计日期">
|
||||
<date-range-picker v-model="query.createTime" class="date-item" />
|
||||
<date-range-picker v-model="query.createTime" class="date-item" value-format="yyyy-MM-dd"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="设备类别">
|
||||
<treeselect
|
||||
|
||||
Reference in New Issue
Block a user