product/downloadProductHistory 历史产品下载(产品id和版本<下载的版本>)
| | |
| | | public void downloadProductHistory(HttpServletRequest req, HttpServletResponse resp, @RequestParam int productId, @RequestParam int version){ |
| | | bomHistoryService.downloadProductHistory(req,resp,productId,version); |
| | | } |
| | | @ApiOperation(value = "测试",notes = "8.17修改后使用") |
| | | @GetMapping("getBomHistoryAndMaterial") |
| | | public Response getBomHistoryAndMaterial( @RequestParam int productId, @RequestParam int version){ |
| | | return bomHistoryService.getBomHistoryAndMaterial(productId,version); |
| | | } |
| | | } |
| | |
| | | font.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); |
| | | cellStyle.setFont(font); |
| | | //生成excel并将dwg文件放在同一报下压缩 |
| | | creatBomHsitoryExcel(req,resp,pHistory,list,wb); |
| | | creatBomHsitoryExcel(req,resp,pHistory,endList,wb); |
| | | //记录日志 |
| | | DocUser docUser= ActionUtil.getUser(); |
| | | String operationDetail="具体产品为:"+pHistory.toString(); |
| | |
| | | bomHis.setCreateDate(m.getCreateDate()); |
| | | return bomHis; |
| | | } |
| | | //测试 |
| | | public Response getBomHistoryAndMaterial(int productId, int version) { |
| | | //读取指定版本产品的子件和关联的物料信息 |
| | | List<ProductBomHistory> list=mapper.getBomHistoryAndMaterial(productId,version); |
| | | return new Response().setII(1,true,list,""); |
| | | } |
| | | } |
| | |
| | | </foreach> |
| | | </update> |
| | | |
| | | <resultMap id="MaterialList" type="productBomHistory"> |
| | | <resultMap id="BomHistoryList" type="productBomHistory"> |
| | | <id property="id" column="id"></id> |
| | | <result property="type" column="type"></result> |
| | | <result property="category" column="category"></result> |
| | |
| | | <collection property="materials" javaType="java.util.ArrayList" ofType="com.whyc.pojo.Material" column="{productId=product_id,subCode=sub_code,version=version}" select="selectMaterial"> |
| | | </collection> |
| | | </resultMap> |
| | | <select id="getBomHistoryAndMaterial" resultType="com.whyc.pojo.ProductBomHistory"> |
| | | <select id="getBomHistoryAndMaterial" resultMap="BomHistoryList"> |
| | | select distinct * from db_doc.tb_product_bom_history |
| | | <where> |
| | | product_id = #{productId} |
| | |
| | | select DISTINCT tb_Material.* FROM db_doc.tb_Material,db_doc.tb_Material_product_history |
| | | where tb_Material.id=tb_Material_product_history.Material_id |
| | | and tb_Material_product_history.product_id=#{productId} |
| | | and tb_Material_product_history.sub_code=#{subCode} |
| | | and tb_Material_product_history.sub_code=#{subCode} |
| | | and tb_Material_product_history.version=#{version} |
| | | </select> |
| | | |
| | |
| | | order by id asc |
| | | </select> |
| | | <select id="selectMaterial" resultType="com.whyc.pojo.Material"> |
| | | select DISTINCT tb_Material.* FROM db_doc.tb_Material,db_doc.tb_Material_product_history where tb_Material.id=tb_Material_product_history.Material_id |
| | | and tb_Material_product_history.product_id=#{productId} and tb_Material_product_history.sub_code=#{subCode} |
| | | and tb_Material_product_history.version=#{version} |
| | | select DISTINCT tb_Material.* FROM db_doc.tb_Material,db_doc.tb_Material_product_history |
| | | where tb_Material.id=tb_Material_product_history.Material_id |
| | | and tb_Material_product_history.product_id=#{productId} |
| | | and tb_Material_product_history.sub_code=#{subCode} |
| | | and tb_Material_product_history.version=#{version} |
| | | </select> |
| | | </mapper> |