| | |
| | | return service.getSopInfo(list,code,model,pageCurr,pageSize); |
| | | } |
| | | |
| | | @ApiOperation("查询sop历史") |
| | | @GetMapping("getSopHis") |
| | | public Response getSopHis(@RequestParam(required = false) String fileName) { |
| | | return service.getSopHis(fileName); |
| | | } |
| | | |
| | | @ApiOperation("更新sop说明(不含锁信息)") |
| | | @PostMapping("updateSop") |
| | | public Response updateSop(@RequestBody SOP sop) { |
| | |
| | | package com.whyc.controller; |
| | | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.pojo.SOP; |
| | | import com.whyc.service.SOPLockLogService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RequestMapping("sopLockLog") |
| | | @RestController |
| | |
| | | |
| | | @Autowired |
| | | private SOPLockLogService service; |
| | | |
| | | @ApiOperation("查询指定sop的日志记录") |
| | | @GetMapping("getSopLockLog") |
| | | public Response getSopLockLog(@RequestParam int sopId) { |
| | | return service.getSopLockLog(sopId); |
| | | } |
| | | } |
| | |
| | | |
| | | //查询sop信息 |
| | | List<SOP> getSopInfo(@Param("sqlStr") String sqlStr, @Param("code") String code, @Param("model") String model); |
| | | //查询sop历史 |
| | | List<SOP> getSopHis(@Param("fileName") String fileName); |
| | | } |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.mapper.SOPLockLogMapper; |
| | | import com.whyc.pojo.SOPLockLog; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class SOPLockLogService { |
| | |
| | | public void insert(SOPLockLog lockLog) { |
| | | mapper.insert(lockLog); |
| | | } |
| | | |
| | | |
| | | //查询指定sop的日志记录 |
| | | public Response getSopLockLog(int sopId) { |
| | | QueryWrapper wrapper= Wrappers.query(); |
| | | wrapper.eq("sop_id",sopId); |
| | | wrapper.orderByDesc("create_time"); |
| | | List list=mapper.selectList(wrapper); |
| | | return new Response().setII(1,list.size()>0,list,"查询指定sop的日志记录"); |
| | | } |
| | | } |
| | |
| | | |
| | | return new Response().setII(1,"设置完成"); |
| | | } |
| | | //查询sop历史 |
| | | public Response getSopHis(String fileName) { |
| | | List<SOP> list=mapper.getSopHis(fileName); |
| | | return new Response().setII(1,list.size()>0,list,"查询sop历史"); |
| | | } |
| | | } |
| | |
| | | ${sqlStr} |
| | | </where> |
| | | </select> |
| | | <select id="getSopHis" resultMap="sopList"> |
| | | select tb_sop.*,tb_sop_product.id as pId ,code,model,sop_id from tb_sop |
| | | LEFT JOIN tb_sop_product on tb_sop.id=tb_sop_product.sop_id |
| | | <where> |
| | | tb_sop.file_name like '%${fileName}%' |
| | | </where> |
| | | order by tb_sop.id asc |
| | | </select> |
| | | </mapper> |