| | |
| | | import com.yuanchu.mom.pojo.Opinion; |
| | | import com.yuanchu.mom.mapper.OpinionMapper; |
| | | import com.yuanchu.mom.pojo.dto.UpdateInspectUnacceptedDto; |
| | | import com.yuanchu.mom.service.InspectUnacceptedService; |
| | | 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; |
| | | |
| | |
| | | @Resource |
| | | private OpinionMapper opinionMapper; |
| | | |
| | | @Resource |
| | | private InspectUnacceptedService inspectUnacceptedService; |
| | | |
| | | @Override |
| | | public List<UpdateInspectUnacceptedDto> clickEditingTriggerQuery(Integer rawUnacceptedId) { |
| | | List<UpdateInspectUnacceptedDto> mapList = opinionMapper.clickEditingTriggerQuery(rawUnacceptedId); |
| | |
| | | } |
| | | |
| | | @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); |
| | | MyUtil.PrintLog(list.get(1).getRawUnacceptedId().toString()); |
| | | return opinionMapper.updateOpinion(list); |
| | | } |
| | | |
| | | @Override |