XiaoRuby
2023-09-08 9f87ca56f82c2352adbb7201a190ac944e6deeeb
MOM系统-9-08
已修改8个文件
42 ■■■■ 文件已修改
inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/controller/RawInspectController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/pojo/vo/RawInspectVo.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/OpinionService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/OpinionServiceImpl.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/InspectUnacceptedMapper.xml 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/OpinionMapper.xml 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
system-run/src/main/resources/application-dev.yml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/controller/InspectUnacceptedController.java
@@ -116,12 +116,11 @@
    @ApiOperation(value = "编辑意见-->确定按钮", tags = "QMS管理-->不合格品处置")
    @PostMapping("/addOpinion")
    public Result<?> updateOpinion(@RequestHeader("token") String token, @Validated @RequestBody List<Opinion> opinion) throws Exception {
        MyUtil.PrintLog(opinion.toString());
    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);
        opinionService.updateOpinion(id, opinion1);
        return Result.success("添加成功!");
    }
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/pojo/vo/RawInspectVo.java
@@ -72,7 +72,6 @@
    /**
     * 报检人(当前用户名)
     */
    @NotBlank(message = "报检人不能为空!")
    @JsonSerialize
    private String userName;
inspect-server/src/main/java/com/yuanchu/mom/service/OpinionService.java
@@ -30,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
@@ -10,6 +10,7 @@
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;
@@ -51,12 +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));
            i.setFillDate(new Date());
            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
@@ -73,7 +73,7 @@
    <!--不合格处置-->
    <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`
        i.`tell` opinions, s.user_name, DATE_FORMAT(i.`create_time`, '%Y-%m-%d') `date`, i.`deal_state`
        FROM inspect_unaccepted i
        LEFT JOIN
        (
@@ -112,7 +112,6 @@
                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
        <if test="state != null">
            AND i.`deal_state` = #{state}
inspect-server/src/main/resources/mapper/OpinionMapper.xml
@@ -7,6 +7,7 @@
        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">
@@ -32,11 +33,6 @@
                    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=")">
@@ -49,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>
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.218.113:3306/mom_ocean?useSSL=false&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
    url: jdbc:mysql://192.168.0.22: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.218.113
    host: 192.168.0.22
    # redis端口(默认为6379)
    port: 6379
    # redis访问密码(默认为空)