XiaoRuby
2023-09-07 b4332231c22b9c362e14def25525d8c72735bc8c
MOM系统-9-07
已添加1个文件
已修改10个文件
141 ■■■■■ 文件已修改
inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/mapper/OpinionMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/pojo/InspectUnaccepted.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/pojo/Opinion.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/pojo/dto/UpdateInspectUnacceptedDto.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/InspectUnacceptedService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/OpinionService.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/OpinionServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/InspectUnacceptedMapper.xml 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/OpinionMapper.xml 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
system-run/src/main/resources/application-dev.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java
@@ -8,9 +8,7 @@
import com.yuanchu.mom.utils.JackSonUtil;
import com.yuanchu.mom.utils.Jwt;
import com.yuanchu.mom.utils.MyUtil;
import com.yuanchu.mom.utils.RedisUtil;
import com.yuanchu.mom.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
@@ -117,10 +115,12 @@
    @ApiOperation(value = "编辑意见-->确定按钮", tags = "QMS管理-->不合格品处置")
    @PostMapping("/addOpinion")
    public Result<?> updateOpinion(@RequestHeader("token") String token, @Validated @RequestBody List<Opinion> opinion) throws Exception {
        MyUtil.PrintLog(opinion.toString());
        Map<String, String> data = JackSonUtil.unmarshal(jwt.readJWT(token).get("data"), Map.class);
        String id = data.get("id").replaceAll("\"", "");
        opinionService.updateOpinion(id, opinion);
        return Result.success();
        return Result.success("添加成功!");
    }
    @ApiOperation(value = "查看编辑意见", tags = "QMS管理-->不合格品处置")
@@ -139,15 +139,19 @@
    })
    @GetMapping("/descriptionUpdate")
    public Result<?> descriptionUpdate(Integer rawUnacceptedId, String tell) {
        return Result.success(inspectUnacceptedService.descriptionUpdate(rawUnacceptedId, tell));
        Integer isUpdateSuccess = inspectUnacceptedService.descriptionUpdate(rawUnacceptedId, tell);
        if (isUpdateSuccess == 1) {
            return Result.success("更新成功");
        }
        return Result.fail("更新失败");
    }
    @ApiOperation(value = "点击编辑意见触发查询", tags = "QMS管理-->不合格品处置")
    @ApiImplicitParams(value = {
            @ApiImplicitParam(name = "rawUnacceptedId",value = "不合格品处置Id",dataTypeClass  = Integer.class,required = true)
    })
    @PostMapping("/clickEditing")
    public Result<?> clickEditingTriggerQuery(Integer rawUnacceptedId) {
    @GetMapping("/clickEditing")
    public Result<?> clickEditingTriggerQuery(@RequestParam("rawUnacceptedId") Integer rawUnacceptedId) {
        return Result.success(opinionService.clickEditingTriggerQuery(rawUnacceptedId));
    }
}
inspect-server/src/main/java/com/yuanchu/mom/mapper/OpinionMapper.java
@@ -3,6 +3,7 @@
import com.yuanchu.mom.mybatis_config.MyBaseMapper;
import com.yuanchu.mom.pojo.Opinion;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuanchu.mom.pojo.dto.UpdateInspectUnacceptedDto;
import java.util.List;
import java.util.Map;
@@ -17,7 +18,7 @@
 */
