Commit fc1a16de authored by tangwei's avatar tangwei

Merge branch 'developer' of http://172.16.10.76/moa/amos-boot-biz into developer

parents 138904fa f16a348b
...@@ -27,26 +27,26 @@ public class PdfUtils { ...@@ -27,26 +27,26 @@ public class PdfUtils {
return document; return document;
} }
/** public static PdfPCell createCell(Object value, Font font, int align, int colspan, int row, int size,int top,int right,int bottom,int left){
* String cellValue;
* @param value 单元格数据 if (value == null) {
* @param font 单元格样式 cellValue = "";
* @param align 位置 } else {
* @param colspan 占几列 cellValue = value.toString();
* @param row 占几行 }
* @param size 高度
* @return
*/
public static PdfPCell createCell(String value, Font font, int align, int colspan, int row, int size){
PdfPCell cell = new PdfPCell(); PdfPCell cell = new PdfPCell();
cell.setVerticalAlignment(Element.ALIGN_MIDDLE); cell.setVerticalAlignment(Element.ALIGN_MIDDLE);
cell.setHorizontalAlignment(align); cell.setHorizontalAlignment(align);
cell.setColspan(colspan); cell.setColspan(colspan);
cell.setPhrase(new Phrase(value,font)); cell.setPhrase(new Phrase(cellValue,font));
cell.setFixedHeight(size); cell.setFixedHeight(size);
if (row != 1) { if (row != 1) {
cell.setRowspan(row); cell.setRowspan(row);
} }
cell.setBorderWidthLeft(left);
cell.setBorderWidthRight(right);
cell.setBorderWidthTop(top);
cell.setBorderWidthBottom(bottom);
return cell; return cell;
} }
public static PdfPCell createCell(Image image, int align, int colspan){ public static PdfPCell createCell(Image image, int align, int colspan){
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>amos-boot-module-api</artifactId>
<groupId>com.amosframework.boot</groupId>
<version>1.0.0</version>
</parent>
<artifactId>amos-boot-module-command-api</artifactId>
<dependencies>
</dependencies>
</project>
...@@ -76,7 +76,6 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc ...@@ -76,7 +76,6 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
* @param dutyDay 值班日期 * @param dutyDay 值班日期
* @param shiftIds 班次id * @param shiftIds 班次id
* @param fieldCodes 动态列 * @param fieldCodes 动态列
* @param appKey 应用标识
* @param groupCode 表单类型 * @param groupCode 表单类型
* @return List<Map < String, Object>> * @return List<Map < String, Object>>
*/ */
...@@ -84,6 +83,5 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc ...@@ -84,6 +83,5 @@ public interface DynamicFormInstanceMapper extends BaseMapper<DynamicFormInstanc
@Param("dutyDate") String dutyDay, @Param("dutyDate") String dutyDay,
@Param("shiftId") String shiftIds, @Param("shiftId") String shiftIds,
@Param("fieldCodes") Map<String, Object> fieldCodes, @Param("fieldCodes") Map<String, Object> fieldCodes,
@Param("appKey") String appKey,
@Param("groupCode") String groupCode); @Param("groupCode") String groupCode);
} }
...@@ -48,6 +48,12 @@ ...@@ -48,6 +48,12 @@
<when test="fieldCodes[key] == 'eq' and value !=null and value !=''"> <when test="fieldCodes[key] == 'eq' and value !=null and value !=''">
and d.${key} = #{value} and d.${key} = #{value}
</when> </when>
<when test="fieldCodes[key] == 'ge' and value !=null and value !=''">
and d.${key} >= #{value}
</when>
<when test="fieldCodes[key] == 'le' and value !=null and value !=''">
and d.${key} <![CDATA[<=]]> #{value}
</when>
</choose> </choose>
</foreach> </foreach>
</if> </if>
...@@ -72,7 +78,7 @@ ...@@ -72,7 +78,7 @@
and i.APP_KEY = #{appKey} and i.APP_KEY = #{appKey}
</if> </if>
GROUP by GROUP by
i.INSTANCE_ID)d i.INSTANCE_ID) d
<if test="params != null and params.size() > 0"> <if test="params != null and params.size() > 0">
where where
1=1 1=1
...@@ -84,6 +90,12 @@ ...@@ -84,6 +90,12 @@
<when test="fieldCodes[key] == 'eq' and value !=null and value !=''"> <when test="fieldCodes[key] == 'eq' and value !=null and value !=''">
and d.${key} = #{value} and d.${key} = #{value}
</when> </when>
<when test="fieldCodes[key] == 'ge' and value !=null and value !=''">
and d.${key} >= #{value}
</when>
<when test="fieldCodes[key] == 'le' and value !=null and value !=''">
and d.${key} <![CDATA[<=]]> #{value}
</when>
</choose> </choose>
</foreach> </foreach>
</if> </if>
...@@ -150,7 +162,6 @@ ...@@ -150,7 +162,6 @@
from from
cb_dynamic_form_instance i cb_dynamic_form_instance i
where i.GROUP_CODE = #{groupCode} where i.GROUP_CODE = #{groupCode}
and i.APP_KEY = #{appKey}
GROUP by GROUP by
i.INSTANCE_ID ) d, i.INSTANCE_ID ) d,
cb_duty_person_shift ps, cb_duty_person_shift ps,
......
package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("接警情况详情")
public class ShiftChangeDutyDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "重大警情")
private String majorAlertCount="0";
@ApiModelProperty(value = "已结案")
private String finishedCount="0";
@ApiModelProperty(value = "接警")
private String calledCount="0";
@ApiModelProperty(value = "未结案")
private String unFinishedCount="0";
@ApiModelProperty(value = "接警情况列表")
private List<String> alertInfoList;
@ApiModelProperty(value = "备注")
private String alarmRemark;
}
package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel("力量出动详情")
public class ShiftChangePowerDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "未归队车辆数")
private String no_return_car_count="0";
@ApiModelProperty(value = "调派任务数")
private String transfer_count="0";
@ApiModelProperty(value = "调派车辆数")
private String car_count="0";
@ApiModelProperty(value = "已完成任务数")
private String end_count="0";
@ApiModelProperty(value = "力量出动详情")
private List<String> transferContent;
@ApiModelProperty(value = "备注")
private String powerRemark;
}
...@@ -16,6 +16,13 @@ import java.util.Map; ...@@ -16,6 +16,13 @@ import java.util.Map;
*/ */
public interface AlertCalledMapper extends BaseMapper<AlertCalled> { public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
/**
* 接警情况统计-交接班用
*
* @param beginDate
* @param endDate
* @return
*/
Map<String, Integer> queryAlertStatusCount(@Param("beginDate") String beginDate, @Param("endDate") String endDate); Map<String, Integer> queryAlertStatusCount(@Param("beginDate") String beginDate, @Param("endDate") String endDate);
List<AlertCalledZhDto> alertCalledListByAlertStatus(@Param("address") String address); List<AlertCalledZhDto> alertCalledListByAlertStatus(@Param("address") String address);
......
...@@ -9,8 +9,13 @@ ...@@ -9,8 +9,13 @@
sum( CASE WHEN alert_type_code = 230 THEN 1 ELSE 0 END ) majorAlertCount sum( CASE WHEN alert_type_code = 230 THEN 1 ELSE 0 END ) majorAlertCount
FROM FROM
jc_alert_called jc_alert_called
WHERE WHERE 1 = 1
call_time BETWEEN #{beginDate} AND #{endDate} <if test="beginDate != null and beginDate != ''">
and call_time >= #{beginDate}
</if>
<if test="endDate != null and endDate != ''">
and call_time <![CDATA[ <= ]]> #{endDate}
</if>
</select> </select>
......
...@@ -42,9 +42,9 @@ ...@@ -42,9 +42,9 @@
<if test="params != null and params.size > 0 "> <if test="params != null and params.size > 0 ">
where 1=1 where 1=1
<foreach collection="params" index="key" item="value"> <foreach collection="params" index="key" item="value">
<if test="key != null and key == 'beginDate'"> <if test="key != null and key == 'beginDate' and value != null and value != ''">
and d.recDate >= #{value} and d.recDate >= #{value}
</if> </if>
<if test="key != null and key == 'endDate'"> <if test="key != null and key == 'endDate'">
and d.recDate <![CDATA[<=]]> #{value} and d.recDate <![CDATA[<=]]> #{value}
</if> </if>
......
...@@ -44,35 +44,66 @@ ...@@ -44,35 +44,66 @@
</select> </select>
<select id="getPowerTransferInfoCount" resultType="java.util.Map"> <select id="getPowerTransferInfoCount" resultType="java.util.Map">
select count(distinct pt.sequence_nbr) transfer_count, count(distinct resources_id) car_count, 0 end_count, 0 no_return_car_count select count(distinct pt.sequence_nbr) transfer_count, count(distinct ptcr.sequence_nbr) car_count, 0 end_count, 0
no_return_car_count
from jc_power_transfer pt from jc_power_transfer pt
left join jc_power_transfer_company ptc on pt.sequence_nbr = ptc.power_transfer_id left join jc_power_transfer_company ptc on pt.sequence_nbr = ptc.power_transfer_id
left join jc_power_transfer_company_resources ptcr on ptc.sequence_nbr = ptcr.power_transfer_company_id left join jc_power_transfer_company_resources ptcr on ptc.sequence_nbr = ptcr.power_transfer_company_id
where pt.rec_date BETWEEN #{beginDate} AND #{endDate} <where>
<if test="beginDate != null and beginDate != ''">
AND pt.rec_date &gt;= #{beginDate}
</if>
<if test="endDate != null and endDate != ''">
AND pt.rec_date &lt;= #{endDate}
</if>
</where>
order by pt.rec_date asc order by pt.rec_date asc
</select> </select>
<select id="getPowerTransferInfo" resultType="com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto"> <select id="getPowerTransferInfo" resultType="com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferDto">
select sequence_nbr, rescue_grid select sequence_nbr, rescue_grid
from jc_power_transfer pt from jc_power_transfer pt
where pt.rec_date BETWEEN #{beginDate} AND #{endDate} <where>
<if test="beginDate != null and beginDate != ''">
AND pt.rec_date &gt;= #{beginDate}
</if>
<if test="endDate != null and endDate != ''">
AND pt.rec_date &lt;= #{endDate}
</if>
</where>
order by pt.rec_date asc order by pt.rec_date asc
</select> </select>
<select id="getPowerTransferCompanyInfo" <select id="getPowerTransferCompanyInfo"
resultType="com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto"> resultType="com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto">
select ptc.sequence_nbr, ptc.company_name, ptc.is_distribution_agencies, ptc.power_transfer_id select ptc.sequence_nbr, ptc.company_name, ptc.is_distribution_agencies, ptc.power_transfer_id
from jc_power_transfer pt from jc_power_transfer pt
left join jc_power_transfer_company ptc on pt.sequence_nbr = ptc.power_transfer_id left join jc_power_transfer_company ptc on pt.sequence_nbr = ptc.power_transfer_id
where pt.rec_date BETWEEN #{beginDate} AND #{endDate} <where>
<if test="beginDate != null and beginDate != ''">
AND pt.rec_date &gt;= #{beginDate}
</if>
<if test="endDate != null and endDate != ''">
AND pt.rec_date &lt;= #{endDate}
</if>
</where>
order by pt.rec_date asc order by pt.rec_date asc
</select> </select>
<select id="getPowerTransferCompanyResourcesInfo" <select id="getPowerTransferCompanyResourcesInfo"
resultType="com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto"> resultType="com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto">
select ptcr.power_transfer_company_id, ptcr.type, ptcr.resources_num, ptcr.resources_id select ptcr.power_transfer_company_id, ptcr.type, ptcr.resources_num, ptcr.resources_id
from jc_power_transfer pt from jc_power_transfer pt
left join jc_power_transfer_company ptc on pt.sequence_nbr = ptc.power_transfer_id left join jc_power_transfer_company ptc on pt.sequence_nbr = ptc.power_transfer_id
left join jc_power_transfer_company_resources ptcr on ptc.sequence_nbr = ptcr.power_transfer_company_id left join jc_power_transfer_company_resources ptcr on ptc.sequence_nbr = ptcr.power_transfer_company_id
where pt.rec_date BETWEEN #{beginDate} AND #{endDate} where ptc.is_distribution_agencies = 0
and ptc.is_distribution_agencies = 0 <if test="beginDate != null and beginDate != ''">
AND pt.rec_date &gt;= #{beginDate}
</if>
<if test="endDate != null and endDate != ''">
AND pt.rec_date &lt;= #{endDate}
</if>
order by pt.rec_date asc order by pt.rec_date asc
</select> </select>
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<module>amos-boot-module-tzs-api</module> <module>amos-boot-module-tzs-api</module>
<module>amos-boot-module-jcs-api</module> <module>amos-boot-module-jcs-api</module>
<!-- <module>amos-boot-module-demo-api</module>--> <!-- <module>amos-boot-module-demo-api</module>-->
<module>amos-boot-module-common-api</module> <module>amos-boot-module-common-api</module>
<module>amos-boot-module-command-api</module>
</modules> </modules>
</project> </project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>amos-boot-module-biz</artifactId>
<groupId>com.amosframework.boot</groupId>
<version>1.0.0</version>
</parent>
<artifactId>amos-boot-module-command-biz</artifactId>
<dependencies>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-command-api</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-common-api</artifactId>
<version>${amos-biz-boot.version}</version>
</dependency>
</dependencies>
</project>
...@@ -149,9 +149,8 @@ public class DutyPersonController extends BaseController { ...@@ -149,9 +149,8 @@ public class DutyPersonController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation("查询当前值班人信息列表") @ApiOperation("查询当前值班人信息列表")
@GetMapping("/person/on_duty/list") @GetMapping("/person/on_duty/list")
public ResponseModel listOnDutyPerson(HttpServletRequest request) { public ResponseModel listOnDutyPerson() {
String appKey = request.getHeader("appKey"); return ResponseHelper.buildResponse(iDutyPersonService.listOnDutyPerson());
return ResponseHelper.buildResponse(iDutyPersonService.listOnDutyPerson(appKey));
} }
......
...@@ -112,7 +112,7 @@ public class DynamicFormColumnController extends BaseController { ...@@ -112,7 +112,7 @@ public class DynamicFormColumnController extends BaseController {
*列表全部数据查询 *列表全部数据查询
*@return *@return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "动态表单树形分组字段表列表全部数据查询", notes = "动态表单树形分组字段表列表全部数据查询") @ApiOperation(httpMethod = "GET",value = "动态表单树形分组字段表列表全部数据查询", notes = "动态表单树形分组字段表列表全部数据查询")
@GetMapping(value = "/{groupCode}/list") @GetMapping(value = "/{groupCode}/list")
public ResponseModel<List<DynamicFormInitDto>> selectForList(@PathVariable("groupCode") String groupCode) public ResponseModel<List<DynamicFormInitDto>> selectForList(@PathVariable("groupCode") String groupCode)
......
...@@ -78,5 +78,5 @@ public interface IDutyCommonService { ...@@ -78,5 +78,5 @@ public interface IDutyCommonService {
* *
* @return List<Map < String, Object>> * @return List<Map < String, Object>>
*/ */
List<Map<String, Object>> listOnDutyPerson(String appKey); List<Map<String, Object>> listOnDutyPerson();
} }
...@@ -186,9 +186,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -186,9 +186,9 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
String userId = d.get("userId").toString(); String userId = d.get("userId").toString();
List<DynamicFormInstance> instances = List<DynamicFormInstance> instances =
dynamicFormInstanceService.list(new LambdaQueryWrapper<DynamicFormInstance>() dynamicFormInstanceService.list(new LambdaQueryWrapper<DynamicFormInstance>()
.eq(DynamicFormInstance::getFieldCode, "userId") .eq(DynamicFormInstance::getFieldCode, "userId")
.eq(DynamicFormInstance::getFieldValue, userId) .eq(DynamicFormInstance::getFieldValue, userId)
.eq(DynamicFormInstance::getGroupCode, this.getGroupCode())); .eq(DynamicFormInstance::getGroupCode, this.getGroupCode()));
Long instanceId = null; Long instanceId = null;
List<DynamicFormColumn> columns = List<DynamicFormColumn> columns =
dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, this.getGroupCode())); dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, this.getGroupCode()));
...@@ -300,11 +300,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -300,11 +300,11 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
} }
@Override @Override
public List<Map<String, Object>> listOnDutyPerson(String appKey) { public List<Map<String, Object>> listOnDutyPerson() {
String groupCode = this.getGroupCode(); String groupCode = this.getGroupCode();
// 获取当前班次列表 // 获取当前班次列表
DateTime now = new DateTime(); DateTime now = new DateTime();
List<Long> shiftIdList = getOnDuty(now, appKey); List<Long> shiftIdList = getOnDuty(now);
String shiftIds = StringUtils.join(shiftIdList.toArray(), ","); String shiftIds = StringUtils.join(shiftIdList.toArray(), ",");
String dutyDay = now.toString("yyyy-MM-dd"); String dutyDay = now.toString("yyyy-MM-dd");
// 获取当前值班人员 // 获取当前值班人员
...@@ -312,7 +312,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -312,7 +312,7 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode)); dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class); Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
List<Map<String, Object>> maps = dynamicFormInstanceService.getBaseMapper().listOnDutyPerson(dutyDay, List<Map<String, Object>> maps = dynamicFormInstanceService.getBaseMapper().listOnDutyPerson(dutyDay,
shiftIds, fieldCodes, RequestContext.getAppKey(), groupCode); shiftIds, fieldCodes, groupCode);
// 获取人员照片和电话 // 获取人员照片和电话
List<Long> ids = new ArrayList<>(); List<Long> ids = new ArrayList<>();
maps.forEach(item -> ids.add(Long.valueOf(String.valueOf(item.get("userId"))))); maps.forEach(item -> ids.add(Long.valueOf(String.valueOf(item.get("userId")))));
...@@ -334,8 +334,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService { ...@@ -334,8 +334,8 @@ public class DutyCommonServiceImpl implements IDutyCommonService {
return maps; return maps;
} }
private List<Long> getOnDuty(DateTime now, String appKey) { private List<Long> getOnDuty(DateTime now) {
List<DutyShiftDto> dutyShiftDtos = dutyShiftService.queryForDutyShiftList(appKey, false); List<DutyShiftDto> dutyShiftDtos = dutyShiftService.queryForDutyShiftList(false);
List<Long> shiftIds = new ArrayList<>(); List<Long> shiftIds = new ArrayList<>();
int hour = now.getHourOfDay(); int hour = now.getHourOfDay();
int minute = now.getMinuteOfHour(); int minute = now.getMinuteOfHour();
......
...@@ -31,4 +31,8 @@ public class DutyShiftServiceImpl extends BaseService<DutyShiftDto, DutyShift, D ...@@ -31,4 +31,8 @@ public class DutyShiftServiceImpl extends BaseService<DutyShiftDto, DutyShift, D
public List<DutyShiftDto> queryForDutyShiftList(String appKey, Boolean isDelete) { public List<DutyShiftDto> queryForDutyShiftList(String appKey, Boolean isDelete) {
return this.queryForList("", false, appKey, isDelete); return this.queryForList("", false, appKey, isDelete);
} }
public List<DutyShiftDto> queryForDutyShiftList(Boolean isDelete) {
return this.queryForList("", false, isDelete);
}
} }
...@@ -163,9 +163,12 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD ...@@ -163,9 +163,12 @@ public class DynamicFormColumnServiceImpl extends BaseService<DynamicFormColumnD
default: default:
vo = new DynamicFormInitDto(dynamicForm.getFieldCode(), dynamicForm.getFieldName(), vo = new DynamicFormInitDto(dynamicForm.getFieldCode(), dynamicForm.getFieldName(),
dynamicForm.getFieldType(), new SelectItems(new ArrayList<>()), null); dynamicForm.getFieldType(), new SelectItems(new ArrayList<>()), null);
dynamicFormValue = new DynamicFormInstanceDto(dynamicForm.getSequenceNbr(), dynamicForm.getFieldName(), dynamicFormValue = new DynamicFormInstanceDto();
dynamicForm.getFieldCode(), dynamicForm.getBlock(), dynamicForm.getGroupCode()); BeanUtils.copyProperties(dynamicForm, dynamicFormValue);
dynamicFormValue.setSequenceNbr(null);
dynamicFormValue.setFormColumnId(dynamicForm.getSequenceNbr());
dynamicFormValue.setAppKey(appKey); dynamicFormValue.setAppKey(appKey);
vo.setFormItemDescr(dynamicFormValue); vo.setFormItemDescr(dynamicFormValue);
vo.setSort(dynamicFormValue.getSort()); vo.setSort(dynamicFormValue.getSort());
listfrom.add(vo); listfrom.add(vo);
......
...@@ -139,8 +139,6 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta ...@@ -139,8 +139,6 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta
localMap.putAll(parameterMap); localMap.putAll(parameterMap);
localMap.remove("current"); localMap.remove("current");
localMap.remove("size"); localMap.remove("size");
localMap.remove("beginDate");
localMap.remove("endDate");
Map<String, String> params = new HashMap<>(); Map<String, String> params = new HashMap<>();
if (!ValidationUtil.isEmpty(localMap)) { if (!ValidationUtil.isEmpty(localMap)) {
for (String key : localMap.keySet()) { for (String key : localMap.keySet()) {
......
...@@ -130,7 +130,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -130,7 +130,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
Object entity = clazz.cast(ob); Object entity = clazz.cast(ob);
parentId = PARENTIDMethodNameme.invoke(entity) != null parentId = !ObjectUtils.isEmpty(PARENTIDMethodNameme.invoke(entity))
? Long.valueOf(String.valueOf(PARENTIDMethodNameme.invoke(entity))) ? Long.valueOf(String.valueOf(PARENTIDMethodNameme.invoke(entity)))
: null; : null;
...@@ -181,7 +181,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -181,7 +181,7 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
for (Object ob : entityList) { for (Object ob : entityList) {
Object entity = clazz.cast(ob); Object entity = clazz.cast(ob);
parentId = PARENTIDMethodNameme.invoke(entity) != null parentId = !ObjectUtils.isEmpty(PARENTIDMethodNameme.invoke(entity))
? Long.valueOf(String.valueOf(PARENTIDMethodNameme.invoke(entity))) ? Long.valueOf(String.valueOf(PARENTIDMethodNameme.invoke(entity)))
: null; : null;
......
package com.yeejoin.amos.boot.module.jcs.biz.config;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpHost;
import org.apache.http.client.config.RequestConfig;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class ElasticSearchClientConfig {
@Value("${spring.elasticsearch.rest.uris}")
private String uris;
@Bean
@Qualifier("highLevelClient")
public RestHighLevelClient restHighLevelClient() {
try {
String url = uris.replace("http://", "");
final String[] parts = StringUtils.split(url, ":");
HttpHost httpHost = new HttpHost(parts[0], Integer.parseInt(parts[1]), "http");
RestClientBuilder builder = RestClient.builder(httpHost);
builder.setRequestConfigCallback(new RestClientBuilder.RequestConfigCallback() {
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
@Override
public RequestConfig.Builder customizeRequestConfig(
RequestConfig.Builder requestConfigBuilder) {
return requestConfigBuilder.setConnectTimeout(5000 * 1000) // 连接超时(默认为1秒)
.setSocketTimeout(6000 * 1000);// 套接字超时(默认为30秒)//更改客户端的超时限制默认30秒现在改为100*1000分钟
}
});// 调整最大重试超时时间(默认为30秒).setMaxRetryTimeoutMillis(60000);
return new RestHighLevelClient(builder);
} catch (Exception e) {
throw new IllegalStateException("Invalid ES nodes " + "property '" + uris + "'", e);
}
}
}
...@@ -283,7 +283,7 @@ public class AlertCalledController extends BaseController { ...@@ -283,7 +283,7 @@ public class AlertCalledController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/dateRange/list") @GetMapping(value = "/dateRange/list")
@ApiOperation(httpMethod = "GET", value = "查询指定日期内警情列表", notes = "查询指定日期内警情列表") @ApiOperation(httpMethod = "GET", value = "查询指定日期内警情列表", notes = "查询指定日期内警情列表")
public ResponseModel<Map<String, Object>> listByDateRange(@RequestParam("beginDate") String beginDate, public ResponseModel<Map<String, Object>> listByDateRange(@RequestParam(value = "beginDate", required = false) String beginDate,
@RequestParam("endDate") String endDate) { @RequestParam("endDate") String endDate) {
return ResponseHelper.buildResponse(iAlertCalledService.getAlertInfoList(beginDate, endDate)); return ResponseHelper.buildResponse(iAlertCalledService.getAlertInfoList(beginDate, endDate));
} }
......
...@@ -89,7 +89,7 @@ public class ExcelController extends BaseController { ...@@ -89,7 +89,7 @@ public class ExcelController extends BaseController {
@Autowired @Autowired
IDutyPersonService iDutyPersonService; IDutyPersonService iDutyPersonService;
private static final String NOT_DUTY = "休"; private static final String NOT_DUTY = "休";
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
...@@ -677,20 +677,8 @@ public class ExcelController extends BaseController { ...@@ -677,20 +677,8 @@ public class ExcelController extends BaseController {
list.add(o.getPostTypeName()); list.add(o.getPostTypeName());
List<DutyPersonShiftDto> dutyShift = o.getDutyShift(); List<DutyPersonShiftDto> dutyShift = o.getDutyShift();
initDutyShift(dayByMonth, dutyShift, list);
HashMap<String, String> dutyShiftMap = new HashMap<>();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
dutyShift.forEach(item -> dutyShiftMap.put(format.format(item.getDutyDate()), item.getShiftName()));
if (!dutyShift.isEmpty()) {
for (int i = 0; i < dayByMonth.size(); i++) {
if (dutyShiftMap.containsKey(dayByMonth.get(i))) {
list.add(dutyShiftMap.get(dayByMonth.get(i)));
} else {
list.add(NOT_DUTY);
}
}
}
data.add(list); data.add(list);
}); });
} }
...@@ -713,26 +701,28 @@ public class ExcelController extends BaseController { ...@@ -713,26 +701,28 @@ public class ExcelController extends BaseController {
list.add(o.getCarName()); list.add(o.getCarName());
List<DutyPersonShiftDto> dutyShift = o.getDutyShift(); List<DutyPersonShiftDto> dutyShift = o.getDutyShift();
initDutyShift(dayByMonth, dutyShift, list);
HashMap<String, String> dutyShiftMap = new HashMap<>();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
dutyShift.forEach(item -> dutyShiftMap.put(format.format(item.getDutyDate()), item.getShiftName()));
if (!dutyShift.isEmpty()) {
for (int i = 0; i < dayByMonth.size(); i++) {
if (dutyShiftMap.containsKey(dayByMonth.get(i))) {
list.add(dutyShiftMap.get(dayByMonth.get(i)));
} else {
list.add(NOT_DUTY);
}
}
}
data.add(list); data.add(list);
}); });
} }
return data; return data;
} }
private void initDutyShift(List<String> dayByMonth, List<DutyPersonShiftDto> dutyShift, ArrayList<Object> list) {
HashMap<String, String> dutyShiftMap = new HashMap<>();
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
dutyShift.forEach(item -> dutyShiftMap.put(format.format(item.getDutyDate()), item.getShiftName()));
for (int i = 0; i < dayByMonth.size(); i++) {
if (dutyShiftMap.containsKey(dayByMonth.get(i))) {
list.add(dutyShiftMap.get(dayByMonth.get(i)));
} else {
list.add(NOT_DUTY);
}
}
}
private void exportDutyTemplate(HttpServletResponse response, String classUrl, List<String> dayByMonth, private void exportDutyTemplate(HttpServletResponse response, String classUrl, List<String> dayByMonth,
ExcelDto excelDto, List<? extends Object> data, Boolean flag) { ExcelDto excelDto, List<? extends Object> data, Boolean flag) {
try { try {
......
...@@ -188,8 +188,8 @@ public class PowerTransferController extends BaseController { ...@@ -188,8 +188,8 @@ public class PowerTransferController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/power/list") @GetMapping(value = "/power/list")
@ApiOperation(value = "力量出动列表", notes = "力量调派资源树") @ApiOperation(value = "力量出动列表", notes = "力量调派资源树")
public ResponseModel<Object> getPowerTransferList(@ApiParam(value = "开始日期", required = true) @RequestParam String beginDate, public ResponseModel<Object> getPowerTransferList(@ApiParam(value = "开始日期") @RequestParam(defaultValue = "") String beginDate,
@ApiParam(value = "结束日期", required = true) @RequestParam String endDate) { @ApiParam(value = "结束日期") @RequestParam(defaultValue = "") String endDate) {
return ResponseHelper.buildResponse(powerTransferService.getPowerTransferList(beginDate, endDate)); return ResponseHelper.buildResponse(powerTransferService.getPowerTransferList(beginDate, endDate));
} }
......
...@@ -245,6 +245,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -245,6 +245,16 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
} }
} }
private static int comparingByGroupVal(Map<String, Object> map, Map<String, Object> map2, String key) {
int result = 0;
if (map.get(key) instanceof Date) {
long r1 = ((Date) map.get(key)).getTime();
long r2 = ((Date) map2.get(key)).getTime();
result = Long.compare(r1, r2);
}
return result;
}
/** /**
* 根据时间区间查询警情列表信息 * 根据时间区间查询警情列表信息
* *
...@@ -253,8 +263,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -253,8 +263,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
*/ */
public List<Map<String, Object>> listByDateRange(String beginDate, String endDate) { public List<Map<String, Object>> listByDateRange(String beginDate, String endDate) {
// 查询指定日期内的警情列表 // 查询指定日期内的警情列表
List<AlertCalled> alertCalledList = List<AlertCalled> alertCalledList =
this.list(new LambdaQueryWrapper<AlertCalled>().between(AlertCalled::getCallTime, beginDate, endDate)); this.list(new LambdaQueryWrapper<AlertCalled>().apply(!ValidationUtil.isEmpty(beginDate),
"call_time >= '" + beginDate + "'").le(true, AlertCalled::getCallTime, endDate));
Map<String, String> queryParams = Maps.newHashMap(); Map<String, String> queryParams = Maps.newHashMap();
queryParams.put("beginDate", beginDate); queryParams.put("beginDate", beginDate);
queryParams.put("endDate", endDate); queryParams.put("endDate", endDate);
...@@ -264,8 +276,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -264,8 +276,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
alertCalledList.stream().collect(Collectors.groupingBy(AlertCalled::getAlertTypeCode)); alertCalledList.stream().collect(Collectors.groupingBy(AlertCalled::getAlertTypeCode));
Map<Long, AlertCalled> calledMap = Map<Long, AlertCalled> calledMap =
alertCalledList.stream().collect(Collectors.toMap(AlertCalled::getSequenceNbr, Function.identity())); alertCalledList.stream().collect(Collectors.toMap(AlertCalled::getSequenceNbr, Function.identity()));
alertCalledMap.forEach((alert, list) -> { alertCalledMap.forEach((alertTypeCode, list) -> {
allList.addAll(iAlertFormValueService.listAll(alert, queryParams)); allList.addAll(iAlertFormValueService.listAll(alertTypeCode, queryParams));
}); });
allList.forEach(i -> { allList.forEach(i -> {
...@@ -273,6 +285,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -273,6 +285,8 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
i.putAll(Bean.BeantoMap(alertCalled)); i.putAll(Bean.BeantoMap(alertCalled));
}); });
} }
// 按接警时间正序排序
allList.sort((e, o) -> comparingByGroupVal(e, o, "callTime"));
return allList; return allList;
} }
......
...@@ -27,12 +27,6 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; ...@@ -27,12 +27,6 @@ import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.ESAlertCalled; import com.yeejoin.amos.boot.module.jcs.api.entity.ESAlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum; import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStatusEnum;
import com.yeejoin.amos.boot.module.jcs.biz.dao.ESAlertCalledRepository; import com.yeejoin.amos.boot.module.jcs.biz.dao.ESAlertCalledRepository;
import javax.annotation.PostConstruct;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
/** /**
* *
* <pre> * <pre>
...@@ -274,18 +268,26 @@ public class ESAlertCalledService { ...@@ -274,18 +268,26 @@ public class ESAlertCalledService {
//过滤条件 //过滤条件
.withQuery(boolMust); .withQuery(boolMust);
// 对高亮词条进行操作
SearchHits<ESAlertCalled> searchHits =elasticsearchTemplate.search(queryBuilder.build(), ESAlertCalled.class);
List<ESAlertCalledDto> list = new LinkedList<>(); List<ESAlertCalledDto> list = new LinkedList<>();
for (SearchHit searchHit : searchHits.getSearchHits()) long totle = 0;
try
{
SearchHits<ESAlertCalled> searchHits =elasticsearchTemplate.search(queryBuilder.build(), ESAlertCalled.class);
for (SearchHit searchHit : searchHits.getSearchHits())
{
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(searchHit.getContent());
ESAlertCalledDto eSAlertCalled =JSONObject.toJavaObject(jsonObject, ESAlertCalledDto.class);
list.add(eSAlertCalled);
}
totle =searchHits.getTotalHits();
}
catch (Exception e)
{ {
JSONObject jsonObject = (JSONObject) JSONObject.toJSON(searchHit.getContent()); // TODO: handle exception
ESAlertCalledDto eSAlertCalled =JSONObject.toJavaObject(jsonObject, ESAlertCalledDto.class);
list.add(eSAlertCalled);
} }
result.setRecords(list); result.setRecords(list);
result.setTotal(searchHits.getTotalHits()); result.setTotal(totle);
return result; return result;
} }
......
...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject; ...@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Sequence; import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.google.common.base.Joiner;
import com.itextpdf.text.*; import com.itextpdf.text.*;
import com.itextpdf.text.pdf.BaseFont; import com.itextpdf.text.pdf.BaseFont;
import com.itextpdf.text.pdf.PdfPTable; import com.itextpdf.text.pdf.PdfPTable;
...@@ -11,19 +12,26 @@ import com.yeejoin.amos.boot.biz.common.utils.PdfUtils; ...@@ -11,19 +12,26 @@ import com.yeejoin.amos.boot.biz.common.utils.PdfUtils;
import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance; import com.yeejoin.amos.boot.module.common.api.entity.DynamicFormInstance;
import com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormInstanceServiceImpl; import com.yeejoin.amos.boot.module.common.biz.service.impl.DynamicFormInstanceServiceImpl;
import com.yeejoin.amos.boot.module.jcs.api.dto.ShiftChangeDto; import com.yeejoin.amos.boot.module.jcs.api.dto.ShiftChangeDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ShiftChangeDutyDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ShiftChangeInfoDto; import com.yeejoin.amos.boot.module.jcs.api.dto.ShiftChangeInfoDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.ShiftChangePowerDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.ShiftChange; import com.yeejoin.amos.boot.module.jcs.api.entity.ShiftChange;
import com.yeejoin.amos.boot.module.jcs.api.mapper.ShiftChangeMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.ShiftChangeMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IShiftChangeService; import com.yeejoin.amos.boot.module.jcs.api.service.IShiftChangeService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import springfox.documentation.spring.web.json.Json;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.Comparator; import java.util.Comparator;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -121,20 +129,29 @@ public class ShiftChangeServiceImpl extends BaseService<ShiftChangeDto, ShiftCha ...@@ -121,20 +129,29 @@ public class ShiftChangeServiceImpl extends BaseService<ShiftChangeDto, ShiftCha
@Override @Override
public void exportPdfById(HttpServletResponse response, Long shiftChangeId) throws IOException, DocumentException { public void exportPdfById(HttpServletResponse response, Long shiftChangeId) throws IOException, DocumentException {
// 告诉浏览器用什么软件可以打开此文件 // 告诉浏览器用什么软件可以打开此文件
response.setHeader("content-Type", "application/pdf"); response.setHeader("content-Type", "application/pdf;charset=UTF-8");
response.setContentType("application/pdf;charset=UTF-8");
// 下载文件的默认名称 // 下载文件的默认名称
response.setHeader("Content-Disposition", "attachment;filename=交接班记录表.pdf"); String fileName = "交接班记录表.pdf";
response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(fileName,
StandardCharsets.UTF_8.name()));
// 创建document对象 // 创建document对象
Document document = PdfUtils.createFile(response); Document document = PdfUtils.createFile(response);
// 获取pdf文件数据 // 获取pdf文件数据
ShiftChangeDto shiftChange = this.queryBySeq(shiftChangeId); ShiftChangeDto shiftChange = this.queryBySeq(shiftChangeId);
Map<String, Object> baseInfo = dynamicFormInstanceService.getOneMap(shiftChange.getInstanceId(), GROUP_CODE); ShiftChangeInfoDto ShiftChangeInfoDto = new ShiftChangeInfoDto();
ShiftChangeInfoDto ShiftChangeInfoDto = (ShiftChangeInfoDto) Bean.mapToBean(baseInfo, ShiftChangeInfoDto.class); if (shiftChange != null) {
Map<String, Object> baseInfo = dynamicFormInstanceService.getOneMap(shiftChange.getInstanceId(), GROUP_CODE);
ShiftChangeInfoDto = (ShiftChangeInfoDto) Bean.mapToBean(baseInfo, ShiftChangeInfoDto.class);
} else {
shiftChange = new ShiftChangeDto();
}
// 创建pdf格式 // 创建pdf格式
createPDFReport(document,ShiftChangeInfoDto,shiftChange); createPDFReport(document,ShiftChangeInfoDto,shiftChange);
} }
/**
* 创建pdf文件样式数据
*/
public void createPDFReport(Document document,ShiftChangeInfoDto shiftChangeInfoDto,ShiftChangeDto shiftChange) throws IOException, DocumentException { public void createPDFReport(Document document,ShiftChangeInfoDto shiftChangeInfoDto,ShiftChangeDto shiftChange) throws IOException, DocumentException {
document.open(); document.open();
// 基本样式参数 // 基本样式参数
...@@ -142,57 +159,107 @@ public class ShiftChangeServiceImpl extends BaseService<ShiftChangeDto, ShiftCha ...@@ -142,57 +159,107 @@ public class ShiftChangeServiceImpl extends BaseService<ShiftChangeDto, ShiftCha
Font cellContent = new Font(bfChinese, 11, Font.NORMAL); Font cellContent = new Font(bfChinese, 11, Font.NORMAL);
Font cellTitle = new Font(bfChinese, 11, Font.BOLD); Font cellTitle = new Font(bfChinese, 11, Font.BOLD);
Font title = new Font(bfChinese, 20, Font.BOLD); Font title = new Font(bfChinese, 20, Font.BOLD);
int size = 35; int size = 30;
int smallSize = 0;
// 表头 // 表头
Paragraph docTitle = new Paragraph("119接警坐席交接班记录\n", title); Paragraph docTitle = new Paragraph("119接警坐席交接班记录\n", title);
docTitle.setAlignment(Element.ALIGN_CENTER); docTitle.setAlignment(Element.ALIGN_CENTER);
// docTitle.setSpacingBefore(20);
// 表格内容 // 表格内容
PdfPTable table1 = PdfUtils.createTable(8); PdfPTable table1 = PdfUtils.createTable(8);
int[] widths = { 12, 25, 25, 25, 25, 20, 25, 25 };
table1.setWidthPercentage(100); table1.setWidthPercentage(100);
table1.setSpacingBefore(10); table1.setSpacingBefore(10);
table1.setWidths(widths);
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd HH:mm:ss" );
String recDare = shiftChange.getRecDate() != null ? sdf.format(shiftChange.getRecDate()) : "";
// 第一行 // 第一行
table1.addCell(PdfUtils.createCell("时间:", cellTitle,Element.ALIGN_CENTER,1,1,size)); table1.addCell(PdfUtils.createCell("时间", cellTitle,Element.ALIGN_CENTER,1,1,
table1.addCell(PdfUtils.createCell(shiftChange.getRecDate().toString(), cellContent,Element.ALIGN_CENTER,3,1,size)); size,1,1,0,1));
table1.addCell(PdfUtils.createCell("值班领导:", cellTitle,Element.ALIGN_CENTER,1,1,size)); table1.addCell(PdfUtils.createCell(recDare, cellContent,Element.ALIGN_CENTER,3,1,
table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getJsDutyLeader(), cellContent,Element.ALIGN_CENTER,3,1,size)); size,1,1,0,0));
table1.addCell(PdfUtils.createCell("值班领导", cellTitle,Element.ALIGN_CENTER,1,1,
size,1,1,0,0));
table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getJsDutyLeader(), cellContent,Element.ALIGN_CENTER,3,1,
size,1,1,0,0));
// 第二行 // 第二行
table1.addCell(PdfUtils.createCell("值班员", cellTitle,Element.ALIGN_CENTER,1,3,size)); table1.addCell(PdfUtils.createCell("值\n班\n员", cellTitle,Element.ALIGN_CENTER,1,3,
table1.addCell(PdfUtils.createCell("正班", cellTitle,Element.ALIGN_CENTER,1,1,size)); size,1,1,0,1));
table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getDutyPersonOne(), cellContent,Element.ALIGN_CENTER,1,1,size)); table1.addCell(PdfUtils.createCell("正班", cellTitle,Element.ALIGN_CENTER,1,1,
table1.addCell(PdfUtils.createCell("值班开始时间", cellContent,Element.ALIGN_CENTER,1,1,size)); size,1,1,0,0));
table1.addCell(PdfUtils.createCell("交接班时间", cellContent,Element.ALIGN_CENTER,1,1,size)); table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getDutyPersonOne(), cellContent,Element.ALIGN_CENTER,1,1,
table1.addCell(PdfUtils.createCell("接班员", cellTitle,Element.ALIGN_CENTER,1,3,size)); size,1,1,0,0));
table1.addCell(PdfUtils.createCell("正班", cellTitle,Element.ALIGN_CENTER,1,1,size)); table1.addCell(PdfUtils.createCell("值班开始时间", cellContent,Element.ALIGN_CENTER,1,1,size,1,1,0,0));
table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getSucceedPersonOne(), cellContent,Element.ALIGN_CENTER,1,1,size)); table1.addCell(PdfUtils.createCell("交接班时间", cellContent,Element.ALIGN_CENTER,1,1,size,1,1,0,0));
table1.addCell(PdfUtils.createCell("接班员", cellTitle,Element.ALIGN_CENTER,1,3,size,1,1,0,0));
table1.addCell(PdfUtils.createCell("正班", cellTitle,Element.ALIGN_CENTER,1,1,size,1,1,0,0));
table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getSucceedPersonOne(), cellContent,Element.ALIGN_CENTER,1,1,size,1,1,0,0));
// 第三行 // 第三行
table1.addCell(PdfUtils.createCell("副班", cellTitle,Element.ALIGN_CENTER,1,1,size)); table1.addCell(PdfUtils.createCell("副班", cellTitle,Element.ALIGN_CENTER,1,1,size,1,1,0,0));
table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getDutyPersonTwo(), cellContent,Element.ALIGN_CENTER,1,1,size)); table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getDutyPersonTwo(), cellContent,Element.ALIGN_CENTER,1,1,size,1,1,0,0));
table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getBeginDate(), cellContent,Element.ALIGN_CENTER,1,1,size)); table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getBeginDate(), cellContent,Element.ALIGN_CENTER,1,1,size,1,1,0,0));
table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getEndDate(), cellContent,Element.ALIGN_CENTER,1,1,size)); table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getEndDate(), cellContent,Element.ALIGN_CENTER,1,1,size,1,1,0,0));
table1.addCell(PdfUtils.createCell("副班", cellTitle,Element.ALIGN_CENTER,1,1,size)); table1.addCell(PdfUtils.createCell("副班", cellTitle,Element.ALIGN_CENTER,1,1,size,1,1,0,0));
table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getSucceedPersonTwo(), cellContent,Element.ALIGN_CENTER,1,1,size)); table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getSucceedPersonTwo(), cellContent,Element.ALIGN_CENTER,1,1,size,1,1,0,0));
// 第四行 // 第四行
table1.addCell(PdfUtils.createCell("经理", cellTitle,Element.ALIGN_CENTER,1,1,size)); table1.addCell(PdfUtils.createCell("经理", cellTitle,Element.ALIGN_CENTER,1,1,size,1,1,0,0));
table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getDutyPersonLeader(), cellContent,Element.ALIGN_CENTER,3,1,size)); table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getDutyPersonLeader(), cellContent,Element.ALIGN_CENTER,3,1,size,1,1,0,0));
table1.addCell(PdfUtils.createCell("经理", cellTitle,Element.ALIGN_CENTER,1,1,size)); table1.addCell(PdfUtils.createCell("经理", cellTitle,Element.ALIGN_CENTER,1,1,size,1,1,0,0));
table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getSucceedPersonLeader(), cellContent,Element.ALIGN_CENTER,1,1,size)); table1.addCell(PdfUtils.createCell(shiftChangeInfoDto.getSucceedPersonLeader(), cellContent,Element.ALIGN_CENTER,1,1,size,1,1,0,0));
JSONObject dutyJson = shiftChange.getDutyJson();
JSONObject powerJson = shiftChange.getPowerJson();
ShiftChangeDutyDto dutyDto = new ShiftChangeDutyDto();
ShiftChangePowerDto powerDto = new ShiftChangePowerDto();
if (dutyJson != null) {
dutyDto = JSONObject.toJavaObject(dutyJson, ShiftChangeDutyDto.class);
}
if (powerJson != null) {
powerDto = JSONObject.toJavaObject(powerJson, ShiftChangePowerDto.class);
}
List<String> infoList = dutyDto.getAlertInfoList();
List<String> powerList = powerDto.getTransferContent();
int infoSize = infoList != null ? infoList.size() : 0;
int powerSize = powerList != null ? powerList.size() : 0;
String alarmRemark = dutyDto.getAlarmRemark() == null ? "无" : dutyDto.getAlarmRemark();
String powerRemark = powerDto.getPowerRemark() == null ? "无" : powerDto.getPowerRemark();
// 值班情况 // 值班情况
table1.addCell(PdfUtils.createCell("值班情况", cellTitle,Element.ALIGN_LEFT,1,4,size)); table1.addCell(PdfUtils.createCell("值\n班\n情\n况", cellTitle,Element.ALIGN_CENTER,1,6+powerSize+infoSize,size,1,1,0,1));
table1.addCell(PdfUtils.createCell("接警情况:", cellContent,Element.ALIGN_LEFT,7,1,size)); table1.addCell(PdfUtils.createCell("接警情况:", cellTitle,Element.ALIGN_LEFT,7,1,size,1,1,0,0));
table1.addCell(PdfUtils.createCell(shiftChange.getDutyJson().toString(), cellContent,Element.ALIGN_LEFT,7,1,120)); table1.addCell(PdfUtils.createCell("接警"+ dutyDto.getCalledCount() +"起", cellContent, Element.ALIGN_CENTER,1,1,smallSize,0,0,0,0));
table1.addCell(PdfUtils.createCell("力量出动:", cellContent,Element.ALIGN_LEFT,7,1,size)); table1.addCell(PdfUtils.createCell("未结案" + dutyDto.getUnFinishedCount() + "起", cellContent,Element.ALIGN_CENTER,2,1,smallSize,0,0,0,0));
table1.addCell(PdfUtils.createCell(shiftChange.getPowerJson().toString(), cellContent,Element.ALIGN_LEFT,7,1,120)); table1.addCell(PdfUtils.createCell("已结案" + dutyDto.getFinishedCount() + "起", cellContent,Element.ALIGN_CENTER,2,1,smallSize,0,0,0,0));
table1.addCell(PdfUtils.createCell("重大警情" + dutyDto.getMajorAlertCount() + "起", cellContent,Element.ALIGN_CENTER,2,1,smallSize,0,1,0,0));
if (!ObjectUtils.isEmpty(infoList)) {
for (String info : infoList) {
table1.addCell(PdfUtils.createCell(info, cellContent,Element.ALIGN_LEFT,7,1,smallSize,0,1,0,0));
}
}
table1.addCell(PdfUtils.createCell("备注:"+alarmRemark, cellContent,Element.ALIGN_LEFT,7,1,smallSize,0,1,0,0));
table1.addCell(PdfUtils.createCell("力量出动:", cellTitle,Element.ALIGN_LEFT,7,1,size,0,1,0,0));
table1.addCell(PdfUtils.createCell("调派任务"+ powerDto.getTransfer_count() +"起", cellContent,Element.ALIGN_CENTER,1,1,smallSize,0,0,0,0));
table1.addCell(PdfUtils.createCell("调派车辆" + powerDto.getCar_count() + "辆次", cellContent,Element.ALIGN_CENTER,2,1,smallSize,0,0,0,0));
table1.addCell(PdfUtils.createCell("已完成任务" + powerDto.getEnd_count() + "起", cellContent,Element.ALIGN_CENTER,2,1,smallSize,0,0,0,0));
table1.addCell(PdfUtils.createCell("未归队车辆" + powerDto.getNo_return_car_count() + "辆", cellContent,Element.ALIGN_CENTER,2,1,smallSize,0,1,0,0));
if (!ObjectUtils.isEmpty(powerList)) {
for (String powerInfo : powerList) {
table1.addCell(PdfUtils.createCell(powerInfo, cellContent,Element.ALIGN_LEFT,7,1,smallSize,0,1,0,0));
}
}
table1.addCell(PdfUtils.createCell("备注:"+powerRemark, cellContent,Element.ALIGN_LEFT,7,1,smallSize,0,1,0,0));
// 移交事宜 // 移交事宜
table1.addCell(PdfUtils.createCell("移交事宜", cellTitle,Element.ALIGN_LEFT,1,1,size)); table1.addCell(PdfUtils.createCell("移\n交\n事\n宜", cellTitle,Element.ALIGN_CENTER,1,1,size,1,1,1,1));
table1.addCell(PdfUtils.createCell(shiftChange.getRemark(), cellContent,Element.ALIGN_LEFT,7,1,120)); table1.addCell(PdfUtils.createCell(shiftChange.getRemark(), cellContent,Element.ALIGN_LEFT,7,1,120,1,1,1,0));
try{ try{
document.add(docTitle); document.add(docTitle);
......
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