Commit fa86f636 authored by 李腾威's avatar 李腾威

linux 下生成word文件保存解决

parent 190e7c25
...@@ -342,9 +342,11 @@ AND cft.type_code = ( ...@@ -342,9 +342,11 @@ AND cft.type_code = (
</select> </select>
<select id='queryByCompanyId' resultType="map"> <select id='queryByCompanyId' resultType="map">
select biz_org_name as bizOrgName,sequence_nbr sequenceNbr,field_value as telephone, amosUserId from ( select biz_org_name as bizOrgName,sequence_nbr sequenceNbr,field_value as telephone, amosUserId,companyName from (
select orgUsr.biz_org_name,i.field_value,orgUsr.sequence_nbr,orgUsr.amos_org_id amosUserId select orgUsr.biz_org_name,i.field_value,orgUsr.sequence_nbr,orgUsr.amos_org_id amosUserId, cou1.biz_org_name companyName
from cb_org_usr orgUsr left join cb_dynamic_form_instance i on orgUsr.sequence_nbr = from (select * from cb_org_usr cou where is_delete = 0 ) orgUsr
left join cb_org_usr cou1 on orgUsr.parent_id = cou1.sequence_nbr
left join cb_dynamic_form_instance i on orgUsr.sequence_nbr =
i.instance_id where i.field_code = 'telephone') as d i.instance_id where i.field_code = 'telephone') as d
where d.sequence_nbr in ( where d.sequence_nbr in (
select userId from ( select userId from (
...@@ -367,9 +369,11 @@ AND cft.type_code = ( ...@@ -367,9 +369,11 @@ AND cft.type_code = (
<select id='queryByCompanyNew' resultType="map"> <select id='queryByCompanyNew' resultType="map">
select biz_org_name as bizOrgName,sequence_nbr sequenceNbr,field_value as telephone,amosUserId from ( select biz_org_name as bizOrgName,sequence_nbr sequenceNbr,field_value as telephone, amosUserId,companyName from (
select orgUsr.biz_org_name,i.field_value,orgUsr.sequence_nbr,orgUsr.amos_org_id amosUserId select orgUsr.biz_org_name,i.field_value,orgUsr.sequence_nbr,orgUsr.amos_org_id amosUserId, cou1.biz_org_name companyName
from cb_org_usr orgUsr left join cb_dynamic_form_instance i on orgUsr.sequence_nbr = from (select * from cb_org_usr cou where is_delete = 0 ) orgUsr
left join cb_org_usr cou1 on orgUsr.parent_id = cou1.sequence_nbr
left join cb_dynamic_form_instance i on orgUsr.sequence_nbr =
i.instance_id where i.field_code = 'telephone') as d i.instance_id where i.field_code = 'telephone') as d
where d.sequence_nbr in ( where d.sequence_nbr in (
select userId from ( select userId from (
......
...@@ -179,7 +179,7 @@ ...@@ -179,7 +179,7 @@
mobile_phone as mobilePhone, mobile_phone as mobilePhone,
amos_user_id amosUserId amos_user_id amosUserId
FROM FROM
cb_firefighters firefighters (select * from cb_firefighters fr where is_delete = 0) firefighters
WHERE WHERE
fire_team_id in ( select sequence_nbr from cb_fire_team cft where company in ( fire_team_id in ( select sequence_nbr from cb_fire_team cft where company in (
select sequence_nbr from cb_org_usr cou where biz_org_name = #{name}) ) select sequence_nbr from cb_org_usr cou where biz_org_name = #{name}) )
......
...@@ -688,16 +688,16 @@ LEFT JOIN ( ...@@ -688,16 +688,16 @@ LEFT JOIN (
</select> </select>
<select id="queryCompanyId" resultType="map"> <select id="queryCompanyId" resultType="map">
select * from ( select d.*,cbo.biz_org_name companyName from (
select cou.biz_org_name bizOrgName,cou.sequence_nbr sequenceNbr ,cou .parent_id parentId, select cou.biz_org_name bizOrgName,cou.sequence_nbr sequenceNbr ,cou .parent_id parentId,
a.fireManagementPostCode, b.telephone,cou.amos_org_id amosUserId from cb_org_usr cou a.fireManagementPostCode, b.telephone,cou.amos_org_id amosUserId from ( select * from cb_org_usr cou where is_delete = 0 ) cou
left join (select i.instance_id id1 ,if(i.field_code = 'fireManagementPostCode', left join (select i.instance_id id1 ,if(i.field_code = 'fireManagementPostCode',
i.field_value, null) as 'fireManagementPostCode' from cb_dynamic_form_instance i where i.field_code = 'fireManagementPostCode' i.field_value, null) as 'fireManagementPostCode' from cb_dynamic_form_instance i where i.field_code = 'fireManagementPostCode'
and i.field_value_label is not null) a on cou .sequence_nbr = a.id1 and i.field_value_label is not null) a on cou .sequence_nbr = a.id1
left join (select i.instance_id id2,if(i.field_code = 'telephone', left join (select i.instance_id id2,if(i.field_code = 'telephone',
i.field_value, null) as 'telephone' from cb_dynamic_form_instance i where i.field_code = 'telephone' i.field_value, null) as 'telephone' from cb_dynamic_form_instance i where i.field_code = 'telephone'
and i.field_value is not null) b on cou .sequence_nbr = b.id2 and i.field_value is not null) b on cou .sequence_nbr = b.id2
) d where d.parentId in (select sequence_nbr from cb_org_usr cou where biz_org_name = #{bizOrgName}) ) d left join cb_org_usr cbo on cbo.sequence_nbr = d.parentId where d.parentId in (select sequence_nbr from cb_org_usr cou where biz_org_name = #{bizOrgName})
and (d.fireManagementPostCode in and (d.fireManagementPostCode in
<foreach item="item" index="index" collection="codes" open="(" separator="," close=")"> <foreach item="item" index="index" collection="codes" open="(" separator="," close=")">
#{item} #{item}
...@@ -706,16 +706,17 @@ LEFT JOIN ( ...@@ -706,16 +706,17 @@ LEFT JOIN (
</select> </select>
<select id="queryCompanyIdNew" resultType="map"> <select id="queryCompanyIdNew" resultType="map">
select * from ( select d.*,cbo.biz_org_name companyName from (
select cou.biz_org_name bizOrgName,cou.sequence_nbr sequenceNbr ,cou .parent_id parentId, select cou.biz_org_name bizOrgName,cou.sequence_nbr sequenceNbr ,cou .parent_id parentId,
a.administrativePositionCode, b.telephone, cou.amos_org_id amosUserId from cb_org_usr cou a.administrativePositionCode, b.telephone, cou.amos_org_id amosUserId from ( select * from cb_org_usr cou where is_delete = 0 ) cou
left join (select i.instance_id id1 ,if(i.field_code = 'administrativePositionCode', left join (select i.instance_id id1 ,if(i.field_code = 'administrativePositionCode',
i.field_value_label, null) as 'administrativePositionCode' from cb_dynamic_form_instance i where i.field_code = 'administrativePositionCode' i.field_value_label, null) as 'administrativePositionCode' from cb_dynamic_form_instance i where i.field_code = 'administrativePositionCode'
and i.field_value_label is not null) a on cou .sequence_nbr = a.id1 and i.field_value_label is not null) a on cou .sequence_nbr = a.id1
left join (select i.instance_id id2,if(i.field_code = 'telephone', inner join (select i.instance_id id2,if(i.field_code = 'telephone',
i.field_value, null) as 'telephone' from cb_dynamic_form_instance i where i.field_code = 'telephone' i.field_value, null) as 'telephone' from cb_dynamic_form_instance i where i.field_code = 'telephone'
and i.field_value is not null) b on cou .sequence_nbr = b.id2 and i.field_value is not null) b on cou .sequence_nbr = b.id2
) d where d.parentId in (select sequence_nbr from cb_org_usr cou where biz_org_name = #{bizOrgName}) ) d left join cb_org_usr cbo on cbo.sequence_nbr = d.parentId where d.parentId in (select sequence_nbr from cb_org_usr cou where biz_org_name = #{bizOrgName})
</select> </select>
</mapper> </mapper>
...@@ -277,8 +277,6 @@ public class AlertSubmittedController extends BaseController { ...@@ -277,8 +277,6 @@ public class AlertSubmittedController extends BaseController {
alertSubmittedService.generateMob(alertCalledFormDto.getAlertCalled()); alertSubmittedService.generateMob(alertCalledFormDto.getAlertCalled());
} catch (FileNotFoundException e) { } catch (FileNotFoundException e) {
e.printStackTrace(); e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ParseException e) { } catch (ParseException e) {
e.printStackTrace(); e.printStackTrace();
} }
......
...@@ -72,6 +72,7 @@ public class AlertCalledAction { ...@@ -72,6 +72,7 @@ public class AlertCalledAction {
@RuleMethod(methodLabel = "短信报送", project = "西咸机场119接处警规则") @RuleMethod(methodLabel = "短信报送", project = "西咸机场119接处警规则")
public void sendcmd(String smsCode, String sendType, List<Map<String,Object>> submittedList, Object object) throws Exception { public void sendcmd(String smsCode, String sendType, List<Map<String,Object>> submittedList, Object object) throws Exception {
System.out.println("接收到规则调用--------------西咸机场119接处警规则/alertCalledRule");
alertSubmittedService.ruleCallbackAction(smsCode, submittedList, object); alertSubmittedService.ruleCallbackAction(smsCode, submittedList, object);
} }
......
package com.yeejoin.amos.boot.module.jcs.biz.rule.action; package com.yeejoin.amos.boot.module.jcs.biz.rule.action;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.PowerrTransferLogServiceImpl; import com.yeejoin.amos.boot.module.jcs.biz.service.impl.PowerrTransferLogServiceImpl;
...@@ -57,16 +58,18 @@ public class PowerTransferAction { ...@@ -57,16 +58,18 @@ public class PowerTransferAction {
if (object instanceof AlertCallePowerTransferRo) { if (object instanceof AlertCallePowerTransferRo) {
AlertCallePowerTransferRo calledRo = (AlertCallePowerTransferRo) object; AlertCallePowerTransferRo calledRo = (AlertCallePowerTransferRo) object;
powerrTransferLogServiceImpl.savePowerTransferLog(calledRo); // 获取力量调派发送人员
List<String> persons = new ArrayList<>();
calledRo.getPowerTransType();
if (FireBrigadeTypeEnum.专职消防队.getKey().equals(calledRo.getPowerTransType())) { if (FireBrigadeTypeEnum.专职消防队.getKey().equals(calledRo.getPowerTransType())) {
alertSubmittedService.ruleCallbackActionForPowerTransferForCar(smsCode, sendIds, object);//消防车辆 alertSubmittedService.ruleCallbackActionForPowerTransferForCar(smsCode, sendIds, object,persons);//消防车辆
} else if (FireBrigadeTypeEnum.医疗救援队.getKey().equals(calledRo.getPowerTransType())) { } else if (FireBrigadeTypeEnum.医疗救援队.getKey().equals(calledRo.getPowerTransType())) {
alertSubmittedService.ruleCallbackActionForPowerTransferForAid(smsCode, sendIds, object);//120急救站 alertSubmittedService.ruleCallbackActionForPowerTransferForAid(smsCode, sendIds, object,persons);//120急救站
} else if (FireBrigadeTypeEnum.监控大队.getKey().equals(calledRo.getPowerTransType())) { } else if (FireBrigadeTypeEnum.监控大队.getKey().equals(calledRo.getPowerTransType())) {
alertSubmittedService.ruleCallbackActionForPowerTransferForSurvBrigade(smsCode, sendIds, object);//监控大队 alertSubmittedService.ruleCallbackActionForPowerTransferForSurvBrigade(smsCode, sendIds, object,persons);//监控大队
} }
powerrTransferLogServiceImpl.savePowerTransferLog(calledRo,persons);
} }
} }
} }
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils; ...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCallePowerTransferRo; import com.yeejoin.amos.boot.module.jcs.api.dto.AlertCallePowerTransferRo;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyDto;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerTransferCompanyResourcesDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompany; import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompany;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompanyResources; import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompanyResources;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerrTransferLog; import com.yeejoin.amos.boot.module.jcs.api.entity.PowerrTransferLog;
...@@ -15,6 +16,7 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.FireBrigadeTypeEnum; ...@@ -15,6 +16,7 @@ import com.yeejoin.amos.boot.module.jcs.api.enums.FireBrigadeTypeEnum;
import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerrTransferLogMapper; import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerrTransferLogMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerrTransferLogService; import com.yeejoin.amos.boot.module.jcs.api.service.IPowerrTransferLogService;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerrTransferLogDto; import com.yeejoin.amos.boot.module.jcs.api.dto.PowerrTransferLogDto;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
...@@ -42,6 +44,9 @@ public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogD ...@@ -42,6 +44,9 @@ public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogD
@Autowired @Autowired
PowerTransferCompanyResourcesServiceImpl powerTransferCompanyResourcesService; PowerTransferCompanyResourcesServiceImpl powerTransferCompanyResourcesService;
@Autowired
AlertCalledServiceImpl iAlertCalledService;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -98,11 +103,16 @@ public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogD ...@@ -98,11 +103,16 @@ public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogD
} }
public void savePowerTransferLog( AlertCallePowerTransferRo alertCallePowerTransferRo) { public void savePowerTransferLog( AlertCallePowerTransferRo alertCallePowerTransferRo, List<String> persons) {
String powerTransType = alertCallePowerTransferRo.getPowerTransType(); String powerTransType = alertCallePowerTransferRo.getPowerTransType();
AlertCalled alertCalled = iAlertCalledService.getById(alertCallePowerTransferRo.getSequenceNbr());
String personName = "";
if (persons.size() > 0) {
personName = StringUtils.join(persons.toArray(),",");
}
final String receiveName = personName;
List<PowerrTransferLog> list = new ArrayList<>(); List<PowerrTransferLog> list = new ArrayList<>();
if (FireBrigadeTypeEnum.专职消防队.getKey().equals(powerTransType)) { if (FireBrigadeTypeEnum.专职消防队.getKey().equals(powerTransType)) {
List<Object> companyDetail = JSONArray.parseArray(JSON.toJSON(alertCallePowerTransferRo.getCompany()).toString(),Object.class); List<Object> companyDetail = JSONArray.parseArray(JSON.toJSON(alertCallePowerTransferRo.getCompany()).toString(),Object.class);
for (Object powerTransferCompanyDto : companyDetail) { for (Object powerTransferCompanyDto : companyDetail) {
PowerTransferCompanyDto powerDto = JSONObject.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class); PowerTransferCompanyDto powerDto = JSONObject.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
...@@ -110,7 +120,8 @@ public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogD ...@@ -110,7 +120,8 @@ public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogD
powerTransferCompanyResourcesDtoList.stream().forEach(f-> { powerTransferCompanyResourcesDtoList.stream().forEach(f-> {
PowerrTransferLog pw = new PowerrTransferLog(); PowerrTransferLog pw = new PowerrTransferLog();
pw.setResourceId(f.getSequenceNbr()); pw.setResourceId(f.getSequenceNbr());
pw.setReceiveName(f.getRecUserName()); pw.setReceiveName(receiveName);
pw.setRecUserName(alertCalled.getRecUserName());
try { try {
pw.setSendTime(DateUtils.dateTimeToDateString(new Date(System.currentTimeMillis()))); pw.setSendTime(DateUtils.dateTimeToDateString(new Date(System.currentTimeMillis())));
} catch (ParseException ex) { } catch (ParseException ex) {
...@@ -127,7 +138,8 @@ public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogD ...@@ -127,7 +138,8 @@ public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogD
PowerTransferCompanyDto powerDto = JSONObject.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class); PowerTransferCompanyDto powerDto = JSONObject.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
PowerrTransferLog pw = new PowerrTransferLog(); PowerrTransferLog pw = new PowerrTransferLog();
pw.setTeamId(powerDto.getSequenceNbr()); pw.setTeamId(powerDto.getSequenceNbr());
pw.setReceiveName(powerDto.getRecUserName()); pw.setReceiveName(receiveName);
pw.setRecUserName(alertCalled.getRecUserName());
try { try {
pw.setSendTime(DateUtils.dateTimeToDateString(new Date(System.currentTimeMillis()))); pw.setSendTime(DateUtils.dateTimeToDateString(new Date(System.currentTimeMillis())));
} catch (ParseException ex) { } catch (ParseException ex) {
......
...@@ -71,6 +71,7 @@ public class RuleAlertCalledService { ...@@ -71,6 +71,7 @@ public class RuleAlertCalledService {
if(!ValidationUtil.isEmpty(mobiles)) { if(!ValidationUtil.isEmpty(mobiles)) {
alertCalledRo.setIds(mobiles); alertCalledRo.setIds(mobiles);
} }
System.out.println("触发规则调用--------------西咸机场119接处警规则/alertCalledRule");
//触发规则 //触发规则
ruleTrigger.publish(alertCalledRo, "西咸机场119接处警规则/alertCalledRule", new String[0]); ruleTrigger.publish(alertCalledRo, "西咸机场119接处警规则/alertCalledRule", new String[0]);
......
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