zss
2023-09-09 f9e06198cfbccf337b53c0fa6cb3404455ceb0ba
Merge remote-tracking branch 'origin/master'
已添加1个文件
已修改11个文件
170 ■■■■■ 文件已修改
inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/controller/RawInspectController.java 2 ●●● 补丁 | 查看 | 原始文档 | 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/pojo/vo/RawInspectVo.java 3 ●●●● 补丁 | 查看 | 原始文档 | 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 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/OpinionServiceImpl.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/InspectUnacceptedMapper.xml 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/OpinionMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java
@@ -8,7 +8,6 @@
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;
@@ -117,11 +116,12 @@
    @ApiOperation(value = "编辑意见-->确定按钮", tags = "QMS管理-->不合格品处置")
    @PostMapping("/addOpinion")
    public Result<?> updateOpinion(@RequestHeader("token") String token, @Validated @RequestBody List<Opinion> opinion) throws Exception {
    public Result<?> updateOpinion(@RequestHeader("token") String token, @RequestBody Map<String, Object> opinion) throws Exception {
        List<?> opinion1 = JackSonUtil.unmarshal(JackSonUtil.marshal(opinion.get("opinion")), List.class);
        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();
        opinionService.updateOpinion(id, opinion1);
        return Result.success("添加成功!");
    }
    @ApiOperation(value = "查看编辑意见", tags = "QMS管理-->不合格品处置")
@@ -140,15 +140,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/controller/RawInspectController.java
@@ -51,7 +51,7 @@
            @ApiImplicitParam(name = "insState", value = "检测状态(为空=全部)", dataTypeClass = Integer.class),
            @ApiImplicitParam(name = "name", value = "原材料名称", dataTypeClass = String.class)
    })
    @PostMapping("/selectRawInspectsList")
    @GetMapping("/selectRawInspectsList")
    public Result selectRawInspectsList(Integer pageSize, Integer countSize, String formTime, String code, Integer insState, String name) {
        IPage<Map<String, Object>> page = rawInspectService.selectRawInspectsList(new Page<Object>(pageSize, countSize), formTime, code, insState, name);
        Map<String, Object> map = new HashMap<>();
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/pojo/vo/RawInspectVo.java
@@ -17,7 +17,7 @@
@Data
//新增原材料检验单参数
public class RawInspectVo implements Serializable {
    /* æ£€éªŒè¯¦æƒ… */
    /**
     * æ¥æ–™æ—¥æœŸ
@@ -72,7 +72,6 @@
    /**
     * æŠ¥æ£€äººï¼ˆå½“前用户名)
     */
    @NotBlank(message = "报检人不能为空!")
    @JsonSerialize
    private String userName;
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);
    /**
     * æ‰¹é‡æ›´æ–°æ„è§
@@ -29,7 +30,7 @@
     * @return
     */
    @Transactional(rollbackFor = Exception.class)
    Integer updateOpinion(String id, List<Opinion> opinion);
    Integer updateOpinion(String id, List<?> opinion);
    /**
     * æŸ¥çœ‹å¤„置意见
inspect-server/src/main/java/com/yuanchu/mom/service/impl/OpinionServiceImpl.java
@@ -7,13 +7,16 @@
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.JackSonUtil;
import com.yuanchu.mom.utils.MyUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
@@ -32,8 +35,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++) {
@@ -49,11 +52,19 @@
    }
    @Override
    public Integer updateOpinion(String id, List<Opinion> opinion) {
    public Integer updateOpinion(String id, List<?> opinion) {
        List<Opinion> list = new ArrayList<>();
        opinion.forEach(i -> {
            i.setUserId(Integer.valueOf(id));
            try {
                Opinion unmarshal = JackSonUtil.unmarshal(JackSonUtil.marshal(i), Opinion.class);
                unmarshal.setUserId(Integer.valueOf(id));
                unmarshal.setFillDate(new Date());
                list.add(unmarshal);
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        });
        return opinionMapper.updateOpinion(opinion);
        return opinionMapper.updateOpinion(list);
    }
    @Override
inspect-server/src/main/resources/mapper/InspectUnacceptedMapper.xml
@@ -3,33 +3,7 @@
<mapper namespace="com.yuanchu.mom.mapper.InspectUnacceptedMapper">
    <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,
@@ -44,16 +18,16 @@
        u.name,
        deal_state,
        deal_reasult,
        DATE_FORMAT(deal_time, '%Y-%m-%d') processingDate
        FROM (mom_ocean.inspect_unaccepted ru,
        mom_ocean.`user` u)
        LEFT JOIN mom_ocean.finished_inspect fi ON fi.`id` = ru.`raw_inspect_id`
        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`
        where fi.id = ru.raw_inspect_id
        AND ru.type = 1
        AND ru.state=1
        AND fi.`user_id` = u.`id`
        <if test="dealState!=null and dealState!=''">
            and deal_state=#{dealState}
        <if test="dealState!=null">
            and deal_state = #{dealState}
        </if>
        <if test="formTime!=null and formTime!=''">
            and fi.create_time=#{formTime}
@@ -61,9 +35,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`,
@@ -81,7 +56,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}, '%')
@@ -95,22 +70,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,
             (
            SELECT 2 AS `type`, r.`name`, r.`specifications`, r.`number`, r.`id`, r.`user_name`, 0 AS classify
        i.`tell` opinions, s.user_name, DATE_FORMAT(i.`create_time`, '%Y-%m-%d') `date`, i.`deal_state`
        FROM inspect_unaccepted i
        LEFT JOIN
        (
            -- åŽŸææ–™
            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
@@ -120,16 +99,26 @@
            <if test="productName != null and productName != ''">
                AND f.`project_name` LIKE CONCAT('%', #{productName}, '%')
            </if>
        ) AS s)
                 LEFT JOIN opinion o ON i.`id` = o.`raw_unaccepted_id`
            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
        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,11 +2,12 @@
<!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}
        ORDER BY o.`type`
    </select>
    <update id="updateOpinion" parameterType="integer">
@@ -44,5 +45,6 @@
        FROM opinion o
                 LEFT JOIN `user` u ON o.`user_id` = u.`id`
        WHERE o.raw_unaccepted_id = #{rawUnacceptedId}
        ORDER BY o.type
    </select>
</mapper>