diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/rest/ReportController.java b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/rest/ReportController.java new file mode 100644 index 0000000..b4f5e23 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/rest/ReportController.java @@ -0,0 +1,45 @@ +package org.nl.wms.cockpit.rest; + +import cn.dev33.satoken.annotation.SaIgnore; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import org.nl.modules.logging.annotation.Log; +import org.nl.wms.cockpit.service.ReportService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + +/** + * @Author: lyd + * @Description: 报表管理 + * @Date: 2024/5/16 + */ +@RestController +@Api(tags = "报表管理") +@RequestMapping("/api/report") +public class ReportController { + + @Autowired + private ReportService reportService; + + @GetMapping("/queryXN") + @Log("查询出窑虚拟库、货架、木托虚拟库库存") + @ApiOperation("查询出窑虚拟库、货架、木托虚拟库库存") + //@SaCheckPermission("point:list") + public ResponseEntity queryXN(@RequestParam Map whereJson, Pageable page) { + return new ResponseEntity<>(reportService.queryXN(whereJson, page), HttpStatus.OK); + } + @GetMapping("/mudMaterialReport") + @Log("泥料退料报表") + @ApiOperation("泥料退料报表") + //@SaCheckPermission("point:list") + public ResponseEntity mudMaterialReport(@RequestParam Map whereJson, Pageable page) { + return new ResponseEntity<>(reportService.mudMaterialReport(whereJson, page), HttpStatus.OK); + } + +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/ReportService.java b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/ReportService.java new file mode 100644 index 0000000..fc6c240 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/ReportService.java @@ -0,0 +1,17 @@ +package org.nl.wms.cockpit.service; + +import com.alibaba.fastjson.JSONObject; +import org.springframework.data.domain.Pageable; + +import java.util.Map; + +/** + * @Author: lyd + * @Description: + * @Date: 2024/5/16 + */ +public interface ReportService { + Map queryXN(Map whereJson, Pageable page); + + Map mudMaterialReport(Map whereJson, Pageable page); +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/ReportServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/ReportServiceImpl.java new file mode 100644 index 0000000..eb38d32 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/service/impl/ReportServiceImpl.java @@ -0,0 +1,29 @@ +package org.nl.wms.cockpit.service.impl; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import org.nl.modules.wql.WQL; +import org.nl.modules.wql.util.WqlUtil; +import org.nl.wms.cockpit.service.ReportService; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; + +import java.util.Map; + +/** + * @Author: lyd + * @Description: + * @Date: 2024/5/16 + */ +@Service +public class ReportServiceImpl implements ReportService { + @Override + public Map queryXN(Map whereJson, Pageable page) { + return WQL.getWO("REPORT").addParam("flag", "1").addParam("point_code", whereJson.get("point_code")).pageQuery(WqlUtil.getHttpContext(page), "sd.create_time desc"); + } + + @Override + public Map mudMaterialReport(Map whereJson, Pageable page) { + return WQL.getWO("REPORT").addParam("flag", "2").pageQuery(WqlUtil.getHttpContext(page), "sd.create_time desc, m.order_code"); + } +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/REPORT.wql b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/REPORT.wql new file mode 100644 index 0000000..0330264 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/cockpit/wql/REPORT.wql @@ -0,0 +1,76 @@ +[交易说明] + 交易名: 车间情况 + 所属模块: + 功能简述: + 版权所有: + 表引用: + 版本经历: + +[数据库] + --指定数据库,为空采用默认值,默认为db.properties中列出的第一个库 + +[IO定义] + ################################################# + ## 表字段对应输入参数 + ################################################# + 输入.flag TYPEAS s_string + 输入.point_code TYPEAS s_string + + +[临时表] + --这边列出来的临时表就会在运行期动态创建 + +[临时变量] + --所有中间过程变量均可在此处定义 + +[业务过程] + + ########################################## + # 1、输入输出检查 # + ########################################## + + + ########################################## + # 2、主过程前处理 # + ########################################## + + + ########################################## + # 3、业务主过程 # + ########################################## + + + IF 输入.flag = "1" + PAGEQUERY + SELECT + sd.*, + p.point_name, + m.material_code, + m.order_code + FROM + `st_ivt_vehicle_detail` sd + LEFT JOIN sch_base_point p ON p.point_code = sd.point_code + LEFT JOIN md_me_materialbase m ON m.material_id = sd.material_id + WHERE p.region_code = 'XN' AND sd.is_delete = '0' + OPTION 输入.point_code <> "" + sd.point_code = 输入.point_code + ENDOPTION + ENDSELECT + ENDPAGEQUERY + ENDIF + + IF 输入.flag = "2" + PAGEQUERY + SELECT + sd.*, + p.point_name, + m.material_code, + m.order_code + FROM + `st_ivt_vehicle_detail` sd + LEFT JOIN sch_base_point p ON p.point_code = sd.point_code + LEFT JOIN md_me_materialbase m ON m.material_id = sd.material_id + WHERE sd.is_back = '1' + ENDSELECT + ENDPAGEQUERY + ENDIF diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java index 257574c..7f6f30e 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/rest/PdaController.java @@ -425,4 +425,24 @@ public class PdaController { public JSONObject kilnMovePointList() { return PdaUtils.buildSuccessResultJSON(pdaService.kilnMovePointList()); } + // ==================================================================== + + @PostMapping("/manual/materialReturn") + @Log("泥料退料") + @ApiOperation("泥料退料") + @PdaAnnotation + public JSONObject MaterialReturn(@RequestBody JSONObject param) { + pdaService.MaterialReturn(param); + return PdaUtils.buildSuccessResultJSON(null); + } + // ==================================================================== + + @PostMapping("/manual/samplingCountNum") + @Log("取样计数") + @ApiOperation("取样计数") + @PdaAnnotation + public JSONObject samplingCountNum(@RequestBody JSONObject param) { + pdaService.samplingCountNum(param); + return PdaUtils.buildSuccessResultJSON(null); + } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java index cb92cfe..0dd88f6 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/service/PdaService.java @@ -232,4 +232,16 @@ public interface PdaService { * @return / */ JSONArray suppressTaskShow(); + + /** + * 退料 + * @param param / + */ + void MaterialReturn(JSONObject param); + + /** + * 取样计数 + * @param param / + */ + void samplingCountNum(JSONObject param); } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java index 312f5c7..79fab4d 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/service/impl/PdaServiceImpl.java @@ -36,6 +36,8 @@ import org.nl.wms.sch.task.util.TaskUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.math.BigDecimal; + /** * @author 张江玮 * @date 2022/12/02 10:04 @@ -1107,4 +1109,44 @@ public class PdaServiceImpl implements PdaService { public JSONArray suppressTaskShow() { return this.getMixingTaskList(); } + + @Override + @Transactional(rollbackFor = Exception.class) + public void MaterialReturn(JSONObject param) { + log.info("请求参数:{}", param); + WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail"); + WQLObject orderTab = WQLObject.getWQLObject("pdm_bd_workorder"); + // param: vehicle_code + String vehicleCode = param.getString("vehicle_code"); + JSONObject groupObj = vd_table.query("vehicle_code = '" + vehicleCode + "' AND vehicle_type = '1'", "create_time desc").uniqueResult(0); + if (ObjectUtil.isEmpty(groupObj)) { + throw new BadRequestException("料盅[" + vehicleCode + "]组盘信息不存在!"); + } + // 查找工单 + JSONObject orderObj = orderTab.query("workorder_id = '" + groupObj.getString("workorder_id") + "'").uniqueResult(0); + orderObj.put("unqualified_qty", orderObj.getBigDecimal("unqualified_qty").add(groupObj.getBigDecimal("weight"))); + TaskUtils.addCurrentUpdateColum(orderObj); + orderTab.update(orderObj); + // 组盘修改 + groupObj.put("is_back", "1"); + TaskUtils.addCurrentUpdateColum(groupObj); + vd_table.update(groupObj); + } + + @Override + public void samplingCountNum(JSONObject param) { + log.info("请求参数:{}", param); + WQLObject vd_table = WQLObject.getWQLObject("st_ivt_vehicle_detail"); + // param: vehicle_code, number + String vehicleCode = param.getString("vehicle_code"); + BigDecimal number = param.getBigDecimal("number"); + JSONObject groupObj = vd_table.query("vehicle_code = '" + vehicleCode + "' AND vehicle_type = '2'", "create_time desc").uniqueResult(0); + if (ObjectUtil.isEmpty(groupObj)) { + throw new BadRequestException("托盘[" + vehicleCode + "]组盘信息不存在!"); + } + BigDecimal bigDecimal = ObjectUtil.isNotEmpty(groupObj.getBigDecimal("count_num")) ? groupObj.getBigDecimal("count_num") : new BigDecimal("0"); + groupObj.put("count_num", bigDecimal.add(number)); + TaskUtils.addCurrentUpdateColum(groupObj); + vd_table.update(groupObj); + } } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/PointServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/PointServiceImpl.java index 45ad63f..5fa362d 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/PointServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/sch/service/impl/PointServiceImpl.java @@ -215,8 +215,8 @@ public class PointServiceImpl implements PointService { @Override public JSONArray getPoint(Map wherJson) { - String area_type = (String) wherJson.get("area_type"); - JSONArray point_rows = WQLObject.getWQLObject("sch_base_point").query("area_type IN (" + area_type + ") AND is_used = '1' AND is_delete = '0' order by point_code").getResultJSONArray(0); + String area_type = (String) wherJson.get("region_Code"); + JSONArray point_rows = WQLObject.getWQLObject("sch_base_point").query("region_Code IN ('" + area_type + "') order by point_code").getResultJSONArray(0); return point_rows; } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/wms.xls b/lms/nladmin-system/src/main/java/org/nl/wms/wms.xls index 3167e97..5bb1e68 100644 Binary files a/lms/nladmin-system/src/main/java/org/nl/wms/wms.xls and b/lms/nladmin-system/src/main/java/org/nl/wms/wms.xls differ diff --git a/lms/nladmin-ui/src/views/wms/report/back/index.vue b/lms/nladmin-ui/src/views/wms/report/back/index.vue new file mode 100644 index 0000000..a8b989e --- /dev/null +++ b/lms/nladmin-ui/src/views/wms/report/back/index.vue @@ -0,0 +1,73 @@ + + + + + diff --git a/lms/nladmin-ui/src/views/wms/report/xn/index.vue b/lms/nladmin-ui/src/views/wms/report/xn/index.vue new file mode 100644 index 0000000..13d6b57 --- /dev/null +++ b/lms/nladmin-ui/src/views/wms/report/xn/index.vue @@ -0,0 +1,106 @@ + + + + +