| basic-server/doc/质量管理.sql | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| basic-server/src/main/java/com/ruoyi/basic/controller/QualityDefectiveProductController.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| basic-server/src/main/java/com/ruoyi/basic/dto/DefectiveProductAuditDto.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| basic-server/src/main/java/com/ruoyi/basic/dto/DefectiveProductDto.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| basic-server/src/main/java/com/ruoyi/basic/mapper/QualityDefectiveProductMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| basic-server/src/main/java/com/ruoyi/basic/pojo/QualityDefectiveProduct.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| basic-server/src/main/java/com/ruoyi/basic/service/QualityDefectiveProductService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| basic-server/src/main/java/com/ruoyi/basic/service/impl/QualityDefectiveProductServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| basic-server/src/main/resources/mapper/QualityDefectiveProductMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
basic-server/doc/ÖÊÁ¿¹ÜÀí.sql
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,25 @@ CREATE TABLE `quality_defective_product` ( `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT '主é®', `report_no` VARCHAR(100) DEFAULT NULL COMMENT 'æ¥åç¼å·', `product_name` VARCHAR(200) DEFAULT NULL COMMENT '产ååç§°', `production_batch` VARCHAR(100) DEFAULT NULL COMMENT 'çäº§æ¹æ¬¡', `material_name` VARCHAR(200) DEFAULT NULL COMMENT 'ç©æåç§°', `specs_models` VARCHAR(200) DEFAULT NULL COMMENT 'è§æ ¼åå·', `manufacturer` VARCHAR(200) DEFAULT NULL COMMENT 'ç产åå®¶', `raw_material_info` TEXT DEFAULT NULL COMMENT 'åææä¿¡æ¯', `defective_qty` INT DEFAULT NULL COMMENT 'ä¸è¯åæ°é', `related_test_info` TEXT DEFAULT NULL COMMENT 'å ³èæ£æµä¿¡æ¯', `unqualified_desc` TEXT DEFAULT NULL COMMENT 'ä¸åæ ¼æè¿°', `inspector` VARCHAR(100) DEFAULT NULL COMMENT 'æ£éªäººå', `register_by` VARCHAR(100) DEFAULT NULL COMMENT 'ç»è®°äºº', `register_time` DATETIME DEFAULT NULL COMMENT 'ç»è®°æ¶é´', `audit_status` TINYINT DEFAULT '0' COMMENT 'å®¡æ ¸ç¶æï¼0-å¾ å®¡æ ¸ï¼1-å·²å®¡æ ¸', `audit_remark` TEXT DEFAULT NULL COMMENT 'å®¡æ ¸æè§', `audit_by` VARCHAR(100) DEFAULT NULL COMMENT 'å®¡æ ¸äºº', `audit_time` DATETIME DEFAULT NULL COMMENT 'å®¡æ ¸æ¶é´', `create_by` VARCHAR(100) DEFAULT NULL COMMENT 'å建人', `update_by` VARCHAR(100) DEFAULT NULL COMMENT 'ä¿®æ¹äºº', `create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT 'å建æ¶é´', `update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'æ´æ°æ¶é´', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='ä¸è¯åç»è®°è¡¨'; basic-server/src/main/java/com/ruoyi/basic/controller/QualityDefectiveProductController.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,99 @@ package com.ruoyi.basic.controller; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.core.domain.Result; import com.ruoyi.basic.dto.DefectiveProductAuditDto; import com.ruoyi.basic.dto.DefectiveProductDto; import com.ruoyi.basic.pojo.QualityDefectiveProduct; import com.ruoyi.basic.service.QualityDefectiveProductService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; /** * ä¸è¯åç»è®°æ§å¶å¨ */ @Api(tags = "ä¸è¯åç»è®°") @RestController @RequestMapping("/quality/defectiveProduct") public class QualityDefectiveProductController { @Resource private QualityDefectiveProductService defectiveProductService; /** * æ¥è¯¢ä¸è¯åç»è®°å表 */ @ApiOperation(value = "æ¥è¯¢ä¸è¯åç»è®°å表") @GetMapping("/list") public Result<IPage<QualityDefectiveProduct>> pageDefectiveProduct(Page<QualityDefectiveProduct> page, QualityDefectiveProduct query) { return Result.success(defectiveProductService.selectPage(page, query)); } /** * è·åä¸è¯å详æ */ @ApiOperation(value = "è·åä¸è¯å详æ ") @GetMapping("/get") public Result<QualityDefectiveProduct> getDefectiveProduct(Long id) { return Result.success(defectiveProductService.selectById(id)); } /** * æ°å¢ä¸è¯åç»è®° */ @ApiOperation(value = "æ°å¢ä¸è¯åç»è®°") @PostMapping public Result<Integer> addDefectiveProduct(@RequestBody DefectiveProductDto data) { return Result.success(defectiveProductService.insert(data)); } /** * ä¿®æ¹ä¸è¯åç»è®° */ @ApiOperation(value = "ä¿®æ¹ä¸è¯åç»è®°") @PostMapping("/update") public Result<Integer> updateDefectiveProduct(@RequestBody QualityDefectiveProduct data) { return Result.success(defectiveProductService.update(data)); } /** * å é¤ä¸è¯åç»è®°ï¼æ¯ææ¹éå é¤ï¼ */ @ApiOperation(value = "å é¤ä¸è¯åç»è®°") @DeleteMapping("/delete") public Result<Integer> deleteDefectiveProduct(Long[] ids) { if (ids == null || ids.length == 0) { return Result.fail("è¯·éæ©è¦å é¤çè®°å½"); } if (ids.length == 1) { return Result.success(defectiveProductService.deleteById(ids[0])); } return Result.success(defectiveProductService.deleteBatchIds(ids)); } /** * æ¥è¯¢ä¸è¯åå®¡æ ¸å表 */ @ApiOperation(value = "æ¥è¯¢ä¸è¯åå®¡æ ¸å表") @GetMapping("/audit/page") public Result<IPage<QualityDefectiveProduct>> pageDefectiveProductAudit(Page<QualityDefectiveProduct> page, QualityDefectiveProduct query) { // å®¡æ ¸å表é»è®¤åªæ¥è¯¢å¾ å®¡æ ¸ç¶æ if (query.getAuditStatus() == null) { query.setAuditStatus(0); } return Result.success(defectiveProductService.selectPage(page, query)); } /** * ä¸è¯åå®¡æ ¸ */ @ApiOperation(value = "ä¸è¯åå®¡æ ¸") @PostMapping("/audit") public Result<Integer> auditDefectiveProduct(@RequestBody DefectiveProductAuditDto data) { return Result.success(defectiveProductService.audit(data)); } } basic-server/src/main/java/com/ruoyi/basic/dto/DefectiveProductAuditDto.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,20 @@ package com.ruoyi.basic.dto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * ä¸è¯åå®¡æ ¸DTO */ @Data public class DefectiveProductAuditDto { @ApiModelProperty(value = "主é®ID") private Long id; @ApiModelProperty(value = "å®¡æ ¸ç¶æï¼0-å¾ å®¡æ ¸ï¼1-å·²å®¡æ ¸") private Integer auditStatus; @ApiModelProperty(value = "å®¡æ ¸æè§") private String auditRemark; } basic-server/src/main/java/com/ruoyi/basic/dto/DefectiveProductDto.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,44 @@ package com.ruoyi.basic.dto; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * ä¸è¯åç»è®°DTO */ @Data public class DefectiveProductDto { @ApiModelProperty(value = "æ¥åç¼å·") private String reportNo; @ApiModelProperty(value = "产ååç§°") private String productName; @ApiModelProperty(value = "çäº§æ¹æ¬¡") private String productionBatch; @ApiModelProperty(value = "ç©æåç§°") private String materialName; @ApiModelProperty(value = "è§æ ¼åå·") private String specsModels; @ApiModelProperty(value = "ç产åå®¶") private String manufacturer; @ApiModelProperty(value = "åææä¿¡æ¯") private String rawMaterialInfo; @ApiModelProperty(value = "ä¸è¯åæ°é") private Integer defectiveQty; @ApiModelProperty(value = "å ³èæ£æµä¿¡æ¯") private String relatedTestInfo; @ApiModelProperty(value = "ä¸åæ ¼æè¿°") private String unqualifiedDesc; @ApiModelProperty(value = "æ£éªäººå") private String inspector; } basic-server/src/main/java/com/ruoyi/basic/mapper/QualityDefectiveProductMapper.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,16 @@ package com.ruoyi.basic.mapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.basic.pojo.QualityDefectiveProduct; import org.apache.ibatis.annotations.Param; /** * ä¸è¯åç»è®°Mapperæ¥å£ */ public interface QualityDefectiveProductMapper extends BaseMapper<QualityDefectiveProduct> { IPage<QualityDefectiveProduct> selectPage(Page<QualityDefectiveProduct> page, @Param("ew") QueryWrapper<QualityDefectiveProduct> ew); } basic-server/src/main/java/com/ruoyi/basic/pojo/QualityDefectiveProduct.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,88 @@ package com.ruoyi.basic.pojo; import com.baomidou.mybatisplus.annotation.*; import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; import java.time.LocalDateTime; /** * ä¸è¯åç»è®° * @TableName quality_defective_product */ @TableName(value ="quality_defective_product") @Data public class QualityDefectiveProduct implements Serializable { @TableId(type = IdType.AUTO) private Long id; @ApiModelProperty(value = "æ¥åç¼å·") private String reportNo; @ApiModelProperty(value = "产ååç§°") private String productName; @ApiModelProperty(value = "çäº§æ¹æ¬¡") private String productionBatch; @ApiModelProperty(value = "ç©æåç§°") private String materialName; @ApiModelProperty(value = "è§æ ¼åå·") private String specsModels; @ApiModelProperty(value = "ç产åå®¶") private String manufacturer; @ApiModelProperty(value = "åææä¿¡æ¯") private String rawMaterialInfo; @ApiModelProperty(value = "ä¸è¯åæ°é") private Integer defectiveQty; @ApiModelProperty(value = "å ³èæ£æµä¿¡æ¯") private String relatedTestInfo; @ApiModelProperty(value = "ä¸åæ ¼æè¿°") private String unqualifiedDesc; @ApiModelProperty(value = "æ£éªäººå") private String inspector; @ApiModelProperty(value = "ç»è®°äºº") private String registerBy; @ApiModelProperty(value = "ç»è®°æ¶é´") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime registerTime; @ApiModelProperty(value = "å®¡æ ¸ç¶æï¼0-å¾ å®¡æ ¸ï¼1-å®¡æ ¸éè¿ï¼2-驳å") private Integer auditStatus; @ApiModelProperty(value = "å®¡æ ¸æè§") private String auditRemark; @ApiModelProperty(value = "å®¡æ ¸äºº") private String auditBy; @ApiModelProperty(value = "å®¡æ ¸æ¶é´") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime auditTime; @ApiModelProperty(value = "å建人") private String createBy; @ApiModelProperty(value = "ä¿®æ¹äºº") private String updateBy; @ApiModelProperty(value = "å建æ¶é´") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime createTime; @ApiModelProperty(value = "æ´æ°æ¶é´") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime updateTime; } basic-server/src/main/java/com/ruoyi/basic/service/QualityDefectiveProductService.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,33 @@ package com.ruoyi.basic.service; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.basic.dto.DefectiveProductAuditDto; import com.ruoyi.basic.dto.DefectiveProductDto; import com.ruoyi.basic.pojo.QualityDefectiveProduct; import java.util.List; /** * ä¸è¯åç»è®°Serviceæ¥å£ */ public interface QualityDefectiveProductService { IPage<QualityDefectiveProduct> selectPage(Page<QualityDefectiveProduct> page, QualityDefectiveProduct entity); QualityDefectiveProduct selectById(Long id); int insert(DefectiveProductDto dto); int update(Long id, DefectiveProductDto dto); int update(QualityDefectiveProduct entity); int deleteById(Long id); int deleteBatchIds(Long[] ids); int audit(DefectiveProductAuditDto auditDto); List<QualityDefectiveProduct> selectList(); } basic-server/src/main/java/com/ruoyi/basic/service/impl/QualityDefectiveProductServiceImpl.java
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,121 @@ package com.ruoyi.basic.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.ruoyi.common.utils.QueryWrappers; import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.basic.dto.DefectiveProductAuditDto; import com.ruoyi.basic.dto.DefectiveProductDto; import com.ruoyi.basic.mapper.QualityDefectiveProductMapper; import com.ruoyi.basic.pojo.QualityDefectiveProduct; import com.ruoyi.basic.service.QualityDefectiveProductService; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.time.LocalDateTime; import java.util.List; /** * ä¸è¯åç»è®°Serviceå®ç°ç±» */ @Service public class QualityDefectiveProductServiceImpl implements QualityDefectiveProductService { @Resource private QualityDefectiveProductMapper defectiveProductMapper; @Override public IPage<QualityDefectiveProduct> selectPage(Page<QualityDefectiveProduct> page, QualityDefectiveProduct entity) { return defectiveProductMapper.selectPage(page, QueryWrappers.queryWrappers(entity)); } @Override public QualityDefectiveProduct selectById(Long id) { return defectiveProductMapper.selectById(id); } @Override public int insert(DefectiveProductDto dto) { QualityDefectiveProduct entity = new QualityDefectiveProduct(); BeanUtils.copyProperties(dto, entity); // è·åå½åç»å½ç¨æ· String username = SecurityUtils.getUsername(); // 设置ç»è®°ç¸å ³å段 entity.setRegisterBy(username); entity.setRegisterTime(LocalDateTime.now()); // 设置å建ç¸å ³å段 entity.setCreateBy(username); entity.setCreateTime(LocalDateTime.now()); // è®¾ç½®æ´æ°ç¸å ³å段 entity.setUpdateBy(username); entity.setUpdateTime(LocalDateTime.now()); // è®¾ç½®å®¡æ ¸ç¶æä¸ºå¾ å®¡æ ¸ entity.setAuditStatus(0); return defectiveProductMapper.insert(entity); } @Override public int update(Long id, DefectiveProductDto dto) { QualityDefectiveProduct entity = defectiveProductMapper.selectById(id); if (entity == null) { throw new RuntimeException("ä¸è¯åä¿¡æ¯ä¸åå¨"); } BeanUtils.copyProperties(dto, entity); entity.setId(id); entity.setUpdateBy(SecurityUtils.getUsername()); entity.setUpdateTime(LocalDateTime.now()); return defectiveProductMapper.updateById(entity); } @Override public int update(QualityDefectiveProduct entity) { if (entity.getId() == null) { throw new RuntimeException("IDä¸è½ä¸ºç©º"); } entity.setUpdateBy(SecurityUtils.getUsername()); entity.setUpdateTime(LocalDateTime.now()); return defectiveProductMapper.updateById(entity); } @Override public int deleteById(Long id) { return defectiveProductMapper.deleteById(id); } @Override public int deleteBatchIds(Long[] ids) { return defectiveProductMapper.deleteBatchIds(java.util.Arrays.asList(ids)); } @Override public int audit(DefectiveProductAuditDto auditDto) { QualityDefectiveProduct entity = defectiveProductMapper.selectById(auditDto.getId()); if (entity == null) { throw new RuntimeException("ä¸è¯åä¿¡æ¯ä¸åå¨"); } entity.setAuditStatus(auditDto.getAuditStatus()); entity.setAuditRemark(auditDto.getAuditRemark()); entity.setAuditBy(SecurityUtils.getUsername()); entity.setAuditTime(LocalDateTime.now()); entity.setUpdateBy(SecurityUtils.getUsername()); entity.setUpdateTime(LocalDateTime.now()); return defectiveProductMapper.updateById(entity); } @Override public List<QualityDefectiveProduct> selectList() { return defectiveProductMapper.selectList(Wrappers.emptyWrapper()); } } basic-server/src/main/resources/mapper/QualityDefectiveProductMapper.xml
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,21 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.ruoyi.basic.mapper.QualityDefectiveProductMapper"> <select id="selectPage" resultType="com.ruoyi.basic.pojo.QualityDefectiveProduct"> SELECT id, report_no, product_name, production_batch, material_name, specs_models, manufacturer, raw_material_info, defective_qty, related_test_info, unqualified_desc, inspector, register_by, register_time, audit_status, audit_remark, audit_by, audit_time, create_by, update_by, create_time, update_time FROM quality_defective_product <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> ${ew.customSqlSegment} </if> ORDER BY create_time DESC </select> </mapper>