public interface OpinionMapper extends MyBaseMapper<Opinion> {
    List<Map<String, Object>> clickEditingTriggerQuery(Integer rawUnacceptedId);
    List<UpdateInspectUnacceptedDto> clickEditingTriggerQuery(Integer rawUnacceptedId);
    Integer updateOpinion(List<Opinion> opinion);
inspect-server/src/main/java/com/yuanchu/mom/pojo/InspectUnaccepted.java
@@ -32,7 +32,7 @@
    @TableId(type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty(value = "0:成品检验单;半成品检验单;1:原材料检验单")
    @ApiModelProperty(value = "1:成品检验单;2半成品检验单;0:原材料检验单")
    private Integer type;
    /**
inspect-server/src/main/java/com/yuanchu/mom/pojo/Opinion.java
@@ -48,9 +48,9 @@
    @ApiModelProperty(value = "处理意见", required = true, example = "返工")
    private String tell;
    @NotBlank(message = "处理方式不能为空!")
    @ApiModelProperty(value = "处理方式:0:返工;1:返修;2:让步接收;3:拒收;4:降级使用;5:报废", required = true, example = "返工")
    private String way;
    @NotNull(message = "处理方式不能为空!")
    @ApiModelProperty(value = "处理方式:0:返工;1:返修;2:让步接收;3:拒收;4:降级使用;5:报废", required = true, example = "0")
    private Integer way;
    @ApiModelProperty(value = "逻辑删除", hidden = true)
    @TableLogic(value = "1", delval = "0")
@@ -69,7 +69,7 @@
    private Date updateTime;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @ApiModelProperty(value = "填写日期", required = true, example = "2023-09-05", dataType = "date")
    @ApiModelProperty(value = "填写日期", hidden = true, example = "2023-09-05", dataType = "date")
    private Date fillDate;
    @ApiModelProperty(value = "填写人Id", hidden = true, example = "1")
inspect-server/src/main/java/com/yuanchu/mom/pojo/dto/UpdateInspectUnacceptedDto.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,15 @@
package com.yuanchu.mom.pojo.dto;
import lombok.Data;
@Data
public class UpdateInspectUnacceptedDto {
    private Integer id;
    private String tell;
    private String type;
    private Integer way;
}
inspect-server/src/main/java/com/yuanchu/mom/service/InspectUnacceptedService.java
@@ -4,9 +4,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yuanchu.mom.pojo.InspectUnaccepted;
import com.yuanchu.mom.pojo.Opinion;
import java.util.List;
import java.util.Map;
/**
inspect-server/src/main/java/com/yuanchu/mom/service/OpinionService.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.pojo.Opinion;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yuanchu.mom.pojo.dto.UpdateInspectUnacceptedDto;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@@ -20,7 +21,7 @@
public interface OpinionService extends IService<Opinion> {
    @Transactional(rollbackFor = Exception.class)
    List<Map<String, Object>> clickEditingTriggerQuery(Integer rawUnacceptedId);
    List<UpdateInspectUnacceptedDto> clickEditingTriggerQuery(Integer rawUnacceptedId);
    /**
     * æ‰¹é‡æ›´æ–°æ„è§
inspect-server/src/main/java/com/yuanchu/mom/service/impl/OpinionServiceImpl.java
@@ -7,6 +7,7 @@
import com.yuanchu.mom.pojo.InspectUnaccepted;
import com.yuanchu.mom.pojo.Opinion;
import com.yuanchu.mom.mapper.OpinionMapper;
import com.yuanchu.mom.pojo.dto.UpdateInspectUnacceptedDto;
import com.yuanchu.mom.service.OpinionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.mom.utils.MyUtil;
@@ -14,6 +15,7 @@
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -32,8 +34,8 @@
    private OpinionMapper opinionMapper;
    @Override
    public List<Map<String, Object>> clickEditingTriggerQuery(Integer rawUnacceptedId) {
        List<Map<String, Object>> mapList = opinionMapper.clickEditingTriggerQuery(rawUnacceptedId);
    public List<UpdateInspectUnacceptedDto> clickEditingTriggerQuery(Integer rawUnacceptedId) {
        List<UpdateInspectUnacceptedDto> mapList = opinionMapper.clickEditingTriggerQuery(rawUnacceptedId);
        if (mapList.size() == 0) {
            List<Opinion> list = new ArrayList<>();
            for (int i = 0; i <= 3; i++) {
@@ -52,6 +54,7 @@
    public Integer updateOpinion(String id, List<Opinion> opinion) {
        opinion.forEach(i -> {
            i.setUserId(Integer.valueOf(id));
            i.setFillDate(new Date());
        });
        return opinionMapper.updateOpinion(opinion);
    }
inspect-server/src/main/resources/mapper/InspectUnacceptedMapper.xml
@@ -16,33 +16,7 @@
          and type = 0
    </update>
    <select id="selectUnRawInspectsList" resultType="java.util.Map">
        select ru.id,
        DATE_FORMAT(form_time, '%Y-%m-%d') '来料日期',
        reason,
        code,
        name,
        specifications,
        unit,
        number,
        DATE_FORMAT(ri.create_time, '%Y-%m-%d') '报检日期',
        user_name,
        DATE_FORMAT(ins_time, '%Y-%m-%d') '检验日期',
        deal_state,
        deal_reasult,
        DATE_FORMAT(deal_time, '%Y-%m-%d') '处理日期'
        from mom_ocean.raw_inspect ri inner join mom_ocean.inspect_unaccepted ru on ri.id = ru.raw_inspect_id
        <where>
            <if test="dealState!=null and dealState!=''">
                and deal_state=#{dealState}
            </if>
            <if test="formTime!=null and formTime!=''">
                and form_time=#{formTime}
            </if>
            and ru.state=1
        </where>
        order by ru.id desc
    </select>
    <!--不合格管理-->
    <select id="selectInsList" resultType="java.util.Map">
        SELECT ru.id,
        DATE_FORMAT(fi.create_time, '%Y-%m-%d') dateArrival,
@@ -57,7 +31,7 @@
        u.name,
        deal_state,
        deal_reasult,
        DATE_FORMAT(deal_time, '%Y-%m-%d') processingDate
        DATE_FORMAT(fi.update_time, '%Y-%m-%d') processingDate
        FROM (inspect_unaccepted ru,
        `user` u)
        LEFT JOIN finished_inspect fi ON fi.`id` = ru.`raw_inspect_id`
@@ -65,7 +39,7 @@
        AND ru.type = 1
        AND ru.state=1
        AND fi.`user_id` = u.`id`
        <if test="dealState!=null and dealState!=''">
        <if test="dealState!=null">
            and deal_state=#{dealState}
        </if>
        <if test="formTime!=null and formTime!=''">
@@ -74,9 +48,10 @@
        order by ru.id desc
    </select>
    <!--原材料不合格-->
    <select id="selectUnqualifiedRawMaterials" resultType="map">
        SELECT i.id,
               DATE_FORMAT(r.create_time, '%Y-%m-%d') dateArrival,
               DATE_FORMAT(r.form_time, '%Y-%m-%d') dateArrival,
               i.`reason`,
               r.`code`,
               r.`name`,
@@ -94,7 +69,7 @@
        WHERE i.`state` = 1
          AND i.`type` = 0
        <if test="formTime != null and formTime != ''">
            AND r.create_time = #{formTime}
            AND r.form_time = #{formTime}
        </if>
        <if test="productName != null and productName != ''">
            AND r.name LIKE CONCAT('%', #{productName}, '%')
@@ -108,22 +83,26 @@
        ORDER BY i.`id` DESC
    </select>
    <!--不合格处置-->
    <select id="selectDisposal" resultType="map">
        SELECT i.`id`, s.`type`, s.name productName, s.`specifications`, s.number, i.`tell` description,
               o.`tell` opinions, s.user_name, DATE_FORMAT(i.`create_time`, '%Y-%m-%d') `date`, i.`deal_state`
        FROM (inspect_unaccepted i,
        FROM inspect_unaccepted i
        LEFT JOIN
             (
            SELECT 2 AS `type`, r.`name`, r.`specifications`, r.`number`, r.`id`, r.`user_name`, 0 AS classify
            -- åŽŸææ–™
            SELECT 0 AS `type`, r.`name`, r.`specifications`, r.`number`, r.`id`, r.`user_name`
            FROM raw_inspect r
            WHERE r.state = 1
            <if test="specificationModel != null and specificationModel != ''">
                AND r.`specifications` LIKE CONCAT('%', #{specificationModel}, '%')
            <if test="specificationModel != null and specificationModel != ''">AND r.`specifications` LIKE CONCAT('%',
                #{specificationModel}, '%')
            </if>
            <if test="productName != null and productName != ''">
                AND r.`name` LIKE CONCAT('%', #{productName}, '%')
            <if test="
            productName != null and productName != ''">AND r.`name` LIKE CONCAT('%', #{productName}, '%')
            </if>
            UNION ALL
            SELECT f.`type`, f.`project_name` `name`, f.`specifications_model` specifications, f.`quantity` number, f.`id`, u.name user_name, 1 AS classify
            -- æˆå“
            SELECT 1 AS `type`, f.`project_name` `name`, f.`specifications_model` specifications, f.`quantity` `number`, f.`id`, u.name user_name
            FROM finished_inspect f, `user` u
            WHERE f.`state` = 1
              AND u.id = f.user_id
@@ -133,16 +112,27 @@
            <if test="productName != null and productName != ''">
                AND f.`project_name` LIKE CONCAT('%', #{productName}, '%')
            </if>
        ) AS s)
            UNION ALL
            -- åŠæˆå“
            SELECT 2 AS `type`, p.`material` `name`, p.`specifications_model` specifications, p.`quantity` `number`, p.`id`, u.name user_name
            FROM process_inspect p, `user` u
            WHERE p.state = 1
                AND u.id = p.user_id
            <if test="specificationModel != null and specificationModel != ''">
                AND p.`specifications_model` LIKE CONCAT('%', #{specificationModel}, '%')
            </if>
            <if test="productName != null and productName != ''">
                AND p.`material` LIKE CONCAT('%', #{productName}, '%')
            </if>
         )AS s ON s.`id` = i.`raw_inspect_id` AND s.`type` = i.type
                 LEFT JOIN opinion o ON i.`id` = o.`raw_unaccepted_id`
        WHERE i.`state` = 1
            AND i.`type` = s.`classify`
            AND s.`id` = i.`raw_inspect_id`
        <if test="state != null">
            AND i.`deal_state` = #{state}
        </if>
        <if test="productCategories != null">
            AND s.`type` = #{productCategories}
        </if>
        ORDER BY i.id DESC
    </select>
</mapper>
inspect-server/src/main/resources/mapper/OpinionMapper.xml
@@ -2,8 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yuanchu.mom.mapper.OpinionMapper">
    <select id="clickEditingTriggerQuery" resultType="map">
        SELECT o.`id`, o.`tell`, o.`type`, o.`way`, o.`fill_date`
    <select id="clickEditingTriggerQuery" resultType="updateInspectUnacceptedDto">
        SELECT o.`id`, o.`tell`, o.`type`, o.`way`
        FROM opinion o
                 LEFT JOIN `user` u ON o.`user_id` = u.`id`
        WHERE o.`raw_unaccepted_id` = #{rawUnacceptedId}
@@ -32,6 +32,11 @@
                    WHEN o.id = #{item.id} THEN #{item.userId}
                </foreach>
            </trim>
            <trim prefix="raw_unaccepted_id=case" suffix="end,">
                <foreach collection="list" item="item" index="index">
                    WHEN o.id = #{item.id} THEN #{item.rawUnacceptedId}
                </foreach>
            </trim>
        </trim>
        WHERE o.id in
        <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
system-run/src/main/resources/application-dev.yml
@@ -34,7 +34,7 @@
  datasource:
    type: com.alibaba.druid.pool.DruidDataSource
    driverClassName: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://192.168.65.113:3306/mom_ocean?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
    url: jdbc:mysql://192.168.218.113:3306/mom_ocean?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
    username: user
    password: 123456
    druid:
@@ -59,7 +59,7 @@
    # redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突
    database: 0
    # redis服务器地址(默认为localhost)
    host: 192.168.65.113
    host: 192.168.218.113
    # redis端口(默认为6379)
    port: 6379
    # redis访问密码(默认为空)