Commit 6b97070d authored by helinlin's avatar helinlin

Merge remote-tracking branch 'origin/developer' into developer

parents b1bdd1a2 451f75d9
......@@ -67,7 +67,7 @@ public class TreeParser {
parentId = PARENTIDMethodNameme.invoke(entity) != null ? Long.valueOf(String.valueOf(PARENTIDMethodNameme.invoke(entity))) : null;
if (parentId == null || topId == parentId) {
if (parentId == null || topId.equals(parentId) ) {//陈浩2021-12-01修改 topId == parentId 的判断
String codeString = String.valueOf(IDMethodNameme.invoke(entity));
Integer num = 0;
if (list != null && list.size() > 0) {
......
......@@ -7,6 +7,7 @@
rs.mrid,
rs.`name`,
rs.parent_mrid,
rs.risk_level_mrid,
IFNULL(rs.rpn, 0) rpn,
IFNULL(rs.rpni, 0) rpni
FROM `asf_fire_risk_source` rs
......
......@@ -38,4 +38,6 @@ public interface FirefightersMapper extends BaseMapper<Firefighters> {
String state, String areasExpertise, String jobTitle);
List<FirefightersDto> queryById(@Param("gw")String[] gw, @Param("name")String name);
List<Map<String,String>> selectNormalFirePerson(String jobCode);
}
......@@ -190,5 +190,29 @@
</foreach>
</if>
</select>
<select id="selectNormalFirePerson"
resultType="Map">
SELECT
cff.*,
cft. NAME as fireTeamName,
case when cff.age is null then "" else cff.age end as realAge
from (
SELECT
cf.*,
FLOOR(datediff(CURDATE(),cf.birthday_time)/365.25) AS age
FROM
cb_firefighters cf
WHERE
(
cf.state_code IN ('94', '98')
OR cf.state_code IS NULL
)
AND cf.is_delete = FALSE
AND cf.job_title_code = #{jobCode}
) cff
LEFT JOIN cb_fire_team cft ON cff.fire_team_id = cft.sequence_nbr
</select>
</mapper>
......@@ -168,16 +168,7 @@ public class FirefightersServiceImpl extends BaseService<FirefightersDto, Firefi
}
public Object getAllFirefightersPerson(int size, int current, String jobCode) {
LambdaQueryWrapper<Firefighters> wrapper = new LambdaQueryWrapper<Firefighters>();
wrapper.eq(Firefighters::getIsDelete, false);
wrapper.eq(Firefighters::getStateCode, "94");//在职
if(StringUtils.isNotBlank(jobCode)) {
wrapper.eq(Firefighters::getJobTitleCode, jobCode);
}
if(current!=0) {
wrapper.last("limit "+current+","+size);
}
return this.baseMapper.selectMaps(wrapper);
return firefightersMapper.selectNormalFirePerson(jobCode);
}
}
......@@ -468,7 +468,12 @@ public List<Menu> getFirstTeamToDesignatedDepartment(String dicCode, String type
queryWrapper.eq(FireTeam::getTypeCode, code);
queryWrapper.eq(FireTeam::getIsDelete, false);
queryWrapper.eq(FireTeam::getCompanyName, "消防救援保障部");
return TreeParser.getTree(null, this.baseMapper.selectList(queryWrapper), FireTeam.class.getName(), "getSequenceNbr", 2, "getName", "getParent",
LambdaQueryWrapper<FireTeam> queryWrapper1 = new LambdaQueryWrapper<FireTeam>();
queryWrapper1.eq(FireTeam::getIsDelete, false);
queryWrapper1.eq(FireTeam::getCompanyName, "消防救援保障部");
queryWrapper1.isNull(FireTeam::getParent);
FireTeam parentFireTeam= this.baseMapper.selectOne(queryWrapper1);
return TreeParser.getTree(parentFireTeam.getSequenceNbr() , this.baseMapper.selectList(queryWrapper), FireTeam.class.getName(), "getSequenceNbr", 2, "getName", "getParent",
null);
// TODO Auto-generated method stub
}
......
......@@ -238,7 +238,9 @@ public class VoiceRecordFileServiceImpl extends BaseService<VoiceRecordFileDto,
private VoiceRecordFileDto buildFilePath(VoiceRecordFileDto record) {
Map<String, String> callRecord = fusionService.getCallRecordByCID(record.getConnectId());
record.setFilePath(String.format("/%s/%s", callRecord.get("subPath"), callRecord.get("recordName")));
if (!ValidationUtil.isEmpty(callRecord)){
record.setFilePath(String.format("/%s/%s", callRecord.get("subPath"), callRecord.get("recordName")));
}
return record;
}
}
\ No newline at end of file
......@@ -46,10 +46,7 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.UnsupportedEncodingException;
import java.io.*;
import java.net.URLEncoder;
import java.text.ParseException;
import java.util.Arrays;
......@@ -296,37 +293,42 @@ public class CheckReportServiceImpl extends BaseService<CheckReportDto, CheckRep
report.setReportDate(getCheckReportDateStr(report));
report.setNowDate(DateUtils.dateFormat(new Date(), DateUtils.CHN_DATE_PATTERN));
if (!ValidationUtil.isEmpty(report)) {
String checkReportTemplatePath = this.getClass().getClassLoader().getResource("templates/check-report-template" +
".docx").getFile();
// String checkReportTemplatePath = this.getClass().getClassLoader().getResource("templates/check-report-template.docx").getFile();
String fileName = report.getName() + ".docx";
InputStream resourceAsStream = this.getClass().getClassLoader().getResourceAsStream("templates/check-report-template.docx");
CheckDangerTablePolicy checkDangerTablePolicy = new CheckDangerTablePolicy();
ReviewDangerTablePolicy reviewDangerTablePolicy = new ReviewDangerTablePolicy();
Configure.ConfigureBuilder configureBuilder = Configure.newBuilder();
configureBuilder.setElMode(ELMode.SPEL_MODE).bind("checkDangerList", checkDangerTablePolicy).bind("reviewDangerList", reviewDangerTablePolicy).build();
XWPFTemplate template = XWPFTemplate.compile(checkReportTemplatePath, configureBuilder.build()).render(report);
response.setContentType("application/msword");
response.setHeader("Content-Disposition",
"attachment;filename=" + URLEncoder.encode(fileName, "utf-8"));
OutputStream out = null;
BufferedOutputStream bos = null;
try {
out = response.getOutputStream();
bos = new BufferedOutputStream(out);
template.write(bos);
bos.flush();
out.flush();
} catch (IOException e) {
log.error("生成文档失败---------->");
e.printStackTrace();
} finally {
// XWPFTemplate template = XWPFTemplate.compile(checkReportTemplatePath, configureBuilder.build()).render(report);
if (resourceAsStream != null) {
XWPFTemplate template = XWPFTemplate.compile(resourceAsStream, configureBuilder.build()).render(report);
response.setContentType("application/msword");
response.setHeader("Content-Disposition",
"attachment;filename=" + URLEncoder.encode(fileName, "utf-8"));
OutputStream out = null;
BufferedOutputStream bos = null;
try {
bos.close();
out.close();
template.close();
out = response.getOutputStream();
bos = new BufferedOutputStream(out);
template.write(bos);
bos.flush();
out.flush();
} catch (IOException e) {
log.error("生成文档失败---------->");
e.printStackTrace();
} finally {
try {
bos.close();
out.close();
template.close();
} catch (IOException e) {
e.printStackTrace();
}
}
} else {
log.error("获取模板失败---------->");
}
}
}
......
......@@ -627,6 +627,7 @@
LEFT JOIN p_input_item pii ON pii.id = ppii.input_item_id
WHERE prp.point_id = #{pointId}
AND prp.route_id =#{routeId}
AND NOT FIND_IN_SET(prpi.point_input_item_id,prp.exclude_items)
ORDER BY
prpi.order_no
......
......@@ -71,8 +71,10 @@
p_point_inputitem pi
LEFT JOIN p_input_item ii ON ii.id = pi.input_item_id
LEFT JOIN p_point_classify pc ON FIND_IN_SET(pc.id, pi.classify_ids) > 0
LEFT JOIN p_route_point prp ON prp.point_id = pi.point_id
WHERE
pi.point_id = #{pointId}
AND NOT FIND_IN_SET(pi.id,prp.exclude_items)
ORDER BY
pi.order_no
</select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment