| | |
| | | |
| | | @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("添加成功!"); |
| | | } |
| | | |
| | |
| | | @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<>(); |
| | |
| | | @Data |
| | | //新增原材料检验单参数 |
| | | public class RawInspectVo implements Serializable { |
| | | |
| | | |
| | | /* 检验详情 */ |
| | | /** |
| | | * 来料日期 |
| | |
| | | /** |
| | | * 报检人(当前用户名) |
| | | */ |
| | | @NotBlank(message = "报检人不能为空!") |
| | | @JsonSerialize |
| | | private String userName; |
| | | |
| | |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | Integer updateOpinion(String id, List<Opinion> opinion); |
| | | Integer updateOpinion(String id, List<?> opinion); |
| | | |
| | | /** |
| | | * 查看处置意见 |
| | |
| | | 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; |
| | | |
| | |
| | | } |
| | | |
| | | @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 |
| | |
| | | <!--不合格处置--> |
| | | <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 |
| | | ( |
| | |
| | | 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} |
| | |
| | | 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"> |
| | |
| | | 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=")"> |
| | |
| | | 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> |
| | |
| | | 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: |
| | |
| | | # redis数据库索引(默认为0),我们使用索引为3的数据库,避免和其他数据库冲突 |
| | | database: 0 |
| | | # redis服务器地址(默认为localhost) |
| | | host: 192.168.218.113 |
| | | host: 192.168.0.22 |
| | | # redis端口(默认为6379) |
| | | port: 6379 |
| | | # redis访问密码(默认为空) |