| | |
| | | return service.getBomHistoryByPModelAndSName(pmodel,sname); |
| | | } |
| | | |
| | | /*@ApiOperation(tags="产品管理",value = "查询产品的最大版本信息") |
| | | @GetMapping("getMaxBoom") |
| | | public Response getMaxBoom(@RequestParam String parentCode,@RequestParam String parentName,@RequestParam String parentModel){ |
| | | return service.getMaxBoom(parentCode,parentName,parentModel); |
| | | }*/ |
| | | @ApiOperation(tags="产品管理",value = "查询具体某一版本产品信息") |
| | | @GetMapping("getBoomByVersion") |
| | | public Response getBoomByVersion(@RequestParam String parentModel,@RequestParam int version){ |
| | | return service.getBoomByVersion(parentModel,version); |
| | | } |
| | | } |
| | |
| | | |
| | | public interface ProductBomHistoryMapper extends CustomMapper<ProductBomHistory> { |
| | | void updateVersionBatch(List<ProductBomHistory> newVersionCurrentHistoryList); |
| | | //查询产品的最大版本信息 |
| | | int selectMaxVersion(String parentCode, String parentName, String parentModel); |
| | | |
| | | } |
| | |
| | | public void updateVersionBatch(List<ProductBomHistory> newVersionCurrentHistoryList) { |
| | | mapper.updateVersionBatch(newVersionCurrentHistoryList); |
| | | } |
| | | //查询产品的最大版本信息 |
| | | public Response getMaxBoom(String parentCode, String parentName, String parentModel) { |
| | | int maxVersion=mapper.selectMaxVersion(parentCode,parentName,parentModel); |
| | | return new Response().setII(1,maxVersion>=0?true:false,maxVersion,"返回最大版本"); |
| | | //查询具体某一版本产品信息 |
| | | public Response getBoomByVersion(String parentModel, int version) { |
| | | QueryWrapper wrapper=new QueryWrapper(); |
| | | wrapper.eq("parent_model",parentModel); |
| | | wrapper.le("s_version",version); |
| | | wrapper.ge("e_version",version); |
| | | List<ProductBomHistory> list=mapper.selectList(wrapper); |
| | | return new Response().setII(1,list.size()>0?true:false,list,""); |
| | | } |
| | | } |
| | |
| | | List<ProductBom> list=mapper.selectList(wrapper); |
| | | //生成excel并将dwg文件放在同一报下压缩 |
| | | creatBomExcel(req,resp,list,wb); |
| | | //记录日志 |
| | | DocUser docUser= ActionUtil.getUser(); |
| | | String operationDetail="具体产品母料型号为:"+parentModel; |
| | | String opreationMsg="执行了最新版产品下载操作"; |
| | | String terminalIp=req.getRemoteAddr(); |
| | | logService.recordOperationLog(docUser.getId(),docUser.getName(), UserOperation.TYPE_DOWNLOAD.getType(),new Date(),terminalIp,opreationMsg,operationDetail); |
| | | } |
| | | //根据产品信息创建excel表格并存放在指定目录 |
| | | public void creatBomExcel(HttpServletRequest req, HttpServletResponse resp,List<ProductBom> list, HSSFWorkbook wb){ |
| | |
| | | update db_doc.tb_product_bom_history set e_version = #{his.eVersion} where id = #{his.id} |
| | | </foreach> |
| | | </update> |
| | | <select id="selectMaxVersion" resultType="java.lang.Integer"> |
| | | select ifNull(max(e_version),-1) from db_doc.tb_product_bom_history |
| | | <where> |
| | | parent_code=#{parentCode} and parent_name=#{parentName} and parent_model=#{parentModel} |
| | | </where> |
| | | limit 1 |
| | | </select> |
| | | |
| | | </mapper> |