diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/em/service/impl/DevicebomServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/em/service/impl/DevicebomServiceImpl.java index 9b38710f..31a8cc2b 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/em/service/impl/DevicebomServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/em/service/impl/DevicebomServiceImpl.java @@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import lombok.RequiredArgsConstructor; import org.nl.exception.BadRequestException; +import org.nl.modules.system.util.CodeUtil; import org.nl.wms.basedata.em.service.DevicebomService; import org.nl.wms.basedata.em.service.dto.DevicebomDto; import org.nl.wms.basedata.master.service.ClassstandardService; @@ -106,14 +107,10 @@ public class DevicebomServiceImpl implements DevicebomService { String nickName = SecurityUtils.getNickName(); String now = DateUtil.now(); - String device_bom_code = whereJson.getString("device_bom_code"); - JSONObject jsonObject = bomMstTab.query("device_bom_code = '" + device_bom_code + "' and is_delete = '0'").uniqueResult(0); - if (ObjectUtil.isNotEmpty(jsonObject)) throw new BadRequestException("此编码已存在"); - // 插入主表 JSONObject jsonMst = new JSONObject(); jsonMst.put("device_bom_id", IdUtil.getSnowflake(1,1).nextId()); - jsonMst.put("device_bom_code",device_bom_code); + jsonMst.put("device_bom_code", CodeUtil.getNewCode("DEVICE_BOM_CODE")); jsonMst.put("material_name",whereJson.getString("material_name")); jsonMst.put("material_type_id",whereJson.get("material_type_id")); jsonMst.put("detail_count",tableData.size()); @@ -152,7 +149,6 @@ public class DevicebomServiceImpl implements DevicebomService { // 修改主表 JSONObject jsonMst = bomMstTab.query("device_bom_id ='" + device_bom_id + "'").uniqueResult(0); - jsonMst.put("device_bom_code",whereJson.getString("device_bom_code")); jsonMst.put("material_name",whereJson.getString("material_name")); jsonMst.put("material_type_id",whereJson.get("material_type_id")); jsonMst.put("detail_count",tableData.size()); @@ -177,9 +173,6 @@ public class DevicebomServiceImpl implements DevicebomService { bomDtlTab.insert(jsonDtl); } - String device_bom_code = whereJson.getString("device_bom_code"); - JSONArray jsonObject = bomMstTab.query("device_bom_code = '" + device_bom_code + "' and is_delete = '0'").getResultJSONArray(0); - if (jsonObject.size() > 1) throw new BadRequestException("此编码已存在"); } @Override diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/em/service/impl/DevicefaultclassServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/em/service/impl/DevicefaultclassServiceImpl.java index 1c654be3..278273e9 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/em/service/impl/DevicefaultclassServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/em/service/impl/DevicefaultclassServiceImpl.java @@ -7,6 +7,7 @@ import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSON; import lombok.RequiredArgsConstructor; import org.nl.exception.BadRequestException; +import org.nl.modules.system.util.CodeUtil; import org.nl.wms.basedata.em.service.DevicefaultclassService; import org.nl.wms.basedata.em.service.dto.DevicefaultclassDto; import org.nl.wms.basedata.master.service.ClassstandardService; @@ -101,13 +102,9 @@ public class DevicefaultclassServiceImpl implements DevicefaultclassService { WQLObject wo = WQLObject.getWQLObject("em_bi_devicefaultclass"); - String device_faultclass_code = whereJson.getString("device_faultclass_code"); - JSONObject jsonObject = wo.query("device_faultclass_code = '" + device_faultclass_code + "' and is_delete = '0'").uniqueResult(0); - if (ObjectUtil.isNotEmpty(jsonObject)) throw new BadRequestException("此编码已存在"); - JSONObject json = new JSONObject(); json.put("device_faultclass_id",IdUtil.getSnowflake(1,1).nextId()); - json.put("device_faultclass_code", whereJson.getString("device_faultclass_code")); + json.put("device_faultclass_code", CodeUtil.getNewCode("DEVICE_FACLASS_CODE")); json.put("device_faultclass_name", whereJson.getString("device_faultclass_name")); json.put("material_type_id", whereJson.getString("material_type_id")); json.put("solutions", whereJson.getString("solutions")); @@ -126,7 +123,6 @@ public class DevicefaultclassServiceImpl implements DevicefaultclassService { WQLObject wo = WQLObject.getWQLObject("em_bi_devicefaultclass"); JSONObject json = wo.query("device_faultclass_id = '" + whereJson.getString("device_faultclass_id") + "'").uniqueResult(0); - json.put("device_faultclass_code", whereJson.getString("device_faultclass_code")); json.put("device_faultclass_name", whereJson.getString("device_faultclass_name")); json.put("material_type_id", whereJson.getString("material_type_id")); json.put("solutions", whereJson.getString("solutions")); @@ -136,10 +132,6 @@ public class DevicefaultclassServiceImpl implements DevicefaultclassService { json.put("update_time", DateUtil.now()); wo.update(json); - String device_faultclass_code = whereJson.getString("device_faultclass_code"); - JSONArray jsonObject = wo.query("device_faultclass_code = '" + device_faultclass_code + "' and is_delete = '0'").getResultJSONArray(0); - if (jsonObject.size() > 1) throw new BadRequestException("此编码已存在"); - } @Override diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/em/service/impl/DevicemaintenanceitemsServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/em/service/impl/DevicemaintenanceitemsServiceImpl.java index 8c45cd9e..d98873a6 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/em/service/impl/DevicemaintenanceitemsServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/em/service/impl/DevicemaintenanceitemsServiceImpl.java @@ -6,6 +6,7 @@ import cn.hutool.core.map.MapUtil; import com.alibaba.fastjson.JSON; import lombok.RequiredArgsConstructor; import org.nl.exception.BadRequestException; +import org.nl.modules.system.util.CodeUtil; import org.nl.wms.basedata.em.service.DevicemaintenanceitemsService; import org.nl.wms.basedata.em.service.dto.DevicemaintenanceitemsDto; import org.nl.wql.WQL; @@ -94,7 +95,7 @@ public class DevicemaintenanceitemsServiceImpl implements Devicemaintenanceitems JSONObject json = new JSONObject(); json.put("maint_item_id", IdUtil.getSnowflake(1,1).nextId()); - json.put("maint_item_code", whereJson.getString("maint_item_code")); + json.put("maint_item_code", CodeUtil.getNewCode("MAINT_ITEM_CODE")); json.put("maint_item_name", whereJson.getString("maint_item_name")); json.put("item_level", whereJson.getString("item_level")); json.put("contents", whereJson.getString("contents")); @@ -119,7 +120,6 @@ public class DevicemaintenanceitemsServiceImpl implements Devicemaintenanceitems WQLObject wo = WQLObject.getWQLObject("em_bi_devicemaintenanceitems"); JSONObject json = wo.query("maint_item_id = '" + whereJson.getString("maint_item_id") + "'").uniqueResult(0); - json.put("maint_item_code", whereJson.getString("maint_item_code")); json.put("maint_item_name", whereJson.getString("maint_item_name")); json.put("item_level", whereJson.getString("item_level")); json.put("contents", whereJson.getString("contents")); diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/em/service/impl/DevicerepairitemsServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/em/service/impl/DevicerepairitemsServiceImpl.java index 3aeeb320..61ae4063 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/em/service/impl/DevicerepairitemsServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/basedata/em/service/impl/DevicerepairitemsServiceImpl.java @@ -6,6 +6,7 @@ import cn.hutool.core.map.MapUtil; import com.alibaba.fastjson.JSON; import lombok.RequiredArgsConstructor; import org.nl.exception.BadRequestException; +import org.nl.modules.system.util.CodeUtil; import org.nl.wms.basedata.em.service.DevicerepairitemsService; import org.nl.wms.basedata.em.service.dto.DevicerepairitemsDto; import org.nl.wql.WQL; @@ -90,7 +91,7 @@ public class DevicerepairitemsServiceImpl implements DevicerepairitemsService { JSONObject json = new JSONObject(); json.put("repair_item_id", IdUtil.getSnowflake(1,1).nextId()); - json.put("repair_item_code", whereJson.getString("repair_item_code")); + json.put("repair_item_code", CodeUtil.getNewCode("REPAIR_ITEM_CODE")); json.put("repair_item_name", whereJson.getString("repair_item_name")); json.put("requirement", whereJson.getString("requirement")); json.put("remark", whereJson.getString("remark")); @@ -115,7 +116,6 @@ public class DevicerepairitemsServiceImpl implements DevicerepairitemsService { WQLObject wo = WQLObject.getWQLObject("em_bi_devicerepairitems"); JSONObject json = wo.query("repair_item_id = '" + whereJson.getString("repair_item_id") + "'").uniqueResult(0); - json.put("repair_item_code", whereJson.getString("repair_item_code")); json.put("repair_item_name", whereJson.getString("repair_item_name")); json.put("requirement", whereJson.getString("requirement")); json.put("remark", whereJson.getString("remark")); diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ql/service/impl/PhysicalMstServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ql/service/impl/PhysicalMstServiceImpl.java index 01d8b271..92351774 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ql/service/impl/PhysicalMstServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ql/service/impl/PhysicalMstServiceImpl.java @@ -436,7 +436,7 @@ public class PhysicalMstServiceImpl implements PhysicalMstService { JSONObject JsonValue = phyDtlTab.query("inspection_item_id = '" + inspection_item_id + "' and inspection_id = '" + inspection_id + "'").uniqueResult(0); if (ObjectUtil.isNotEmpty(JsonValue)) num = num + 1; } - if (itemArr.size() != num) throw new BadRequestException("所有项点必须有值"); +// if (itemArr.size() != num) throw new BadRequestException("所有项点必须有值"); /* * 理化报告是否有效: 有效更新一级质检单以及一系列操作, diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ql/service/impl/WorkproceduremstServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ql/service/impl/WorkproceduremstServiceImpl.java index 35aa870b..2b06c11d 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/ql/service/impl/WorkproceduremstServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/ql/service/impl/WorkproceduremstServiceImpl.java @@ -16,10 +16,12 @@ import org.nl.exception.BadRequestException; import org.nl.modules.security.service.dto.JwtUserDto; import org.nl.modules.system.util.CodeUtil; import org.nl.utils.SecurityUtils; +import org.nl.utils.SpringContextHolder; import org.nl.wms.basedata.master.constant.MaterOptTypeEnum; import org.nl.wms.basedata.master.service.MaterialbaseService; import org.nl.wms.ql.Enum.QlBillStatusEnum; import org.nl.wms.ql.service.InspectionsheetmstService; +import org.nl.wms.ql.service.PhysicalMstService; import org.nl.wms.ql.service.WorkproceduremstService; import org.nl.wms.ql.service.dto.WorkproceduremstDto; import org.nl.wql.WQL; @@ -338,8 +340,12 @@ public class WorkproceduremstServiceImpl implements WorkproceduremstService { public void confirm(JSONObject whereJson) { String workprocedure_uuid = whereJson.getString("workprocedure_uuid"); + WQLObject mstTab = WQLObject.getWQLObject("QL_TEST_WorkProcedureMst"); // 工序质检单主表 WQLObject sheetMstTab = WQLObject.getWQLObject("QL_TEST_InspectionSheetMst"); // 质检单主表 WQLObject sheetDtlTab = WQLObject.getWQLObject("QL_TEST_InspectionSheetDtl"); // 质检单明细表 + WQLObject phyMstTab = WQLObject.getWQLObject("QL_TEST_PhysicalMst"); // 理化报告主表 + WQLObject workTaskTab = WQLObject.getWQLObject("PDM_BI_WorkTask"); // 工令工序任务表 + Long currentUserId = SecurityUtils.getCurrentUserId(); String nickName = SecurityUtils.getNickName(); String now = DateUtil.now(); @@ -358,9 +364,8 @@ public class WorkproceduremstServiceImpl implements WorkproceduremstService { JSONObject JsonValue = WQLObject.getWQLObject("QL_TEST_WorkProcedureDtl").query("inspection_item_id = '" + inspection_item_id + "' and inspection_id = '" + whereJson.getString("inspection_id") + "'").uniqueResult(0); if (ObjectUtil.isNotEmpty(JsonValue)) num = num + 1; } - if (itemArr.size() != num) throw new BadRequestException("所有项点必须有值"); +// if (itemArr.size() != num) throw new BadRequestException("所有项点必须有值"); - WQLObject mstTab = WQLObject.getWQLObject("QL_TEST_WorkProcedureMst"); JSONObject jsonMst = mstTab.query("inspection_id = '" + whereJson.getString("inspection_id") + "'").uniqueResult(0); jsonMst.put("bill_status",QlBillStatusEnum.FINISH.getCode()); jsonMst.put("confirm_optid",currentUserId); @@ -385,6 +390,40 @@ public class WorkproceduremstServiceImpl implements WorkproceduremstService { jsonSheetMst.put("confirm_optname", nickName); jsonSheetMst.put("confirm_time", now); sheetMstTab.update(jsonSheetMst); + /* + * 如果此工令工序任务下的所有工序质检单都为不合格: + * 判断条件:此工令工序任务必须为完成状态。 + * 1.如果存在理化报告则确认理化报告为不合格, + * 2.确认一级质检单为不合格 + */ + // 1. 查询是否存在此物料、此批次、此工序、并且已完成的工序任务 + String material_id = jsonMst.getString("material_id"); + String pcsn = jsonMst.getString("pcsn"); + JSONObject jsonWorkTask = workTaskTab.query("material_id = '" + material_id + "' and pcsn = '" + pcsn + "' and workprocedure_id = '" + workprocedure_uuid + "' and status = '99'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(jsonWorkTask)) { + // 2.不为空则查出此工序任务下的所有 工序质检单,判断所有的质检单是否都为不合格 + JSONArray mstArr = mstTab.query("material_id = '" + material_id + "' and pcsn = '" + pcsn + "' and workprocedure_uuid = '" + workprocedure_uuid + "'").getResultJSONArray(0); + int flag = 0; + for (int i = 0; i < mstArr.size(); i++) { + JSONObject json = mstArr.getJSONObject(i); + if (StrUtil.equals(json.getString("result"), "02")) { + flag += 1; + } + } + if (flag == mstArr.size()) { + // 3.都不合格则判断此物料、批次是否存在理化报告;存在则确认理化报告 + JSONObject jsonPhyMst = phyMstTab.query("material_id = '" + material_id + "' and pcsn = '" + pcsn + "' and is_delete = '0'").uniqueResult(0); + if (ObjectUtil.isNotEmpty(jsonPhyMst)) { + // 4.不为空、确认理化报告 + jsonPhyMst.put("result", "02"); + jsonPhyMst.put("grade", jsonMst.getString("grade")); + jsonPhyMst.put("bill_status", QlBillStatusEnum.TEST_LABORATORY.getCode()); + phyMstTab.update(jsonPhyMst); + SpringContextHolder.getBean(PhysicalMstService.class).confirm(jsonPhyMst); + } + } + } + } @Override diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/rest/RawUatWcQueryController.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/rest/RawUatWcQueryController.java index 0ec433fb..234ee20e 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/rest/RawUatWcQueryController.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/rest/RawUatWcQueryController.java @@ -11,6 +11,8 @@ import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.Map; /** @@ -38,4 +40,10 @@ public class RawUatWcQueryController { public ResponseEntity getHeader(@PathVariable String material_type_id) { return new ResponseEntity<>(rawUatWcQueryService.getHeader(material_type_id), HttpStatus.OK); } + + @ApiOperation("导出数据") + @GetMapping(value = "/download") + public void download(HttpServletResponse response, @RequestParam Map whereJson) throws IOException { + rawUatWcQueryService.download(whereJson, response); + } } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/RawUatWcQueryService.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/RawUatWcQueryService.java index ac06e376..fc2000cf 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/RawUatWcQueryService.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/RawUatWcQueryService.java @@ -3,6 +3,8 @@ package org.nl.wms.statistics.service; import com.alibaba.fastjson.JSONArray; import org.springframework.data.domain.Pageable; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; import java.util.Map; /** @@ -24,4 +26,6 @@ public interface RawUatWcQueryService { * 获取表头 */ JSONArray getHeader( String material_type_id); + + void download(Map whereJson, HttpServletResponse response) throws IOException; } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/RawUatWcQueryServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/RawUatWcQueryServiceImpl.java index e9d36aef..fed8bf11 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/RawUatWcQueryServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/statistics/service/impl/RawUatWcQueryServiceImpl.java @@ -8,6 +8,7 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import org.nl.utils.FileUtil; import org.nl.wms.basedata.master.service.ClassstandardService; import org.nl.wms.statistics.service.PhysicalQueryService; import org.nl.wms.statistics.service.RawUatWcQueryService; @@ -17,8 +18,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; -import java.util.HashMap; -import java.util.Map; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; @Service @RequiredArgsConstructor @@ -167,4 +169,110 @@ public class RawUatWcQueryServiceImpl implements RawUatWcQueryService { jonsResuftArr.add(jsonResuft9); return jonsResuftArr; } + + @Override + public void download(Map whereJson, HttpServletResponse response) throws IOException { + String material_code = MapUtil.getStr(whereJson, "material_code"); + String pcsn = MapUtil.getStr(whereJson, "pcsn"); + String material_type_id = MapUtil.getStr(whereJson, "material_type_id"); + HashMap map = new HashMap<>(); + map.put("flag", "1"); + map.put("begin_time", MapUtil.getStr(whereJson,"begin_time")); + map.put("end_time", MapUtil.getStr(whereJson,"end_time")); + map.put("receive_code", MapUtil.getStr(whereJson,"receive_code")); + if (ObjectUtil.isNotEmpty(pcsn)) map.put("pcsn", "%"+pcsn+"%"); + map.put("bill_status", MapUtil.getStr(whereJson,"bill_status")); + if (!ObjectUtil.isEmpty(material_code)) { + //处理转义字符 + if (material_code.contains("\\"))material_code=material_code.replace("\\","\\\\\\"); + map.put("material_code", "%" + material_code + "%"); + } + if (!StrUtil.isEmpty(material_type_id)) { + map.put("material_type_id", material_type_id); + String classIds = classstandardService.getChildIdStr(material_type_id); + map.put("classIds", classIds); + } + JSONArray content = WQL.getWO("RaUatWc_query_01").addParamMap(map).process().getResultJSONArray(0); + JSONArray array = new JSONArray(); + for (int i = 0; i < content.size(); i++) { + JSONObject jsonObject = content.getJSONObject(i); + String pcsn1 = jsonObject.getString("pcsn"); + String material_id = jsonObject.getString("material_id"); + String result = jsonObject.getString("result"); + JSONObject jsonResuft = new JSONObject(); + jsonResuft.put("1", jsonObject.getString("material_code")); + jsonResuft.put("2", jsonObject.getString("material_name")); + jsonResuft.put("3", jsonObject.getString("pcsn")); + jsonResuft.put("4",NumberUtil.decimalFormat("#.000", jsonObject.getDoubleValue("receive_qty"))); + // 厂家 + + JSONObject jsonSuup = WQL.getWO("RaUatWc_query_01").addParam("flag", "6").addParam("pcsn", pcsn1).addParam("material_id", material_id).process().uniqueResult(0); + jsonResuft.put("5", jsonSuup.getString("supp_name")); + + jsonResuft.put("remark", jsonObject.getString("remark")); + jsonResuft.put("biz_date", jsonObject.getString("biz_date")); + if (StrUtil.equals(result, "01")) { + jsonResuft.put("result", "合格"); + } else if (StrUtil.equals(result, "02")) { + jsonResuft.put("result", "不合格"); + } else if (StrUtil.equals(result, "03")) { + jsonResuft.put("result", "紧急放行"); + } + // 根据物料批次查找厂家质保书对应的项点 + JSONArray jsonFaArr = WQL.getWO("RaUatWc_query_01").addParam("flag", "3").addParam("pcsn", pcsn1).addParam("material_id", material_id).process().getResultJSONArray(0); + for (int j = 0; j < jsonFaArr.size(); j++) { + JSONObject jsonItem = jsonFaArr.getJSONObject(j); + String inspection_item_id = jsonItem.getString("inspection_item_id"); + double value = jsonItem.getDoubleValue("value"); + if (value > 0 && value < 1){ + jsonResuft.put(inspection_item_id,"0"+NumberUtil.decimalFormat("#.00", value)); + } else if (value == 0){ + jsonResuft.put(inspection_item_id,"0.00"); + } else { + jsonResuft.put(inspection_item_id,NumberUtil.decimalFormat("#.00", value)); + } + } + // 根据物料批次查找理化单对应的项点 + JSONArray jsonPhyArr = WQL.getWO("RaUatWc_query_01").addParam("flag", "4").addParam("pcsn", pcsn1).addParam("material_id", material_id).process().getResultJSONArray(0); + for (int k = 0; k < jsonPhyArr.size(); k++) { + JSONObject jsonItem = jsonPhyArr.getJSONObject(k); + String inspection_item_id = jsonItem.getString("inspection_item_id"); + double value = jsonItem.getDoubleValue("value"); + if (value > 0 && value < 1) { + jsonResuft.put(inspection_item_id,"0"+NumberUtil.decimalFormat("#.00", value)); + } else if (value == 0){ + jsonResuft.put(inspection_item_id,"0.00"); + } else { + jsonResuft.put(inspection_item_id,NumberUtil.decimalFormat("#.00", value)); + } + } + array.add(jsonResuft); + } + + List> list = new ArrayList<>(); + for (int i = 0; i < array.size(); i++) { + JSONObject json = array.getJSONObject(i); + Map map_dtl = new LinkedHashMap<>(); + map_dtl.put("物料编码",json.getString("1")); + map_dtl.put("物料名称",json.getString("2")); + map_dtl.put("批号",json.getString("3")); + map_dtl.put("重量",json.getString("4")); + map_dtl.put("厂家",json.getString("5")); + JSONArray jsonArr = WQL.getWO("RaUatWc_query_01").addParam("flag", "5").process().getResultJSONArray(0); + for (int j = 0; j < jsonArr.size(); j++) { + JSONObject jsonObject = jsonArr.getJSONObject(j); + map_dtl.put(jsonObject.getString("inspection_item_name"),""); + + String inspection_item_id = jsonObject.getString("inspection_item_id"); + if (ObjectUtil.isNotEmpty(json.getString(inspection_item_id))) { + map_dtl.put(jsonObject.getString("inspection_item_name"),json.getString(inspection_item_id)); + } + } + map_dtl.put("工艺实验处理意见",json.getString("remark")); + map_dtl.put("工艺报告日期",json.getString("biz_date")); + map_dtl.put("总结论",json.getString("result")); + list.add(map_dtl); + } + FileUtil.downloadExcel(list, response); + } } diff --git a/mes/qd/src/views/wms/basedata/em/devicebom/AddDialog.vue b/mes/qd/src/views/wms/basedata/em/devicebom/AddDialog.vue index 3a319789..539a4a7f 100644 --- a/mes/qd/src/views/wms/basedata/em/devicebom/AddDialog.vue +++ b/mes/qd/src/views/wms/basedata/em/devicebom/AddDialog.vue @@ -34,8 +34,8 @@ - - + + @@ -182,9 +182,6 @@ export default { material_type_id: [ { required: true, message: '设备类别不能为空', trigger: 'blur' } ], - device_bom_code: [ - { required: true, message: '设备BOM编码不能为空', trigger: 'blur' } - ], material_name: [ { required: true, message: '设备BOM名称不能为空', trigger: 'blur' } ] diff --git a/mes/qd/src/views/wms/basedata/em/devicefaultclass/index.vue b/mes/qd/src/views/wms/basedata/em/devicefaultclass/index.vue index ffd9d2ef..faf33219 100644 --- a/mes/qd/src/views/wms/basedata/em/devicefaultclass/index.vue +++ b/mes/qd/src/views/wms/basedata/em/devicefaultclass/index.vue @@ -41,10 +41,9 @@ - + - @@ -72,6 +71,7 @@ + @@ -154,9 +154,6 @@ export default { permission: { }, rules: { - device_faultclass_code: [ - { required: true, message: '故障编码不能为空', trigger: 'blur' } - ], device_faultclass_name: [ { required: true, message: '故障名称不能为空', trigger: 'blur' } ], diff --git a/mes/qd/src/views/wms/basedata/em/devicemaintain/index.vue b/mes/qd/src/views/wms/basedata/em/devicemaintain/index.vue index 111b33fc..67641de9 100644 --- a/mes/qd/src/views/wms/basedata/em/devicemaintain/index.vue +++ b/mes/qd/src/views/wms/basedata/em/devicemaintain/index.vue @@ -58,8 +58,8 @@ - - + + @@ -83,7 +83,7 @@ - + @@ -128,7 +128,7 @@ - + @@ -184,9 +184,6 @@ export default { permission: { }, rules: { - maint_item_code: [ - { required: true, message: '保养项目编码不能为空', trigger: 'blur' } - ], maint_item_name: [ { required: true, message: '保养项目名称不能为空', trigger: 'blur' } ], diff --git a/mes/qd/src/views/wms/basedata/em/devicerepairitems/index.vue b/mes/qd/src/views/wms/basedata/em/devicerepairitems/index.vue index 1345d37b..0c64d6d3 100644 --- a/mes/qd/src/views/wms/basedata/em/devicerepairitems/index.vue +++ b/mes/qd/src/views/wms/basedata/em/devicerepairitems/index.vue @@ -39,8 +39,8 @@ - - + + @@ -129,9 +129,6 @@ export default { permission: { }, rules: { - repair_item_code: [ - { required: true, message: '设备维修项目编码不能为空', trigger: 'blur' } - ], repair_item_name: [ { required: true, message: '设备维修项目名称不能为空', trigger: 'blur' } ], diff --git a/mes/qd/src/views/wms/basedata/em/equipmentfile/AddDialog.vue b/mes/qd/src/views/wms/basedata/em/equipmentfile/AddDialog.vue index 2cfd9ab1..bb0f4bec 100644 --- a/mes/qd/src/views/wms/basedata/em/equipmentfile/AddDialog.vue +++ b/mes/qd/src/views/wms/basedata/em/equipmentfile/AddDialog.vue @@ -126,8 +126,8 @@ /> - - + + diff --git a/mes/qd/src/views/wms/basedata/em/equipmentfile/ViewDialog.vue b/mes/qd/src/views/wms/basedata/em/equipmentfile/ViewDialog.vue index 582abbcd..01c6c113 100644 --- a/mes/qd/src/views/wms/basedata/em/equipmentfile/ViewDialog.vue +++ b/mes/qd/src/views/wms/basedata/em/equipmentfile/ViewDialog.vue @@ -111,8 +111,8 @@ /> - - + + diff --git a/mes/qd/src/views/wms/basedata/em/equipmentfile/index.vue b/mes/qd/src/views/wms/basedata/em/equipmentfile/index.vue index d634931d..bfdaae02 100644 --- a/mes/qd/src/views/wms/basedata/em/equipmentfile/index.vue +++ b/mes/qd/src/views/wms/basedata/em/equipmentfile/index.vue @@ -199,7 +199,6 @@ @@ -211,7 +210,7 @@ - + diff --git a/mes/qd/src/views/wms/pdm/produce/worktask/index.vue b/mes/qd/src/views/wms/pdm/produce/worktask/index.vue index 1a1caf4c..56f21d5a 100644 --- a/mes/qd/src/views/wms/pdm/produce/worktask/index.vue +++ b/mes/qd/src/views/wms/pdm/produce/worktask/index.vue @@ -99,7 +99,7 @@ end-placeholder="结束日期" :default-time="['00:00:00', '23:59:59']" @input="onInput()" - @change="crud.toQuery" + @change="mytoQuery" /> @@ -279,6 +279,7 @@ export default { printShow: false, currentRow: null, checkrows: [], + query_flag: true, XLList: [] } }, @@ -296,12 +297,26 @@ export default { this.XLList = res }) this.crud.query.createTime = [new Date().daysAgo(2), new Date()] - this.crud.toQuery() }, methods: { [CRUD.HOOK.beforeRefresh]() { + if(this.query_flag){ + this.crud.query.begin_time = (new Date().daysAgo(2)).toISOString() + this.crud.query.end_time = (new Date()).toISOString() + this.query_flag = false + } this.handleCurrentChange() }, + mytoQuery(array1){ + if(array1 === null){ + this.crud.query.begin_time = '' + this.crud.query.end_time = '' + }else{ + this.crud.query.begin_time = array1[0] + this.crud.query.end_time = array1[1] + } + this.crud.toQuery() + }, toView(index, row) { this.mstrow = row this.viewShow = true diff --git a/mes/qd/src/views/wms/pdm/produce/worktask/print2Dialog.vue b/mes/qd/src/views/wms/pdm/produce/worktask/print2Dialog.vue index c4fe9b56..a4308f58 100644 --- a/mes/qd/src/views/wms/pdm/produce/worktask/print2Dialog.vue +++ b/mes/qd/src/views/wms/pdm/produce/worktask/print2Dialog.vue @@ -156,8 +156,8 @@ export default { LODOP.ADD_PRINT_TEXT('43mm', '65mm', '80mm', '27mm', '桶号:' + item.bucketunique + '') LODOP.ADD_PRINT_TEXT('59mm', '6mm', '140mm', '27mm', '编码:' + item.material_code + '') - LODOP.ADD_PRINT_TEXT('85mm', '6mm', '140mm', '27mm', '牌号:' + item.old_mark + '') - LODOP.ADD_PRINT_TEXT('72mm', '6mm', '140mm', '27mm', '名称:' + item.material_name + '') + LODOP.ADD_PRINT_TEXT('72mm', '6mm', '140mm', '27mm', '牌号:' + item.old_mark + '') + LODOP.ADD_PRINT_TEXT('85mm', '6mm', '140mm', '27mm', '名称:' + item.material_name + '') LODOP.ADD_PRINT_TEXT('85mm', '110mm', '60mm', '27mm', '序号:' + item.order_no + '') // LODOP.PREVIEW()// 预览 LODOP.PRINT()// 打印 diff --git a/mes/qd/src/views/wms/ql/physicalMst/Dialog1.vue b/mes/qd/src/views/wms/ql/physicalMst/Dialog1.vue index 1dcfcc4f..979e2a56 100644 --- a/mes/qd/src/views/wms/ql/physicalMst/Dialog1.vue +++ b/mes/qd/src/views/wms/ql/physicalMst/Dialog1.vue @@ -475,12 +475,14 @@ export default { const data = this.form1.tableData var flag = 0 for (var row of data) { - if (!row.value) { - flag = flag + 1 + if (row.up_limit !== '') { + if (!row.value) { + flag = flag + 1 + } } } - // 如果检测值一项都没填则提示是否继续 - if (flag === data.length) { + // 如果检测值有一项没填则提示是否继续 (在上限下限有值的情况下) + if (flag > 0) { this.$confirm(msg, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', diff --git a/mes/qd/src/views/wms/ql/physicalMstConfirm/Dialog1.vue b/mes/qd/src/views/wms/ql/physicalMstConfirm/Dialog1.vue index 68feb569..d1847663 100644 --- a/mes/qd/src/views/wms/ql/physicalMstConfirm/Dialog1.vue +++ b/mes/qd/src/views/wms/ql/physicalMstConfirm/Dialog1.vue @@ -481,12 +481,14 @@ export default { const data = this.form1.tableData var flag = 0 for (var row of data) { - if (!row.value) { - flag = flag + 1 + if (row.up_limit !== '') { + if (!row.value) { + flag = flag + 1 + } } } - // 如果检测值一项都没填则提示是否继续 - if (flag === data.length) { + // 如果检测值有一项没填则提示是否继续 (在上限下限有值的情况下) + if (flag > 0) { this.$confirm(msg, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', diff --git a/mes/qd/src/views/wms/ql/workprocedureQl/ResultPutDialog.vue b/mes/qd/src/views/wms/ql/workprocedureQl/ResultPutDialog.vue index 3ddf95b0..970170de 100644 --- a/mes/qd/src/views/wms/ql/workprocedureQl/ResultPutDialog.vue +++ b/mes/qd/src/views/wms/ql/workprocedureQl/ResultPutDialog.vue @@ -270,6 +270,39 @@ export default { count() { }, sure() { + const msg = '是否继续!' + + const rows = this.form.tableData + var flag = 0 + for (var row of rows) { + if (row.up_limit !== '') { + if (!row.value) { + flag = flag + 1 + } + } + } + const data = this.form + if (flag > 0) { + this.$confirm(msg, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + crudWorkproceduremst.sure(data).then(res => { + this.$emit('update:dialogShow', false) + this.crud.toQuery() + this.crud.notify('录入成功', CRUD.NOTIFICATION_TYPE.SUCCESS) + }) + }) + } else { + crudWorkproceduremst.sure(data).then(res => { + this.$emit('update:dialogShow', false) + this.crud.toQuery() + this.crud.notify('录入成功', CRUD.NOTIFICATION_TYPE.SUCCESS) + }) + } + }, + sure2() { const rows = this.form.tableData var flag = 0 for (var row of rows) { diff --git a/mes/qd/src/views/wms/sb/repair/devicerepairpa/ExecuteDialog.vue b/mes/qd/src/views/wms/sb/repair/devicerepairpa/ExecuteDialog.vue index 99cb7d39..852df758 100644 --- a/mes/qd/src/views/wms/sb/repair/devicerepairpa/ExecuteDialog.vue +++ b/mes/qd/src/views/wms/sb/repair/devicerepairpa/ExecuteDialog.vue @@ -65,7 +65,7 @@ - + diff --git a/mes/qd/src/views/wms/statistics/hpcQuery/index.vue b/mes/qd/src/views/wms/statistics/hpcQuery/index.vue index 59f5b658..4c14f840 100644 --- a/mes/qd/src/views/wms/statistics/hpcQuery/index.vue +++ b/mes/qd/src/views/wms/statistics/hpcQuery/index.vue @@ -53,6 +53,7 @@ v-loading="crud.loading" :data="crud.data" size="mini" + height="420" style="width: 100%;" @selection-change="crud.selectionChangeHandler" > diff --git a/mes/qd/src/views/wms/statistics/ioStorQuery/index.vue b/mes/qd/src/views/wms/statistics/ioStorQuery/index.vue index f0facb65..d3eb6270 100644 --- a/mes/qd/src/views/wms/statistics/ioStorQuery/index.vue +++ b/mes/qd/src/views/wms/statistics/ioStorQuery/index.vue @@ -188,6 +188,7 @@ v-loading="crud.loading" size="mini" :data="crud.data" + height="420" style="width: 100%;" :highlight-current-row="true" @selection-change="crud.selectionChangeHandler" diff --git a/mes/qd/src/views/wms/statistics/ivtQuery/index.vue b/mes/qd/src/views/wms/statistics/ivtQuery/index.vue index 18352ebb..99ae1a3b 100644 --- a/mes/qd/src/views/wms/statistics/ivtQuery/index.vue +++ b/mes/qd/src/views/wms/statistics/ivtQuery/index.vue @@ -151,6 +151,7 @@ ref="table" v-loading="crud.loading" :data="crud.data" + height="420" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler" diff --git a/mes/qd/src/views/wms/statistics/ledgerQuery/index.vue b/mes/qd/src/views/wms/statistics/ledgerQuery/index.vue index 669443ce..af913cd4 100644 --- a/mes/qd/src/views/wms/statistics/ledgerQuery/index.vue +++ b/mes/qd/src/views/wms/statistics/ledgerQuery/index.vue @@ -57,6 +57,7 @@ ref="table" v-loading="crud.loading" :data="crud.data" + height="420" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler" diff --git a/mes/qd/src/views/wms/statistics/outStorQuery/index.vue b/mes/qd/src/views/wms/statistics/outStorQuery/index.vue index 6f872539..e7e8e4d3 100644 --- a/mes/qd/src/views/wms/statistics/outStorQuery/index.vue +++ b/mes/qd/src/views/wms/statistics/outStorQuery/index.vue @@ -101,6 +101,7 @@ ref="table" v-loading="crud.loading" size="mini" + height="420" :data="crud.data" style="width: 100%;" :highlight-current-row="true" diff --git a/mes/qd/src/views/wms/statistics/phySicalQuery/index.vue b/mes/qd/src/views/wms/statistics/phySicalQuery/index.vue index 5c483626..33fda071 100644 --- a/mes/qd/src/views/wms/statistics/phySicalQuery/index.vue +++ b/mes/qd/src/views/wms/statistics/phySicalQuery/index.vue @@ -119,6 +119,7 @@ ref="table" v-loading="crud.loading" :data="crud.data" + height="420" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler" diff --git a/mes/qd/src/views/wms/statistics/powderOrderQuery/index.vue b/mes/qd/src/views/wms/statistics/powderOrderQuery/index.vue index a2f8d467..42237354 100644 --- a/mes/qd/src/views/wms/statistics/powderOrderQuery/index.vue +++ b/mes/qd/src/views/wms/statistics/powderOrderQuery/index.vue @@ -68,6 +68,7 @@ diff --git a/mes/qd/src/views/wms/statistics/productionDayQuery/index.vue b/mes/qd/src/views/wms/statistics/productionDayQuery/index.vue index 6eae1287..0f4d701e 100644 --- a/mes/qd/src/views/wms/statistics/productionDayQuery/index.vue +++ b/mes/qd/src/views/wms/statistics/productionDayQuery/index.vue @@ -63,6 +63,7 @@ v-loading="crud.loading" :data="crud.data" size="mini" + height="420" style="width: 100%;" @selection-change="crud.selectionChangeHandler" > diff --git a/mes/qd/src/views/wms/statistics/rawUatWcQuery/index.vue b/mes/qd/src/views/wms/statistics/rawUatWcQuery/index.vue index 86d06e2d..6a898090 100644 --- a/mes/qd/src/views/wms/statistics/rawUatWcQuery/index.vue +++ b/mes/qd/src/views/wms/statistics/rawUatWcQuery/index.vue @@ -74,13 +74,25 @@ - + + + 导出Excel + + @@ -104,6 +116,8 @@ import udOperation from '@crud/UD.operation' import pagination from '@crud/Pagination' import DateRangePicker from '@/components/DateRangePicker' import crudInspectionsheetmst from '@/api/wms/ql/inspectionsheetmst' +import {download} from "@/api/data"; +import {downloadFile} from "@/utils"; export default { name: 'RawUatCbQuery', @@ -159,6 +173,17 @@ export default { }, hand(value) { this.crud.toQuery() + }, + downdtl() { + if (this.currentRow !== null) { + crud.downloadLoading = true + download('/api/rawUatWcQuery/download', this.crud.query).then(result => { + downloadFile(result, '原材料碳化钨', 'xlsx') + crud.downloadLoading = false + }).catch(() => { + crud.downloadLoading = false + }) + } } } } diff --git a/mes/qd/src/views/wms/statistics/sendReceiveQuery/index.vue b/mes/qd/src/views/wms/statistics/sendReceiveQuery/index.vue index d268d2a7..211c1857 100644 --- a/mes/qd/src/views/wms/statistics/sendReceiveQuery/index.vue +++ b/mes/qd/src/views/wms/statistics/sendReceiveQuery/index.vue @@ -81,7 +81,7 @@ - diff --git a/mes/qd/src/views/wms/statistics/stifleQuery/index.vue b/mes/qd/src/views/wms/statistics/stifleQuery/index.vue index 2dbce11a..6b39caf8 100644 --- a/mes/qd/src/views/wms/statistics/stifleQuery/index.vue +++ b/mes/qd/src/views/wms/statistics/stifleQuery/index.vue @@ -52,6 +52,7 @@ ref="table" v-loading="crud.loading" :data="crud.data" + height="420" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler"