diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/common/enums/QueryTEnum.java b/mes/hd/nladmin-system/src/main/java/org/nl/common/enums/QueryTEnum.java index 5a56212c..ba53be3c 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/common/enums/QueryTEnum.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/common/enums/QueryTEnum.java @@ -17,6 +17,16 @@ public enum QueryTEnum { EQ((q, k, v) -> { q.eq(k[0],v); }), IN((q, key, o) -> { if (o instanceof Collection){ q.in(key[0],(Collection) o); } }), LK((q, keys, o) -> { for (String key : keys) { q.like(key,o); } }), + ORLK((q, k, o) -> { q.and(query -> { + QueryWrapper queryWrapper = (QueryWrapper) query; + for (int i = 0; i < k.length; i++) { + queryWrapper.like(k[i],o); + if (i != (k.length-1)){ + queryWrapper.or(); + } + } + }); + }), LE((q, k, v) -> { q.le(k[0],v); }), BY((q, k, v) -> { q.orderByDesc(k[0],v); }), NO((q, k, v) -> { q.isNull(k[0]); }), diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/controller/inspection/QlTestInspectionitempointController.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/controller/inspection/QlTestInspectionitempointController.java index 55e8f320..10177807 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/controller/inspection/QlTestInspectionitempointController.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/controller/inspection/QlTestInspectionitempointController.java @@ -1,19 +1,18 @@ package org.nl.wms.quality_manage.controller.inspection; +import com.alibaba.fastjson.JSONObject; import io.swagger.annotations.ApiOperation; import org.nl.common.anno.Log; import org.nl.common.domain.query.PageQuery; import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionitempointService; +import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionitempoint; import org.nl.wms.quality_manage.service.inspection.dto.ItemPointQuery; import org.nl.wms.storage_manage.semimanage.service.check.dto.CheckQuery; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** *

@@ -36,5 +35,32 @@ public class QlTestInspectionitempointController { public ResponseEntity query(ItemPointQuery query, PageQuery page) { return new ResponseEntity<>(inspectionitempointService.pageQuery(query, page), HttpStatus.OK); } + + @PostMapping + @Log("新增检测项点") + @ApiOperation("新增检测项点") + public ResponseEntity create(@RequestBody JSONObject whereJson) { + inspectionitempointService.create(whereJson); + return new ResponseEntity<>(HttpStatus.OK); + } + + @PostMapping("/update") + @Log("修改检测项点") + @ApiOperation("修改检测项点") + public ResponseEntity update(@RequestBody JSONObject whereJson) { + inspectionitempointService.update(whereJson); + return new ResponseEntity<>(HttpStatus.OK); + } + + @PostMapping("delete") + @Log("修改检测项点") + @ApiOperation("新增检测项点") + public ResponseEntity delete(@RequestBody Long[] ids) { + for (Long id : ids) { + inspectionitempointService.removeById(id); + } + return new ResponseEntity<>(HttpStatus.OK); + } + } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/controller/inspection/QlTestInspectionschemedtlproductstandardController.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/controller/inspection/QlTestInspectionschemedtlproductstandardController.java index 8c40aff3..66e8c5fe 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/controller/inspection/QlTestInspectionschemedtlproductstandardController.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/controller/inspection/QlTestInspectionschemedtlproductstandardController.java @@ -1,9 +1,19 @@ package org.nl.wms.quality_manage.controller.inspection; -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import io.swagger.annotations.ApiOperation; +import org.nl.common.anno.Log; +import org.nl.common.domain.query.PageQuery; +import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionschemedtlproductstandardService; +import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtlproductstandard; +import org.nl.wms.quality_manage.service.inspection.dto.StandardQuery; +import org.nl.wms.storage_manage.semimanage.service.iostorInv.dto.BcpIostorInvQuery; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; /** *

@@ -14,8 +24,43 @@ import org.springframework.web.bind.annotation.RestController; * @since 2023-05-06 */ @RestController -@RequestMapping("/qlTestInspectionschemedtlproductstandard") +@RequestMapping("/api/productStandard") public class QlTestInspectionschemedtlproductstandardController { + @Autowired + private IQlTestInspectionschemedtlproductstandardService standardService; + + @PostMapping("/saveData") + @Log("新增检测方案标准") + @ApiOperation("新增检测方案标准") + public ResponseEntity create(@RequestBody JSONObject whereJson) { + standardService.saveData(whereJson); + return new ResponseEntity<>(HttpStatus.OK); + } + + @GetMapping + @Log("查询检测方案标准") + @ApiOperation("查询检测方案标准") + public ResponseEntity query(StandardQuery query, PageQuery page) { + return new ResponseEntity<>(standardService.query(query, page), HttpStatus.OK); + } + + @PostMapping("/getDtl") + @Log("查询检测方案标准明细") + @ApiOperation("查询检测方案标准明细") + public ResponseEntity query(@RequestBody JSONObject whereJson) { + return new ResponseEntity<>(standardService.getDtl(whereJson), HttpStatus.OK); + } + + @PostMapping("/delete") + @Log("删除检测方案标准") + @ApiOperation("删除检测方案标准") + public ResponseEntity delete(@RequestBody Long[] ids) { + for (Long id : ids){ + standardService.remove(new QueryWrapper() + .lambda().eq(QlTestInspectionschemedtlproductstandard::getMaterial_id,id)); + } + return new ResponseEntity<>(HttpStatus.OK); + } } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/controller/inspection/QlTestInspectionschememstController.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/controller/inspection/QlTestInspectionschememstController.java index 4454d137..1da6fbd9 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/controller/inspection/QlTestInspectionschememstController.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/controller/inspection/QlTestInspectionschememstController.java @@ -1,9 +1,22 @@ package org.nl.wms.quality_manage.controller.inspection; -import org.springframework.web.bind.annotation.RequestMapping; - -import org.springframework.web.bind.annotation.RestController; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; +import io.swagger.annotations.ApiOperation; +import org.nl.common.anno.Log; +import org.nl.common.domain.query.PageQuery; +import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionschemedtlService; +import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionschememstService; +import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtl; +import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst; +import org.nl.wms.quality_manage.service.inspection.dto.ItemPointQuery; +import org.nl.wms.quality_manage.service.inspection.dto.SchemeQuery; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; /** *

@@ -14,8 +27,62 @@ import org.springframework.web.bind.annotation.RestController; * @since 2023-05-06 */ @RestController -@RequestMapping("/qlTestInspectionschememst") +@RequestMapping("/api/inspectionSchemeMst") public class QlTestInspectionschememstController { + @Autowired + private IQlTestInspectionschememstService inspectionschememstService; + + @Autowired + private IQlTestInspectionschemedtlService inspectionschemedtlService; + + @GetMapping + @Log("查询检测方案") + @ApiOperation("查询检测方案") + public ResponseEntity query(SchemeQuery query, PageQuery page) { + return new ResponseEntity<>(inspectionschememstService.pageQuery(query, page), HttpStatus.OK); + } + + @PostMapping + @Log("新增检测方案") + @ApiOperation("新增检测方案") + public ResponseEntity create(@RequestBody JSONObject whereJson) { + inspectionschememstService.create(whereJson); + return new ResponseEntity<>(HttpStatus.OK); + } + + @PostMapping("/update") + @Log("修改检测方案") + @ApiOperation("修改检测方案") + public ResponseEntity update(@RequestBody JSONObject whereJson) { + inspectionschememstService.update(whereJson); + return new ResponseEntity<>(HttpStatus.OK); + } + + @PostMapping("/delete") + @Log("删除检测方案") + @ApiOperation("删除检测方案") + public ResponseEntity delete(@RequestBody Long[] ids) { + for (Long id : ids) { + inspectionschememstService.removeById(id); + inspectionschemedtlService.remove(new QueryWrapper().lambda().eq(QlTestInspectionschemedtl::getInspection_scheme_id, id)); + } + return new ResponseEntity<>(HttpStatus.OK); + } + + @PostMapping("/getDtl") + @Log("获取方案明细") + @ApiOperation("获取方案明细") + public ResponseEntity getDtl(@RequestBody QlTestInspectionschememst mst) { + return new ResponseEntity<>(inspectionschemedtlService.getDtl(mst),HttpStatus.OK); + } + + @PostMapping("/selectList") + @Log("检测方案下拉框") + @ApiOperation("检测方案下拉框") + public ResponseEntity selectList() { + return new ResponseEntity<>(inspectionschememstService.list(new QueryWrapper().lambda().eq(QlTestInspectionschememst::getIs_used,true)),HttpStatus.OK); + } + } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/IQlTestInspectionitempointService.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/IQlTestInspectionitempointService.java index b261c11c..f0753304 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/IQlTestInspectionitempointService.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/IQlTestInspectionitempointService.java @@ -1,5 +1,6 @@ package org.nl.wms.quality_manage.service.inspection; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.extension.service.IService; import org.nl.common.domain.query.PageQuery; import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionitempoint; @@ -17,4 +18,7 @@ public interface IQlTestInspectionitempointService extends IService @@ -12,5 +19,7 @@ import com.baomidou.mybatisplus.extension.service.IService; * @since 2023-05-06 */ public interface IQlTestInspectionschemedtlService extends IService { + double create(JSONArray rows, QlTestInspectionschememst mst); + List getDtl(QlTestInspectionschememst mst); } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/IQlTestInspectionschemedtlproductstandardService.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/IQlTestInspectionschemedtlproductstandardService.java index b46d7bf1..c32535a7 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/IQlTestInspectionschemedtlproductstandardService.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/IQlTestInspectionschemedtlproductstandardService.java @@ -1,7 +1,14 @@ package org.nl.wms.quality_manage.service.inspection; -import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtlproductstandard; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.extension.service.IService; +import org.nl.common.domain.query.PageQuery; +import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtlproductstandard; +import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst; +import org.nl.wms.quality_manage.service.inspection.dto.StandardQuery; + +import java.util.List; +import java.util.Map; /** *

@@ -13,4 +20,9 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IQlTestInspectionschemedtlproductstandardService extends IService { + void saveData(JSONObject jo); + + Object query(StandardQuery query, PageQuery page); + + List getDtl(JSONObject whereJson); } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/IQlTestInspectionschememstService.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/IQlTestInspectionschememstService.java index 69f94db5..463d07c5 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/IQlTestInspectionschememstService.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/IQlTestInspectionschememstService.java @@ -1,7 +1,10 @@ package org.nl.wms.quality_manage.service.inspection; -import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.extension.service.IService; +import org.nl.common.domain.query.PageQuery; +import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst; +import org.nl.wms.quality_manage.service.inspection.dto.SchemeQuery; /** *

@@ -13,4 +16,8 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface IQlTestInspectionschememstService extends IService { + Object pageQuery(SchemeQuery query, PageQuery page); + void create(JSONObject jo); + + void update(JSONObject jo); } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/QlTestInspectionitempoint.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/QlTestInspectionitempoint.java index d70177e3..1336ab63 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/QlTestInspectionitempoint.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/QlTestInspectionitempoint.java @@ -1,5 +1,6 @@ package org.nl.wms.quality_manage.service.inspection.dao; +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.util.Date; import java.io.Serializable; @@ -24,6 +25,7 @@ public class QlTestInspectionitempoint implements Serializable { /** * 项点标识 */ + @TableId private String inspection_item_id; /** @@ -74,7 +76,7 @@ public class QlTestInspectionitempoint implements Serializable { /** * 创建时间 */ - private Date create_time; + private String create_time; /** * 修改人 @@ -89,7 +91,7 @@ public class QlTestInspectionitempoint implements Serializable { /** * 修改时间 */ - private Date update_time; + private String update_time; /** * 是否临界值填充备注 diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/QlTestInspectionschememst.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/QlTestInspectionschememst.java index 27a61a36..08cfd2ca 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/QlTestInspectionschememst.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/QlTestInspectionschememst.java @@ -1,6 +1,8 @@ package org.nl.wms.quality_manage.service.inspection.dao; import java.math.BigDecimal; + +import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import java.util.Date; import java.io.Serializable; @@ -25,6 +27,7 @@ public class QlTestInspectionschememst implements Serializable { /** * 检验方案标识 */ + @TableId private String inspection_scheme_id; /** @@ -43,19 +46,9 @@ public class QlTestInspectionschememst implements Serializable { private String inspection_scheme_type; /** - * 厂家质保项数量 + * 明细项 */ - private BigDecimal factory_qty; - - /** - * 工序检验项数量 - */ - private BigDecimal workprocedure_qty; - - /** - * 理化检验项数量 - */ - private BigDecimal physical_qty; + private BigDecimal detail_count; /** * 备注 @@ -80,7 +73,7 @@ public class QlTestInspectionschememst implements Serializable { /** * 创建时间 */ - private Date create_time; + private String create_time; /** * 修改人 @@ -95,7 +88,7 @@ public class QlTestInspectionschememst implements Serializable { /** * 修改时间 */ - private Date update_time; + private String update_time; } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/mapper/QlTestInspectionschemedtlMapper.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/mapper/QlTestInspectionschemedtlMapper.java index 15fa08ae..19ea5f20 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/mapper/QlTestInspectionschemedtlMapper.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/mapper/QlTestInspectionschemedtlMapper.java @@ -1,7 +1,12 @@ package org.nl.wms.quality_manage.service.inspection.dao.mapper; +import org.apache.ibatis.annotations.Param; import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtl; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst; + +import java.util.List; +import java.util.Map; /** *

@@ -13,4 +18,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface QlTestInspectionschemedtlMapper extends BaseMapper { + List getDtl(@Param("mst") QlTestInspectionschememst mst); } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/mapper/QlTestInspectionschemedtlMapper.xml b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/mapper/QlTestInspectionschemedtlMapper.xml index 63525ef6..cb2a8cf0 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/mapper/QlTestInspectionschemedtlMapper.xml +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/mapper/QlTestInspectionschemedtlMapper.xml @@ -2,4 +2,19 @@ + diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/mapper/QlTestInspectionschemedtlproductstandardMapper.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/mapper/QlTestInspectionschemedtlproductstandardMapper.java index 71ae8933..b9e3cbb5 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/mapper/QlTestInspectionschemedtlproductstandardMapper.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/mapper/QlTestInspectionschemedtlproductstandardMapper.java @@ -1,7 +1,13 @@ package org.nl.wms.quality_manage.service.inspection.dao.mapper; -import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtlproductstandard; +import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtlproductstandard; +import org.nl.wms.quality_manage.service.inspection.dto.StandardQuery; + +import java.util.List; +import java.util.Map; /** *

@@ -13,4 +19,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; */ public interface QlTestInspectionschemedtlproductstandardMapper extends BaseMapper { + List getDtl(@Param("query") StandardQuery query); + List queryDtl(@Param("form") JSONObject form); } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/mapper/QlTestInspectionschemedtlproductstandardMapper.xml b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/mapper/QlTestInspectionschemedtlproductstandardMapper.xml index 200280e1..514eed00 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/mapper/QlTestInspectionschemedtlproductstandardMapper.xml +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dao/mapper/QlTestInspectionschemedtlproductstandardMapper.xml @@ -2,4 +2,54 @@ + + diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dto/ItemPointQuery.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dto/ItemPointQuery.java index ae5c6cf9..3c7c2392 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dto/ItemPointQuery.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dto/ItemPointQuery.java @@ -19,4 +19,12 @@ public class ItemPointQuery extends BaseQuery { private String inspection_type; + private String item_search; + + @Override + public void paramMapping() { + super.doP.put("item_search", QParam.builder().k(new String[]{"inspection_item_code","inspection_item_name"}).type(QueryTEnum.ORLK).build()); + } + + } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dto/SchemeQuery.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dto/SchemeQuery.java new file mode 100644 index 00000000..92cd8a24 --- /dev/null +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dto/SchemeQuery.java @@ -0,0 +1,28 @@ +package org.nl.wms.quality_manage.service.inspection.dto; + +import lombok.Data; +import org.nl.common.domain.query.BaseQuery; +import org.nl.common.domain.query.QParam; +import org.nl.common.enums.QueryTEnum; +import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionitempoint; +import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst; + +/* + * @author ZZQ + * @Date 2023/5/4 19:49 + */ +@Data +public class SchemeQuery extends BaseQuery { + + + private String inspection_scheme_type; + + private String sch_search; + + @Override + public void paramMapping() { + super.doP.put("sch_search", QParam.builder().k(new String[]{"inspection_scheme_code","inspection_scheme_name"}).type(QueryTEnum.ORLK).build()); + } + + +} diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dto/StandardQuery.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dto/StandardQuery.java new file mode 100644 index 00000000..623e0c14 --- /dev/null +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/dto/StandardQuery.java @@ -0,0 +1,24 @@ +package org.nl.wms.quality_manage.service.inspection.dto; + +import lombok.Data; +import org.nl.common.domain.query.BaseQuery; +import org.nl.common.domain.query.QParam; +import org.nl.common.enums.QueryTEnum; +import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtlproductstandard; +import org.nl.wms.storage_manage.semimanage.service.iostorInv.dao.StIvtIostorinvBcp; + +/* + * @author ZZQ + * @Date 2023/5/4 19:49 + */ +@Data +public class StandardQuery extends BaseQuery { + + + private String material_search; + + private String inspection_scheme_type; + + private String inspection_scheme_search; + +} diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/impl/QlTestInspectionitempointServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/impl/QlTestInspectionitempointServiceImpl.java index 9cff92f9..5fd9304a 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/impl/QlTestInspectionitempointServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/impl/QlTestInspectionitempointServiceImpl.java @@ -1,17 +1,32 @@ package org.nl.wms.quality_manage.service.inspection.impl; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.jsonwebtoken.lang.Assert; +import org.jetbrains.annotations.NotNull; import org.nl.common.TableDataInfo; import org.nl.common.domain.query.PageQuery; +import org.nl.common.utils.IdUtil; +import org.nl.common.utils.SecurityUtils; +import org.nl.modules.common.exception.BadRequestException; +import org.nl.modules.system.util.CodeUtil; +import org.nl.wms.masterdata_manage.storage.service.storage.dao.StIvtBsrealstorattr; import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionitempoint; import org.nl.wms.quality_manage.service.inspection.dao.mapper.QlTestInspectionitempointMapper; import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionitempointService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.nl.wms.quality_manage.service.inspection.dto.ItemPointQuery; +import org.nl.wms.storage_manage.CHECKEnum; import org.nl.wms.storage_manage.semimanage.service.check.dao.StIvtCheckmstBcp; import org.nl.wms.storage_manage.semimanage.service.check.dto.CheckQuery; import org.springframework.stereotype.Service; +import java.math.BigDecimal; + /** *

* 检验项点表 服务实现类 @@ -22,11 +37,54 @@ import org.springframework.stereotype.Service; */ @Service public class QlTestInspectionitempointServiceImpl extends ServiceImpl implements IQlTestInspectionitempointService { + @Override + public void create(JSONObject jo) { + QlTestInspectionitempoint mstForm = packageMstForm(new QlTestInspectionitempoint(), jo); + String item_code = mstForm.getInspection_item_code(); + QlTestInspectionitempoint one = this.getOne(new QueryWrapper().lambda().eq(QlTestInspectionitempoint::getInspection_item_code, item_code)); + if (ObjectUtil.isNotEmpty(one)) { + throw new BadRequestException("编码已存在!"); + } + this.save(mstForm); + } + + @Override + public void update(JSONObject form) { + Assert.notNull(new Object[]{form, form.get("inspection_item_id")}, "请求参数不能为空"); + QlTestInspectionitempoint mst = form.toJavaObject(QlTestInspectionitempoint.class); + String item_code = mst.getInspection_item_code(); + QlTestInspectionitempoint one = this.getOne(new QueryWrapper().lambda().eq(QlTestInspectionitempoint::getInspection_item_code, item_code)); + if (ObjectUtil.isNotEmpty(one) && !one.getInspection_item_id().equals(mst.getInspection_item_id())) { + throw new BadRequestException("编码已存在!"); + } + mst.setUpdate_id(SecurityUtils.getCurrentUserId()); + mst.setUpdate_name(SecurityUtils.getCurrentNickName()); + mst.setUpdate_time(DateUtil.now()); + this.updateById(mst); + } + @Override public Object pageQuery(ItemPointQuery query, PageQuery page) { // 分页查询 + QueryWrapper queryWrapper = new QueryWrapper<>(); Page pageQuery = this.page(page.build(), query.build()); TableDataInfo build = TableDataInfo.build(pageQuery); return build; } + + @NotNull + private QlTestInspectionitempoint packageMstForm(QlTestInspectionitempoint itempoint, JSONObject whereJson) { + itempoint.setInspection_item_id(IdUtil.getStringId()); + itempoint.setInspection_item_code(whereJson.getString("inspection_item_code")); + itempoint.setInspection_item_name(whereJson.getString("inspection_item_name")); + itempoint.setInspection_item_type(whereJson.getString("inspection_item_type")); + itempoint.setInspection_type(whereJson.getString("inspection_type")); + itempoint.setMaterial_id(whereJson.getString("material_id")); + itempoint.setMaterial_code(whereJson.getString("material_code")); + itempoint.setRemark(whereJson.getString("remark")); + itempoint.setCreate_id(SecurityUtils.getCurrentUserId()); + itempoint.setCreate_name(SecurityUtils.getCurrentNickName()); + itempoint.setCreate_time(DateUtil.now()); + return itempoint; + } } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/impl/QlTestInspectionschemedtlServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/impl/QlTestInspectionschemedtlServiceImpl.java index fd9836d4..25f59958 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/impl/QlTestInspectionschemedtlServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/impl/QlTestInspectionschemedtlServiceImpl.java @@ -1,11 +1,19 @@ package org.nl.wms.quality_manage.service.inspection.impl; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import org.nl.common.utils.IdUtil; import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtl; +import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst; import org.nl.wms.quality_manage.service.inspection.dao.mapper.QlTestInspectionschemedtlMapper; import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionschemedtlService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Map; + /** *

* 检验方案明细表 服务实现类 @@ -17,4 +25,29 @@ import org.springframework.stereotype.Service; @Service public class QlTestInspectionschemedtlServiceImpl extends ServiceImpl implements IQlTestInspectionschemedtlService { + @Override + public List getDtl(QlTestInspectionschememst mst) { + return this.baseMapper.getDtl(mst); + } + + @Override + public double create(JSONArray rows, QlTestInspectionschememst mst) { + //插入明细之前把所有的明细先删除 + this.remove(new QueryWrapper().lambda().eq(QlTestInspectionschemedtl::getInspection_scheme_id, mst.getInspection_scheme_id())); + for (int i = 0; i < rows.size(); i++) { + JSONObject row = rows.getJSONObject(i); + QlTestInspectionschemedtl dtl = new QlTestInspectionschemedtl(); + dtl.setInspection_scheme_dtl_id(IdUtil.getStringId()); + dtl.setInspection_scheme_id(mst.getInspection_scheme_id()); + dtl.setInspection_scheme_code(mst.getInspection_scheme_code()); + dtl.setInspection_scheme_name(mst.getInspection_scheme_name()); + dtl.setInspection_item_id(row.getString("inspection_item_id")); + dtl.setInspection_item_code(row.getString("inspection_item_code")); + dtl.setInspection_item_name(row.getString("inspection_item_name")); + dtl.setRemark(row.getString("remark")); + dtl.setOrder_index(row.getInteger("order_index")); + this.save(dtl); + } + return rows.size(); + } } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/impl/QlTestInspectionschemedtlproductstandardServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/impl/QlTestInspectionschemedtlproductstandardServiceImpl.java index 9b374419..bbc3e4e1 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/impl/QlTestInspectionschemedtlproductstandardServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/impl/QlTestInspectionschemedtlproductstandardServiceImpl.java @@ -1,11 +1,32 @@ package org.nl.wms.quality_manage.service.inspection.impl; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.StrUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import org.jetbrains.annotations.NotNull; +import org.nl.common.TableDataInfo; +import org.nl.common.domain.query.PageQuery; +import org.nl.common.utils.IdUtil; +import org.nl.common.utils.SecurityUtils; +import org.nl.modules.common.exception.BadRequestException; +import org.nl.modules.system.util.CodeUtil; +import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionschememstService; import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschemedtlproductstandard; +import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst; import org.nl.wms.quality_manage.service.inspection.dao.mapper.QlTestInspectionschemedtlproductstandardMapper; import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionschemedtlproductstandardService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.nl.wms.quality_manage.service.inspection.dto.StandardQuery; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; +import java.util.Map; + /** *

* 产品检验方案标准表 服务实现类 @@ -17,4 +38,63 @@ import org.springframework.stereotype.Service; @Service public class QlTestInspectionschemedtlproductstandardServiceImpl extends ServiceImpl implements IQlTestInspectionschemedtlproductstandardService { + @Autowired + private IQlTestInspectionschememstService inspectionschememstService; + + @Override + public Object query(StandardQuery query, PageQuery pageQuery) { + Page page = PageHelper.startPage(pageQuery.getPage() + 1, pageQuery.getSize()); + TableDataInfo build = TableDataInfo.build(this.baseMapper.getDtl(query)); + build.setTotalElements(page.getTotal()); + return build; + } + + @Override + public List getDtl(JSONObject whereJson) { + return this.baseMapper.queryDtl(whereJson); + } + + @Override + public void saveData(JSONObject jo) { + //1-复制新增;2-新增;3-修改 + String material_id = jo.getString("material_id"); + JSONArray rows = jo.getJSONArray("tableData"); + + if (StrUtil.isEmpty(material_id)) { + throw new BadRequestException("物料不能为空!"); + } + if (rows.size() == 0) { + throw new BadRequestException("明细不能为空!"); + } + + this.remove(new QueryWrapper().lambda().eq(QlTestInspectionschemedtlproductstandard::getMaterial_id, material_id)); + + for (int i = 0; i < rows.size(); i++) { + JSONObject row = rows.getJSONObject(i); + row.put("material_id",jo.getString("material_id")); + row.put("material_code",jo.getString("material_code")); + this.save(packageMstForm(new QlTestInspectionschemedtlproductstandard(), row)); + } + } + + @NotNull + private QlTestInspectionschemedtlproductstandard packageMstForm(QlTestInspectionschemedtlproductstandard mst, JSONObject whereJson) { + mst.setInspection_standard_dtl_id(IdUtil.getStringId()); + mst.setMaterial_id(whereJson.getString("material_id")); + mst.setMaterial_code(whereJson.getString("material_code")); + String inspection_scheme_id = whereJson.getString("inspection_scheme_id"); + mst.setInspection_scheme_id(whereJson.getString("inspection_scheme_id")); + QlTestInspectionschememst scheme_mst = inspectionschememstService.getOne(new QueryWrapper().lambda().eq(QlTestInspectionschememst::getInspection_scheme_id, inspection_scheme_id)); + mst.setInspection_scheme_code(scheme_mst.getInspection_scheme_code()); + mst.setInspection_scheme_name(scheme_mst.getInspection_scheme_name()); + mst.setInspection_item_id(whereJson.getString("inspection_item_id")); + mst.setInspection_item_code(whereJson.getString("inspection_item_code")); + mst.setInspection_item_name(whereJson.getString("inspection_item_name")); + mst.setUp_limit(whereJson.getBigDecimal("up_limit")); + mst.setDown_limit(whereJson.getBigDecimal("down_limit")); + mst.setUp_limit_value(whereJson.getBigDecimal("up_limit_value")); + mst.setDown_limit_value(whereJson.getBigDecimal("down_limit_value")); + mst.setRemark(whereJson.getString("remark")); + return mst; + } } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/impl/QlTestInspectionschememstServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/impl/QlTestInspectionschememstServiceImpl.java index 84412eb4..8b378670 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/impl/QlTestInspectionschememstServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/quality_manage/service/inspection/impl/QlTestInspectionschememstServiceImpl.java @@ -1,9 +1,29 @@ package org.nl.wms.quality_manage.service.inspection.impl; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.ObjectUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.jsonwebtoken.lang.Assert; +import org.jetbrains.annotations.NotNull; +import org.nl.common.TableDataInfo; +import org.nl.common.domain.query.PageQuery; +import org.nl.common.utils.IdUtil; +import org.nl.common.utils.SecurityUtils; +import org.nl.modules.common.exception.BadRequestException; +import org.nl.modules.system.util.CodeUtil; +import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionschemedtlService; +import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionitempoint; import org.nl.wms.quality_manage.service.inspection.dao.QlTestInspectionschememst; import org.nl.wms.quality_manage.service.inspection.dao.mapper.QlTestInspectionschememstMapper; import org.nl.wms.quality_manage.service.inspection.IQlTestInspectionschememstService; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.nl.wms.quality_manage.service.inspection.dto.ItemPointQuery; +import org.nl.wms.quality_manage.service.inspection.dto.SchemeQuery; +import org.nl.wms.storage_manage.semimanage.service.check.dao.StIvtCheckmstBcp; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** @@ -17,4 +37,58 @@ import org.springframework.stereotype.Service; @Service public class QlTestInspectionschememstServiceImpl extends ServiceImpl implements IQlTestInspectionschememstService { + @Autowired + private IQlTestInspectionschemedtlService inspectionschemedtlService; + + @Override + public void update(JSONObject form) { + Assert.notNull(form.get("inspection_scheme_id"), "请求参数不能为空"); + QlTestInspectionschememst mst = form.toJavaObject(QlTestInspectionschememst.class); + mst.setUpdate_optid(SecurityUtils.getCurrentUserId()); + mst.setUpdate_optname(SecurityUtils.getCurrentNickName()); + mst.setUpdate_time(DateUtil.now()); + this.updateById(mst); + + JSONArray rows = form.getJSONArray("tableData"); + if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空"); + // 调用明细表 插入/更新方法 + inspectionschemedtlService.create(rows, mst); + } + + @Override + public Object pageQuery(SchemeQuery query, PageQuery page) { + // 分页查询 + QueryWrapper queryWrapper = new QueryWrapper<>(); + Page pageQuery = this.page(page.build(), query.build()); + TableDataInfo build = TableDataInfo.build(pageQuery); + return build; + } + + @Override + public void create(JSONObject jo) { + JSONArray rows = jo.getJSONArray("tableData"); + if (ObjectUtil.isEmpty(rows)) throw new BadRequestException("请求参数不能为空"); + + // 调用主表 插入/更新方法 + QlTestInspectionschememst mst = packageMstForm(new QlTestInspectionschememst(), jo); + this.save(mst); + + //调用明细表 插入方法 + inspectionschemedtlService.create(rows, mst); + } + + @NotNull + private QlTestInspectionschememst packageMstForm(QlTestInspectionschememst mst, JSONObject whereJson) { + mst.setInspection_scheme_id(IdUtil.getStringId()); + mst.setInspection_scheme_code(CodeUtil.getNewCode("F_CODE")); + mst.setInspection_scheme_name(whereJson.getString("inspection_scheme_name")); + mst.setInspection_scheme_type(whereJson.getString("inspection_scheme_type")); + mst.setDetail_count(whereJson.getBigDecimal("detail_count")); + mst.setIs_used(true); + mst.setRemark(whereJson.getString("remark")); + mst.setCreate_id(SecurityUtils.getCurrentUserId()); + mst.setCreate_name(SecurityUtils.getCurrentNickName()); + mst.setCreate_time(DateUtil.now()); + return mst; + } } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/system_manage/service/coderule/dao/SysCodeRule.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/system_manage/service/coderule/dao/SysCodeRule.java index a6712999..eb61bd34 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/system_manage/service/coderule/dao/SysCodeRule.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/system_manage/service/coderule/dao/SysCodeRule.java @@ -42,7 +42,7 @@ public class SysCodeRule implements Serializable { /** * 当前值 */ - private String currentValue; + private String current_value; /** * 备注 @@ -52,42 +52,42 @@ public class SysCodeRule implements Serializable { /** * 是否启用 */ - private String isActive; + private String is_active; /** * 是否删除 */ - private String isDelete; + private String is_delete; /** * 创建id */ - private String createId; + private String create_id; /** * 创建者 */ - private String createName; + private String create_name; /** * 创建时间 */ - private String createTime; + private String create_time; /** * 修改id */ - private String updateId; + private String update_id; /** * 修改者 */ - private String updateName; + private String update_name; /** * 修改时间 */ - private String updateTime; + private String update_time; @TableField(exist = false) private String demo; diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/system_manage/service/coderule/dao/SysCodeRuleDetail.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/system_manage/service/coderule/dao/SysCodeRuleDetail.java index 4b6ba762..008a5993 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/system_manage/service/coderule/dao/SysCodeRuleDetail.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/system_manage/service/coderule/dao/SysCodeRuleDetail.java @@ -38,17 +38,17 @@ public class SysCodeRuleDetail implements Serializable { /** * 初始值 */ - private String initValue; + private String init_value; /** * 当前值 */ - private String currentValue; + private String current_value; /** * 允许最大值 */ - private String maxValue; + private String max_value; /** * 步长 @@ -73,7 +73,7 @@ public class SysCodeRuleDetail implements Serializable { /** * 排序号 */ - private BigDecimal sortNum; + private BigDecimal sort_num; /** * 备注 @@ -83,50 +83,50 @@ public class SysCodeRuleDetail implements Serializable { /** * 编码规则标识 */ - private String codeRuleId; + private String code_rule_id; /** * 是否启用 */ - private String isActive; + private String is_active; /** * 是否删除 */ - private String isDelete; + private String is_delete; /** * 创建id */ - private String createId; + private String create_id; /** * 创建者 */ - private String createName; + private String create_name; /** * 创建时间 */ - private String createTime; + private String create_time; /** * 修改id */ - private String updateId; + private String update_id; /** * 修改者 */ - private String updateName; + private String update_name; /** * 修改时间 */ - private String updateTime; + private String update_time; @TableField(exist = false) - private String dictName; + private String dict_name; } diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/system_manage/service/coderule/impl/SysCodeRuleDetailServiceImpl.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/system_manage/service/coderule/impl/SysCodeRuleDetailServiceImpl.java index 692bf9f1..df775a63 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/system_manage/service/coderule/impl/SysCodeRuleDetailServiceImpl.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/system_manage/service/coderule/impl/SysCodeRuleDetailServiceImpl.java @@ -35,8 +35,8 @@ public class SysCodeRuleDetailServiceImpl extends ServiceImpl queryAll(CodeRuleDetailQuery form, PageQuery page) { LambdaQueryWrapper lam = new LambdaQueryWrapper<>(); - lam.eq(SysCodeRuleDetail::getCodeRuleId, form.getId()) - .orderByAsc(SysCodeRuleDetail::getSortNum); + lam.eq(SysCodeRuleDetail::getCode_rule_id, form.getId()) + .orderByAsc(SysCodeRuleDetail::getSort_num); IPage pages = new Page<>(page.getPage() + 1, page.getSize()); codeRuleDetailMapper.selectPage(pages, lam); return pages; @@ -49,19 +49,19 @@ public class SysCodeRuleDetailServiceImpl extends ServiceImpl().eq(SysCodeRule::getCode, code)).getId(); // 如果flag = 1就执行更新数据库的操作 String flag = (String) form.get("flag"); - List ruleDetails = codeRuleDetailMapper.selectList(new LambdaQueryWrapper().eq(SysCodeRuleDetail::getCodeRuleId, id)); + List ruleDetails = codeRuleDetailMapper.selectList(new LambdaQueryWrapper().eq(SysCodeRuleDetail::getCode_rule_id, id)); String demo = ""; boolean isSame = true; for(SysCodeRuleDetail detail : ruleDetails) { @@ -63,11 +63,11 @@ public class SysCodeRuleServiceImpl extends ServiceImpl maxValue) { - numValue = detail.getInitValue(); + Long maxValue = Long.valueOf(detail.getMax_value()); + if (!isSame && (Long.parseLong(detail.getCurrent_value()) + step) > maxValue) { + numValue = detail.getInit_value(); } else { - numValue = Integer.parseInt(detail.getCurrentValue()) + step + ""; + numValue = Integer.parseInt(detail.getCurrent_value()) + step + ""; } int size = numValue.length(); int length = detail.getLength(); @@ -99,18 +99,18 @@ public class SysCodeRuleServiceImpl extends ServiceImpl= maxValue) { - numCurr = Integer.parseInt(detail.getInitValue()); - detail.setCurrentValue(String.valueOf(numCurr)); + numCurr = Integer.parseInt(detail.getInit_value()); + detail.setCurrent_value(String.valueOf(numCurr)); }else{ - detail.setCurrentValue(String.valueOf(numCurr + step)); + detail.setCurrent_value(String.valueOf(numCurr + step)); } } } @@ -132,12 +132,12 @@ public class SysCodeRuleServiceImpl extends ServiceImpl sysCodeRules = codeRuleMapper.selectList(new LambdaQueryWrapper().eq(SysCodeRule::getCode, codeRule.getCode())); if (ObjectUtil.isNotEmpty(sysCodeRules)) throw new BadRequestException("编号[" + sysCodeRules.get(0).getCode() + "]已存在"); codeRule.setId(IdUtil.getSnowflake(1,1).nextIdStr()); - codeRule.setCreateId(currentUserId); - codeRule.setCreateName(currentUsername); - codeRule.setCreateTime(now); - codeRule.setUpdateId(currentUserId); - codeRule.setUpdateName(currentUsername); - codeRule.setUpdateTime(now); + codeRule.setCreate_id(currentUserId); + codeRule.setCreate_name(currentUsername); + codeRule.setCreate_time(now); + codeRule.setUpdate_id(currentUserId); + codeRule.setUpdate_name(currentUsername); + codeRule.setUpdate_time(now); codeRuleMapper.insert(codeRule); } @@ -146,7 +146,7 @@ public class SysCodeRuleServiceImpl extends ServiceImpl ids) { ids.forEach(id -> { codeRuleMapper.deleteById(id); - codeRuleDetailMapper.delete(new LambdaQueryWrapper().eq(SysCodeRuleDetail::getCodeRuleId, id)); + codeRuleDetailMapper.delete(new LambdaQueryWrapper().eq(SysCodeRuleDetail::getCode_rule_id, id)); }); } @@ -159,9 +159,9 @@ public class SysCodeRuleServiceImpl extends ServiceImpl
-
+
点击编码查看详情
@@ -42,7 +42,7 @@
- +
@@ -61,12 +61,12 @@ - +
- {{ query.dictName }} + {{ query.dict_name }} - - + + 编码详情 - + - + - - - - + @@ -172,18 +169,12 @@ @selection-change="crud.selectionChangeHandler" > - - - - - - + + + - - - @@ -215,13 +206,13 @@ const defaultForm = { inspection_item_id: null, inspection_item_code: null, inspection_item_name: null, - inspection_item_type: null, + inspection_item_type: '02', workprocedure_uuid: null, workprocedure_code: null, workprocedure_name: null, inspection_type: '02', - material_uuid: null, - material_name: null, + material_id: null, + material_code: null, remark: null, create_id: null, create_name: null, @@ -292,10 +283,16 @@ export default { hand(value) { this.crud.toQuery() }, + typeFormat(row, column) { + return this.dict.label.QC_INSPECTION_TYPE[row.inspection_type] + }, + itemTypeFormat(row, column) { + return this.dict.label.QL_TEST_POINTTYPE[row.inspection_item_type] + }, tableChanged2(row) { // 新增一行物料时,给行进行赋值 - this.form.material_uuid = row.material_id - this.form.material_name = row.material_name + this.form.material_id = row.material_id + this.form.material_code = row.material_code } } } diff --git a/mes/qd/src/views/wms/masterdata_manage/ql/inspectionItemPoint/inspectionItemPoint.js b/mes/qd/src/views/wms/masterdata_manage/ql/inspectionItemPoint/inspectionItemPoint.js index e11a4cd1..ead12127 100644 --- a/mes/qd/src/views/wms/masterdata_manage/ql/inspectionItemPoint/inspectionItemPoint.js +++ b/mes/qd/src/views/wms/masterdata_manage/ql/inspectionItemPoint/inspectionItemPoint.js @@ -10,16 +10,16 @@ export function add(data) { export function del(ids) { return request({ - url: 'api/inspectionItemPoint', - method: 'delete', + url: 'api/inspectionItemPoint/delete', + method: 'post', data: ids }) } export function edit(data) { return request({ - url: 'api/inspectionItemPoint', - method: 'put', + url: 'api/inspectionItemPoint/update', + method: 'post', data }) } diff --git a/mes/qd/src/views/wms/masterdata_manage/ql/inspectionSchemeMst/ItemDialog.vue b/mes/qd/src/views/wms/masterdata_manage/ql/inspectionSchemeMst/ItemDialog.vue index c003b894..7fde2fe4 100644 --- a/mes/qd/src/views/wms/masterdata_manage/ql/inspectionSchemeMst/ItemDialog.vue +++ b/mes/qd/src/views/wms/masterdata_manage/ql/inspectionSchemeMst/ItemDialog.vue @@ -12,7 +12,7 @@ @@ -38,11 +38,9 @@ - + - - - - - + + - + 取 消 确 定 @@ -73,7 +70,7 @@ diff --git a/mes/qd/src/views/wms/masterdata_manage/ql/inspectionSchemeMst/index.vue b/mes/qd/src/views/wms/masterdata_manage/ql/inspectionSchemeMst/index.vue index 581b33bb..ea71a86a 100644 --- a/mes/qd/src/views/wms/masterdata_manage/ql/inspectionSchemeMst/index.vue +++ b/mes/qd/src/views/wms/masterdata_manage/ql/inspectionSchemeMst/index.vue @@ -12,7 +12,7 @@ > - +
- - - 质保项维护 - - - 工序自检项 - - - 理化项维护 - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - + - - - - - - - + + + + +