Merge branch 'develop_master' into 'FOTON'

Develop master

See merge request LiuChao/foton-slrs-system-rest!267
This commit is contained in:
王夏晖
2021-12-02 21:16:45 +08:00
14 changed files with 177 additions and 61 deletions
@@ -9,6 +9,8 @@ import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
import com.adc.da.slrs.sarStandWarning.service.IWarningDateService;
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
import com.adc.da.util.UUIDUtils;
@@ -25,6 +27,7 @@ import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.PostConstruct;
import java.time.LocalDate;
import java.util.*;
import java.util.regex.Pattern;
@@ -59,8 +62,10 @@ public class ScheduledJob {
@Autowired
private SarStandAttrInfoDao sarStandAttrInfoDao; //属性字段表
@Autowired
private IWarningDateService iWarningDateService;// 预警日期
// @PostConstruct //程序启动时执行一次
@Scheduled(cron = "0 0 0 * * ?") //每天的凌晨0点执行
// @Scheduled(cron="*/5 * * * * ?")
@Async
@@ -98,8 +103,14 @@ public class ScheduledJob {
TermDTO term = new TermDTO(); //预警期限(当前日期至3个月后)
List<WarningDate> warningDateList = sarStandardWarningDao.getWarningDate(term); //查询符合预警期限的标准 多个
List<EarlyWarningEO> warningList = sarStandardWarningDao.getWarningId(term);
warningDateList.forEach(item->{
item.setId(UUIDUtils.randomUUID20());
});
iWarningDateService.remove(null); //清空标准的日期子表
iWarningDateService.saveBatch(warningDateList); // 保存进入标准的日期子表 保存标准的实施日期 新车型实施日期 在产车实施日期 多个
List<EarlyWarningEO> warningList = sarStandardWarningDao.getWarningId(term); //联接标准的日期子表 和分解单表 查询符合预警期限的标准和分解项
warningList.forEach(item->{
item.setId(UUIDUtils.randomUUID20());
@@ -2,6 +2,7 @@ package com.adc.da.scheduled.dao;
import com.adc.da.scheduled.entity.TermDTO;
import com.adc.da.slrs.sarStandWarning.entity.EarlyWarningEO;
import com.adc.da.slrs.sarStandWarning.entity.WarningDate;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
@@ -19,4 +20,7 @@ public interface SarStandardWarningDao extends BaseMapper<EarlyWarningEO> {
public int autoCancelWarning();
public List<EarlyWarningEO> getWarningId(TermDTO term);
public List<WarningDate> getWarningDate(TermDTO term);
}
@@ -193,8 +193,8 @@ public class SarStandardComplianceAssessResultController {
p1.setTotal(page.getTotal());
map.put("unfit",p1);
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper1 = new QueryWrapper<>();
queryWrapper.eq("STAND_ID", eo.getStandId());
queryWrapper.eq("product_id", eo.getProductId());
queryWrapper1.eq("STAND_ID", eo.getStandId());
queryWrapper1.eq("product_id", eo.getProductId());
queryWrapper1.ne("research_compliance","");
queryWrapper1.orderByAsc("product_name");
queryWrapper1.orderByAsc("standard_item");
@@ -1,6 +1,8 @@
package com.adc.da.slrs.sarUrl.controller;
import com.adc.da.att.entity.AttFileEO;
import com.adc.da.att.service.IAttFileEOService;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarUrl.entity.OrderUrlVO;
@@ -12,12 +14,21 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import javax.imageio.ImageIO;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.swing.*;
import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.*;
import java.util.Arrays;
import java.util.Base64;
import java.util.List;
/**
@@ -34,6 +45,52 @@ public class TsUrlController{
@Autowired
private ITsUrlService tsUrlService;
@Autowired
private IAttFileEOService iAttFileEOService;
@Value("${file.path}")
private String filePath;
@GetMapping("getIconImg")
public String getIconImg(HttpServletRequest request, HttpServletResponse response){
String url = "";
String path = "api/att/attFile/upload";
ServletOutputStream outputStream = null;
FileInputStream inputStream = null;
//通过id获取路径
String id = request.getParameter("id");
String fid = tsUrlService.getById(id).getIcon();
List<AttFileEO> attFileEOS = iAttFileEOService.getMultiFileInfos(fid);
if(attFileEOS.isEmpty()){
return null;
}
AttFileEO attFileEO = attFileEOS.get(0);
url = filePath + attFileEO.getFilePath() + attFileEO.getFileName();
try {
System.out.println(id);
TsUrl tsUrl = tsUrlService.getById(id);
System.out.println(tsUrl);
File file = new File(url);
if(!file.exists()) return null;
inputStream = new FileInputStream(file);
response.setContentType("image/jpeg");
outputStream = response.getOutputStream();
int len = 0;
byte[] buffer = new byte[1024 * 10];
while ((len = inputStream.read(buffer)) != -1){
outputStream.write(buffer,0,len);
}
outputStream.flush();
outputStream.close();
inputStream.close();
} catch (IOException e) {
System.out.println("---------图标获取异常--------------");
}
return null;
}
@ApiOperation("查询")
@GetMapping
public ResponseMessage<List<TsUrl>> getUrls(){
@@ -61,4 +61,10 @@ public class TsUrl implements Serializable {
/**排序*/
@ApiModelProperty(value = "排序")
private Integer orderBy;
/**新增*/
@ApiModelProperty(value = "图标信息")
private String icon;
@ApiModelProperty(value = "位置")
private Integer type;
}
@@ -15,13 +15,13 @@ import com.adc.da.base.web.BaseController;
import java.util.List;
/**
* <p>
* 标准制修订补助资金收支统计支出表 前端控制器
* </p>
*
* @author super_liu
* @since 2021-11-12
*/
* <p>
* 标准制修订补助资金收支统计支出表 前端控制器
* </p>
*
* @author super_liu
* @since 2021-11-12
*/
@RestController
@Api(description = "|WgdZcb|")
@RequestMapping("api/wgdCensusLeo/wgd-zcb")
@@ -30,13 +30,14 @@ public class WgdZcbController extends BaseController<WgdZcb> {
IWgdZcbService iWgdZcbService;
@GetMapping("/getAllZcbs")
public ResponseMessage<Object> getAllWgdZcbs(){//查询所有
public ResponseMessage<Object> getAllWgdZcbs() {//查询所有
return Result.success(iWgdZcbService.getAllWgdZcbs());
}
@ApiOperation("查询")
@GetMapping("/queryAllZcbs")
public ResponseMessage<Object> queryAllWgdZcbs(WgdZcb wgdZcb){//多条件查询
public ResponseMessage<Object> queryAllWgdZcbs(WgdZcb wgdZcb) {//多条件查询
List<WgdZcb> wgdZcbs = iWgdZcbService.queryAllWgdZcbs(wgdZcb);
PageInfo pageInfo = getPageInfo(wgdZcb.getPager(),wgdZcbs);
return Result.success(pageInfo);
@@ -60,13 +61,13 @@ public class WgdZcbController extends BaseController<WgdZcb> {
}
@PostMapping("/delZcb")
ResponseMessage<Object> deleteWgdZcb(String id){//删除
ResponseMessage<Object> deleteWgdZcb(String id) {//删除
return Result.success(iWgdZcbService.deleteWgdZcb(id));
}
@ApiOperation("删除")
@PostMapping("/delZcbs")
ResponseMessage<Object> deleteWgdZcbs(String ids){//批量删除
ResponseMessage<Object> deleteWgdZcbs(String ids) {//批量删除
return Result.success(iWgdZcbService.deleteWgdZcbs(ids));
}
}
@@ -35,10 +35,9 @@ public class WgdZcb extends BasePage {
private String cost;
@ApiModelProperty(value = "用途")
private String use;
private String purposes;
@ApiModelProperty(value = "详细附件")
private String annex;
private String annexs;
}
@@ -74,4 +74,35 @@
</select>
<select id="getWarningDate" resultType="com.adc.da.slrs.sarStandWarning.entity.WarningDate">
SELECT lawId,timeName,DATE_FORMAT(SSRQ,'%Y-%m-%d') as SSRQ FROM
(
select attr.STAND_ID as lawId,'SSRQ' as timeName,
substring_index(substring_index(attr.SSRQ,',',b.help_topic_id+1),',',-1) SSRQ
from sar_stand_attr_info attr
join mysql.help_topic b
on b.help_topic_id &lt; (length(attr.SSRQ) - length(replace(attr.SSRQ,',',''))+1)
UNION ALL
select attr.STAND_ID as lawId,'XCXSSRQ' as timeName,
substring_index(substring_index(attr.SSRQ,',',b.help_topic_id+1),',',-1) SSRQ
from sar_stand_attr_info attr
join mysql.help_topic b
on b.help_topic_id &lt; (length(attr.XCXSSRQ) - length(replace(attr.SSRQ,',',''))+1)
UNION ALL
select attr.STAND_ID as lawId,'ZCCSSRQ' as timeName,
substring_index(substring_index(attr.ZCCSSRQ,',',b.help_topic_id+1),',',-1) SSRQ
from sar_stand_attr_info attr
join mysql.help_topic b
on b.help_topic_id &lt; (length(attr.SSRQ) - length(replace(attr.SSRQ,',',''))+1)
) as T
WHERE
DATE_FORMAT(T.SSRQ,'%Y-%m-%d') BETWEEN DATE_FORMAT(#{startDate}, '%Y-%m-%d') AND DATE_FORMAT(#{endDate}, '%Y-%m-%d')
</select>
</mapper>
@@ -8,11 +8,15 @@
select PRODUCT_NAME as productName,sar_stand_project_library.project_group as projectGroup,
sar_stand_project_library.id as sarId,
sar_stand_project_library.product_line as productLine,sar_stand_project_library.project_number as productId,
sar_stand_project_library.project_manager as projectManager,ts_user.UNAME as uName,count(*) unCount from
sar_stand_unqualified
left join sar_stand_project_library on sar_stand_unqualified.product_id = sar_stand_project_library.project_number
LEFT JOIN ts_user on ts_user.USID = sar_stand_project_library.project_manager
where STAND_ID = #{product.standId} and CLOSE_STATE = '1'
sar_stand_project_library.project_manager as projectManager,ts_user.UNAME as uName,
(SELECT count(*) FROM sar_stand_unqualified WHERE sar_stand_unqualified.STAND_ID = #{product.standId}) unCount
FROM
sar_stand_project_library
LEFT JOIN sar_stand_unqualified ON sar_stand_unqualified.product_id = sar_stand_project_library.project_number
LEFT JOIN ts_user ON ts_user.USID = sar_stand_project_library.project_manager
WHERE
sar_stand_project_library.project_number in ( SELECT product_id FROM sar_standard_compliance_product_assess WHERE STAND_ID=#{product.standId})
AND CLOSE_STATE = '1'
group by
PRODUCT_NAME,
sar_stand_project_library.project_group,
@@ -34,10 +38,14 @@
<select id="selectPagesCount"
resultType="java.lang.Integer">
select count(sar_stand_unqualified.product_id) from sar_stand_unqualified
left join sar_stand_project_library on sar_stand_unqualified.product_id = sar_stand_project_library.project_number
LEFT JOIN ts_user on ts_user.USID = sar_stand_project_library.project_manager
where STAND_ID = #{product.standId} and CLOSE_STATE = '1'
select count(sar_stand_unqualified.product_id)
FROM
sar_stand_project_library
LEFT JOIN sar_stand_unqualified ON sar_stand_unqualified.product_id = sar_stand_project_library.project_number
LEFT JOIN ts_user ON ts_user.USID = sar_stand_project_library.project_manager
WHERE
sar_stand_project_library.project_number in (SELECT product_id FROM sar_standard_compliance_product_assess WHERE STAND_ID=#{product.standId})
AND CLOSE_STATE = '1'
group by
PRODUCT_NAME,
sar_stand_project_library.project_group,
@@ -758,15 +758,15 @@
SAR_STANDARDS_INFO.STAND_YEAR),' ','')) like trim(replace(concat(concat('%',#{page.standNumber}),'%'),' ','')) and SAR_STANDARDS_INFO.STAND_YEAR != '')
or (trim(replace(concat(SAR_STANDARDS_INFO.STAND_SORT,' ',SAR_STANDARDS_INFO.STAND_NUMBER),' ','')) like trim(replace(concat(concat('%',#{page.standNumber}),'%'),' ',''))
and SAR_STANDARDS_INFO.STAND_YEAR = '')
or (stand_name like concat(concat('%',#{page.standNumber}),'%'))
<!-- or (stand_name like concat(concat('%',#{page.standNumber}),'%')) -->
)
</if>
<!-- 标准名称 -->
<if test="page.standName != null and page.standName != ''">
and stand_name like concat(concat('%',#{page.standName}),'%')
or STAND_NUMBER like concat(concat('%',#{page.standName}),'%')
or STAND_YEAR like concat(concat('%',#{page.standName}),'%')
or STAND_SORT like concat(concat('%',#{page.standName}),'%')
<!-- or STAND_NUMBER like concat(concat('%',#{page.standName}),'%') -->
<!-- or STAND_YEAR like concat(concat('%',#{page.standName}),'%') -->
<!-- or STAND_SORT like concat(concat('%',#{page.standName}),'%') -->
</if>
<if test="page.standEnName != null and page.standEnName != ''">
and stand_en_name like concat(concat('%',#{page.standEnName}),'%')
@@ -3,7 +3,7 @@
<mapper namespace="com.adc.da.slrs.wgdCensusLeo.dao.WgdZcbDao">
<!-- 基础信息-->
<sql id="BaseInfo">
id,name,cost,use,annex
id,name,cost,purposes,annexs
</sql>
<!-- 查询条件-->
<sql id="Conditions">
@@ -12,18 +12,17 @@
and id = #{id}
</if>
<if test="name != null and name != ''">
and name like concat('%',#{name},'%')
and name = #{name}
</if>
<if test="cost != null and cost != ''">
and cost like concat('%',#{cost},'%')
and cost = #{cost}
</if>
<if test="use != null and use != ''">
and use like concat('%',#{use},'%')
<if test="purposes != null and purposes != ''">
and purposes = #{purposes}
</if>
<if test="annex != null and annex != ''">
and annex = #{annex}
<if test="annexs != null and annexs != ''">
and annexs = #{annexs}
</if>
</where>
</sql>
<select id="getTotal" resultType="java.lang.Integer">
@@ -57,13 +56,13 @@
<if test="cost != null and cost != ''">
cost = #{cost},
</if>
<if test="use != null and use != ''">
use = #{use},
<if test="purposes != null and purposes != ''">
purposes = #{purposes},
</if>
<if test="annex != null and annex != ''">
annex = #{annex},
<if test="annexs != null and annexs != ''">
annexs = #{annexs},
</if>
</set>
where id = #{id}
</update>
@@ -80,13 +79,13 @@
<if test="cost != null and cost != ''">
cost,
</if>
<if test="use != null and use != ''">
use,
<if test="purposes != null and purposes != ''">
purposes,
</if>
<if test="annex != null and annex != ''">
annex,
<if test="annexs != null and annexs != ''">
annexs,
</if>
</trim>
values
<trim prefix="(" suffix=")" suffixOverrides=",">
@@ -99,11 +98,11 @@
<if test="cost != null and cost != ''">
#{cost},
</if>
<if test="use != null and use != ''">
#{use},
<if test="purposes != null and purposes != ''">
#{purposes},
</if>
<if test="annex != null and annex != ''">
#{annex},
<if test="annexs != null and annexs != ''">
#{annexs},
</if>
</trim>
@@ -19,8 +19,8 @@
</if>
<if test="scName != null and scName != ''">
and (
sc_name like concat('%',#{scName} ,'%')
ssc_name like concat('%',#{scName} ,'%')
sc_name like concat('%',#{scName} ,'%') or
ssc_name like concat('%',#{scName} ,'%') or
wg_name like concat('%',#{scName} ,'%')
)
</if>
@@ -20,8 +20,8 @@
</if>
<if test="scName != null and scName != ''">
and (
sc_name like concat('%',#{scName} ,'%')
ssc_name like concat('%',#{scName} ,'%')
sc_name like concat('%',#{scName} ,'%') or
ssc_name like concat('%',#{scName} ,'%') or
wg_name like concat('%',#{scName} ,'%')
)
</if>
@@ -20,10 +20,10 @@
</if>
<if test="scName != null and scName != ''">
and (
sc_name like concat('%',#{scName} ,'%')
ssc_name like concat('%',#{scName} ,'%')
wg_name like concat('%',#{scName} ,'%')
)
sc_name like concat('%',#{scName} ,'%') or
ssc_name like concat('%',#{scName} ,'%') or
wg_name like concat('%',#{scName} ,'%')
)
</if>
<if test="role != null and role != ''">
and role = #{role}