| | |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.SopDto; |
| | | import com.whyc.pojo.SOP; |
| | | import com.whyc.pojo.SOPProduct; |
| | | import com.whyc.pojo.Software; |
| | | import com.whyc.service.SOPService; |
| | | import com.whyc.util.ActionUtil; |
| | |
| | | |
| | | import java.io.IOException; |
| | | import java.text.ParseException; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | |
| | | @ApiOperation("查询sop信息") |
| | | @PostMapping("getSopInfo") |
| | | public Response getSopInfo(@RequestBody(required = false) List<SopDto> list, @RequestParam(required = false) String code, @RequestParam(required = false) String model) { |
| | | return service.getSopInfo(list,code,model); |
| | | public Response getSopInfo(@RequestBody(required = false) List<SopDto> list |
| | | , @RequestParam(required = false) String code, @RequestParam(required = false) String model |
| | | , @RequestParam int pageCurr, @RequestParam int pageSize) { |
| | | return service.getSopInfo(list,code,model,pageCurr,pageSize); |
| | | } |
| | | |
| | | @ApiOperation("更新sop说明(不含锁信息)") |
| | |
| | | public Response updateSop(@RequestBody SOP sop) { |
| | | return service.updateSop(sop); |
| | | } |
| | | |
| | | } |
| | |
| | | private String uploadUser; |
| | | /**文件url*/ |
| | | private String fileUrl; |
| | | /**锁(0:未锁定,1:锁定)*/ |
| | | private int lockFlag; |
| | | |
| | | /**通用表示(0:非通用,1:通用)*/ |
| | | private int currentFlag; |
| | | |
| | | /** |
| | | * [ |
| | |
| | | this.fileTypeList = fileTypeList; |
| | | } |
| | | |
| | | public int getLockFlag() { |
| | | return lockFlag; |
| | | |
| | | public int getCurrentFlag() { |
| | | return currentFlag; |
| | | } |
| | | |
| | | public void setLockFlag(int lockFlag) { |
| | | this.lockFlag = lockFlag; |
| | | public void setCurrentFlag(int currentFlag) { |
| | | this.currentFlag = currentFlag; |
| | | } |
| | | } |
| | |
| | | /**sop id*/ |
| | | private Integer sopId; |
| | | |
| | | /**锁(0:未锁定,1:锁定)*/ |
| | | private int lockFlag; |
| | | |
| | | public Integer getId() { |
| | | return id; |
| | |
| | | this.sopId = sopId; |
| | | } |
| | | |
| | | public int getLockFlag() { |
| | | return lockFlag; |
| | | } |
| | | |
| | | public void setLockFlag(int lockFlag) { |
| | | this.lockFlag = lockFlag; |
| | | } |
| | | } |
| | |
| | | package com.whyc.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.whyc.dto.Response; |
| | | import com.whyc.dto.SopDto; |
| | | import com.whyc.mapper.SOPMapper; |
| | |
| | | }else{ |
| | | product.setModel(model); |
| | | } |
| | | |
| | | if((code.equals("") && model.equals(""))){ |
| | | sop.setCurrentFlag(1);//通用 |
| | | } |
| | | sopProductList.add(product); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | //查询sop信息 |
| | | public Response getSopInfo(List<SopDto> sqlList, String code, String model) { |
| | | public Response getSopInfo(List<SopDto> sqlList, String code, String model,int pageCurr,int pageSize) { |
| | | PageHelper.startPage(pageCurr,pageSize); |
| | | String sqlStr=" "; |
| | | if(sqlList!=null&&sqlList.size()>0){ |
| | | for (SopDto dto:sqlList) { |
| | |
| | | } |
| | | } |
| | | List<SOP> list=mapper.getSopInfo(sqlStr,code,model); |
| | | return new Response().setII(1,list.size()>0,list,"查询sop信息"); |
| | | PageInfo pageInfo=new PageInfo(list); |
| | | return new Response().setII(1,list.size()>0,pageInfo,"查询sop信息"); |
| | | } |
| | | //更新sop说明(不含锁信息) |
| | | @Transactional |
| | |
| | | } |
| | | return new Response().setII(1,"更新sop说明完成"); |
| | | } |
| | | |
| | | } |
| | |
| | | <result property="releaseNotes" column="release_notes"></result> |
| | | <result property="createTime" column="create_time"></result> |
| | | <result property="uploadUser" column="upload_user"></result> |
| | | <result property="lockFlag" column="lock_flag"></result> |
| | | <result property="currentFlag" column="current_flag"></result> |
| | | <result property="fileUrl" column="file_url"/> |
| | | <collection property="sopProductList" ofType="SOPProduct"> |
| | | <id column="sid" property="id"/> |
| | | <id column="pId" property="id"/> |
| | | <result column="code" property="code"/> |
| | | <result column="model" property="model"/> |
| | | <result column="sop_id" property="sopId"/> |
| | | <result column="slock_flag" property="lockFlag"/> |
| | | </collection> |
| | | </resultMap> |
| | | <select id="getSopInfo" resultMap="sopList"> |
| | | select *, tb_sop_product.id as sid ,tb_sop_product.lock_flag as slock_flag from tb_sop |
| | | select tb_sop.*,tb_sop_product.id as pId from tb_sop LEFT JOIN tb_sop_product on tb_sop.id=tb_sop_product.sop_id where tb_sop.current_flag=1 |
| | | union all |
| | | select tb_sop.*,tb_sop_product.id as pId from tb_sop |
| | | LEFT JOIN tb_sop_product on tb_sop.id=tb_sop_product.sop_id |
| | | <where> |
| | | 1=1 |