Merge remote-tracking branch 'origin/master'
| | |
| | | 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; |
| | |
| | | |
| | | @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管ç-->ä¸åæ ¼åå¤ç½®") |
| | |
| | | }) |
| | | @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)); |
| | | } |
| | | } |
| | |
| | | @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<>(); |
| | |
| | | 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; |
| | |
| | | */ |
| | | public interface OpinionMapper extends MyBaseMapper<Opinion> { |
| | | |
| | | List<Map<String, Object>> clickEditingTriggerQuery(Integer rawUnacceptedId); |
| | | List<UpdateInspectUnacceptedDto> clickEditingTriggerQuery(Integer rawUnacceptedId); |
| | | |
| | | Integer updateOpinion(List<Opinion> opinion); |
| | | |
| | |
| | | @TableId(type = IdType.AUTO) |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "0ï¼æåæ£éªåï¼åæåæ£éªåï¼1ï¼åæææ£éªå") |
| | | @ApiModelProperty(value = "1ï¼æåæ£éªåï¼2åæåæ£éªåï¼0ï¼åæææ£éªå") |
| | | private Integer type; |
| | | |
| | | /** |
| | |
| | | @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") |
| | |
| | | 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") |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | |
| | | /** |
| | | * æ¥æ£äººï¼å½åç¨æ·åï¼ |
| | | */ |
| | | @NotBlank(message = "æ¥æ£äººä¸è½ä¸ºç©º!") |
| | | @JsonSerialize |
| | | private String userName; |
| | | |
| | |
| | | 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; |
| | | |
| | | /** |
| | |
| | | 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; |
| | |
| | | public interface OpinionService extends IService<Opinion> { |
| | | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | List<Map<String, Object>> clickEditingTriggerQuery(Integer rawUnacceptedId); |
| | | List<UpdateInspectUnacceptedDto> clickEditingTriggerQuery(Integer rawUnacceptedId); |
| | | |
| | | /** |
| | | * æ¹éæ´æ°æè§ |
| | |
| | | * @return |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | Integer updateOpinion(String id, List<Opinion> opinion); |
| | | Integer updateOpinion(String id, List<?> opinion); |
| | | |
| | | /** |
| | | * æ¥çå¤ç½®æè§ |
| | |
| | | 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; |
| | | |
| | |
| | | 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++) { |
| | |
| | | } |
| | | |
| | | @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 |
| | |
| | | <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, |
| | |
| | | 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!=''"> |
| | | <if test="dealState!=null"> |
| | | and deal_state=#{dealState} |
| | | </if> |
| | | <if test="formTime!=null and formTime!=''"> |
| | |
| | | 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`, |
| | |
| | | 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}, '%') |
| | |
| | | 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, |
| | | 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 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 |
| | |
| | | <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> |
| | |
| | | <!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"> |
| | |
| | | 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> |