标准比对 以及产品规划部 批量关闭 加导出
This commit is contained in:
+42
-2
@@ -8,6 +8,8 @@ import com.adc.da.slrs.sarStandUnqualified.entity.ProductDeptIssue;
|
||||
import com.adc.da.slrs.sarStandUnqualified.entity.ProductDeptIssueVo;
|
||||
import com.adc.da.slrs.sarStandUnqualified.service.IBusinessDeptIssueService;
|
||||
import com.adc.da.slrs.sarStandUnqualified.service.IProductDeptIssueService;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -15,6 +17,9 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@@ -64,8 +69,6 @@ public class ProductDeptIssueController {
|
||||
boolean b = iProductDeptIssueService.updateProductDeptIssue(issue);
|
||||
return Result.success(b);
|
||||
}
|
||||
// 多态对接口具有可替换性接口 灵活性简化性易拓展 可替换的概念可以理解伟方法可以被同类重用
|
||||
// 可扩充性可以理解为该方法可以添加子类而不影响现有代码,接口性就是指的是向子类提供一个公用的高级接口子类来集成完善这个接口中的方法来实现要求。
|
||||
|
||||
@PostMapping("/closeProductIssue")
|
||||
@ApiOperation("关闭产品规划部重点问题")
|
||||
@@ -75,4 +78,41 @@ public class ProductDeptIssueController {
|
||||
|
||||
return Result.success(b);
|
||||
}
|
||||
|
||||
@GetMapping("/exportIssue")
|
||||
@ApiOperation("导出产品规划部重点问题")
|
||||
public void exportIssue(HttpServletResponse response, ProductDeptIssueVo issue ) throws IOException {
|
||||
try {
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
|
||||
if(issue.getFileName()==null || issue.getFileName()==""){
|
||||
issue.setFileName("事业部重点问题信息");
|
||||
}
|
||||
String fileName = URLEncoder.encode(issue.getFileName(), "UTF-8").replaceAll("\\+", "%20");
|
||||
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
|
||||
|
||||
/**
|
||||
* 重写了get方法,无法使用net.sf.json.JSONObject转换对象
|
||||
*/
|
||||
// net.sf.json.JSONObject jsonObject = net.sf.json.JSONObject.fromObject(issue.getExportContent());
|
||||
// BusinessDeptIssueVo businessDeptIssueVo = (BusinessDeptIssueVo) net.sf.json.JSONObject.toBean(jsonObject, BusinessDeptIssueVo.class);
|
||||
|
||||
JSONObject jsonObject = JSONObject.parseObject(issue.getExportContent());
|
||||
ProductDeptIssueVo businessDeptIssueVo = JSONObject.toJavaObject(jsonObject, ProductDeptIssueVo.class);
|
||||
List<ProductDeptIssue> page = iProductDeptIssueService.getExportData(businessDeptIssueVo,businessDeptIssueVo.getIdList());
|
||||
|
||||
|
||||
// 这里需要设置不关闭流
|
||||
EasyExcel.write(response.getOutputStream(), BusinessDeptIssue.class).autoCloseStream(Boolean.FALSE).sheet("sheet1")
|
||||
.doWrite(page);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
// 重置response
|
||||
response.reset();
|
||||
response.setContentType("application/json");
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.getWriter().println(JSONObject.toJSONString(Result.error()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+3
-1
@@ -10,8 +10,10 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ProductDeptIssueDao extends BaseMapper<ProductDeptIssue> {
|
||||
|
||||
public IPage<ProductDeptIssue> findPage1(IPage<ProductDeptIssue> page,@Param(Constants.WRAPPER) QueryWrapper<ProductDeptIssue> wrapper);
|
||||
public IPage<ProductDeptIssue> findPage(IPage<ProductDeptIssue> page, @Param("ew") ProductDeptIssueVo objVo);
|
||||
public List<ProductDeptIssue> findExportData(@Param("ew") ProductDeptIssueVo objVo, @Param("ids") List<String> ids);
|
||||
}
|
||||
|
||||
+22
@@ -1,4 +1,26 @@
|
||||
package com.adc.da.slrs.sarStandUnqualified.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class ProductDeptIssueVo extends ProductDeptIssue {
|
||||
|
||||
private String numberOrName;
|
||||
|
||||
private String fileName;
|
||||
|
||||
private String idList;
|
||||
|
||||
private String exportContent;
|
||||
|
||||
public List<String> getIdList(){
|
||||
if (this.idList!=null){
|
||||
return Arrays.asList(this.idList.split(","));
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
@@ -16,6 +16,8 @@ public interface IProductDeptIssueService extends IService<ProductDeptIssue> {
|
||||
|
||||
public IPage<ProductDeptIssue> getProductDeptIssue(ProductDeptIssueVo objVo);
|
||||
|
||||
public List<ProductDeptIssue> getExportData(ProductDeptIssueVo objVo,List<String> ids);
|
||||
|
||||
public boolean updateProductDeptIssue(ProductDeptIssue obj);
|
||||
|
||||
public boolean closeProductDeptIssue(List<String> idList);
|
||||
|
||||
+6
@@ -64,6 +64,12 @@ public class ProductDeptIssueService extends ServiceImpl<ProductDeptIssueDao,Pro
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProductDeptIssue> getExportData(ProductDeptIssueVo objVo, List<String> ids) {
|
||||
|
||||
return productDeptIssueDao.findExportData(objVo,ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateProductDeptIssue(ProductDeptIssue obj) {
|
||||
|
||||
|
||||
+4
@@ -247,6 +247,10 @@ public class SarStandCompareHisEOServiceImpl implements SarStandCompareHisEOServ
|
||||
sarStandCompareHisEO.setId(standHisId);
|
||||
sarStandCompareHisEO.setCompareStatus("比对完成");
|
||||
sarStandCompareHisEODao.updateByPrimaryKeySelective(sarStandCompareHisEO);
|
||||
if (oldList.size()==0 || newList.size()==0){
|
||||
resultMap.put("error","比对数据已删除");
|
||||
}
|
||||
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
|
||||
+90
@@ -88,5 +88,95 @@
|
||||
</if>
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="findExportData" resultMap="ProductIssuePage">
|
||||
|
||||
select a.* from (
|
||||
SELECT
|
||||
issue.*,
|
||||
laws.LAWS_NUMBER,
|
||||
laws.LAWS_NAME ,
|
||||
us.INSTITUTION_ID as responseInsId,
|
||||
tsins.name as responseInsName,
|
||||
us.uname as responseUserName
|
||||
FROM
|
||||
product_dept_issue AS issue
|
||||
LEFT JOIN sar_laws_stand_info AS laws ON issue.law_id = laws.ID
|
||||
left join ts_user as us on us.USID = issue.response_dept
|
||||
left join ts_institution as tsins on us.INSTITUTION_ID = tsins.id
|
||||
WHERE 1=1
|
||||
AND laws.LAWS_NAME is NOT NULL AND laws.LAWS_NUMBER is NOT NULL
|
||||
<if test="null != ew.isClose and ew.isClose != ''">and issue.is_close like concat('%',#{ew.isClose},'%')
|
||||
</if>
|
||||
<if test="null != ids and ids.size()>0">
|
||||
and issue.id in
|
||||
<foreach item="msgId" collection="ids" open="(" separator="," close=")" index="index">
|
||||
#{msgId}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
UNION all
|
||||
SELECT
|
||||
issue.*,
|
||||
CONCAT(laws.
|
||||
STAND_SORT,' ',laws.STAND_NUMBER,'-',laws.STAND_YEAR)as LAWS_NUMBER,
|
||||
laws.STAND_NAME as LAWS_NAME,
|
||||
us.INSTITUTION_ID as responseInsId,
|
||||
tsins.name as responseInsName,
|
||||
us.uname as responseUserName
|
||||
FROM
|
||||
product_dept_issue AS issue
|
||||
LEFT JOIN sar_standards_info AS laws ON issue.law_id = laws.ID
|
||||
left join ts_user as us on us.USID = issue.response_dept
|
||||
left join ts_institution as tsins on us.INSTITUTION_ID = tsins.id
|
||||
WHERE
|
||||
1=1
|
||||
AND laws.STAND_SORT is NOT NULL
|
||||
<if test="null != ew.isClose and ew.isClose != ''">
|
||||
and issue.is_close like concat('%',#{ew.isClose},'%')
|
||||
</if>
|
||||
<if test="null != ids and ids.size()>0">
|
||||
and issue.id in
|
||||
<foreach item="msgId" collection="ids" open="(" separator="," close=")" index="index">
|
||||
#{msgId}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
UNION all
|
||||
SELECT
|
||||
issue.*,
|
||||
laws.STAND_CODE as LAWS_NUMBER,
|
||||
laws.STAND_NAME as LAWS_NAME,
|
||||
us.INSTITUTION_ID as responseInsId,
|
||||
tsins.name as responseInsName,
|
||||
us.uname as responseUserName
|
||||
FROM
|
||||
product_dept_issue AS issue
|
||||
LEFT JOIN sar_bussioness_stand AS laws ON issue.law_id = laws.ID
|
||||
left join ts_user as us on us.USID = issue.response_dept
|
||||
left join ts_institution as tsins on us.INSTITUTION_ID = tsins.id
|
||||
WHERE
|
||||
1=1
|
||||
AND laws.STAND_CODE is NOT NULL AND laws.STAND_NAME is NOT NULL
|
||||
<if test="null != ew.isClose and ew.isClose != ''">
|
||||
and issue.is_close like concat('%',#{ew.isClose},'%')
|
||||
</if>
|
||||
<if test="null != ids and ids.size()>0">
|
||||
and issue.id in
|
||||
<foreach item="msgId" collection="ids" open="(" separator="," close=")" index="index">
|
||||
#{msgId}
|
||||
</foreach>
|
||||
</if>
|
||||
)a
|
||||
where 1=1
|
||||
<if test="null != ew.lawsNumber and ew.lawsNumber != ''">
|
||||
and ( a.LAWS_NUMBER like concat('%',#{ew.lawsNumber},'%') or a.LAWS_NAME like concat('%',#{ew.lawsNumber},'%') )
|
||||
</if>
|
||||
<if test="null != ew.responseInsName and ew.responseInsName != ''">
|
||||
and a.responseInsName like concat('%',#{ew.responseInsName},'%')
|
||||
</if>
|
||||
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
4.13------------------
|
||||
INSERT INTO `foton_slrs_test2`.`sar_menu`(`ID`, `SOR_DIVIDE`, `MENU_NAME`, `PARENT_ID`, `PARENT_IDS`, `LEVEL`, `DISPLAY_SEQ`, `HREF`, `VALID_FLAG`, `CREATION_TIME`, `MODIFY_TIME`, `REMARKS`) VALUES ('asdzcfgk', NULL, '政策法规库', NULL, NULL, 1, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||
Reference in New Issue
Block a user