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

linux 下生成word文件保存解决

parent 190e7c25
......@@ -342,9 +342,11 @@ AND cft.type_code = (
</select>
<select id='queryByCompanyId' resultType="map">
select biz_org_name as bizOrgName,sequence_nbr sequenceNbr,field_value as telephone, amosUserId from (
select orgUsr.biz_org_name,i.field_value,orgUsr.sequence_nbr,orgUsr.amos_org_id amosUserId
from cb_org_usr orgUsr left join cb_dynamic_form_instance i on orgUsr.sequence_nbr =
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, cou1.biz_org_name companyName
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
where d.sequence_nbr in (
select userId from (
......@@ -367,9 +369,11 @@ AND cft.type_code = (
<select id='queryByCompanyNew' resultType="map">
select biz_org_name as bizOrgName,sequence_nbr sequenceNbr,field_value as telephone,amosUserId from (
select orgUsr.biz_org_name,i.field_value,orgUsr.sequence_nbr,orgUsr.amos_org_id amosUserId
from cb_org_usr orgUsr left join cb_dynamic_form_instance i on orgUsr.sequence_nbr =
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, cou1.biz_org_name companyName
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
where d.sequence_nbr in (
select userId from (
......
......@@ -179,7 +179,7 @@
mobile_phone as mobilePhone,
amos_user_id amosUserId
FROM
cb_firefighters firefighters
(select * from cb_firefighters fr where is_delete = 0) firefighters
WHERE
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}) )
......
......@@ -688,16 +688,16 @@ LEFT JOIN (
</select>
<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,
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',
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
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'
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
<foreach item="item" index="index" collection="codes" open="(" separator="," close=")">
#{item}
......@@ -706,16 +706,17 @@ LEFT JOIN (
</select>
<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,
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',
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
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'
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>
</mapper>
......@@ -277,8 +277,6 @@ public class AlertSubmittedController extends BaseController {
alertSubmittedService.generateMob(alertCalledFormDto.getAlertCalled());
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
}
......
......@@ -72,6 +72,7 @@ public class AlertCalledAction {
@RuleMethod(methodLabel = "短信报送", project = "西咸机场119接处警规则")
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);
}
......
package com.yeejoin.amos.boot.module.jcs.biz.rule.action;
import java.util.ArrayList;
import java.util.List;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.PowerrTransferLogServiceImpl;
......@@ -57,16 +58,18 @@ public class PowerTransferAction {
if (object instanceof AlertCallePowerTransferRo) {
AlertCallePowerTransferRo calledRo = (AlertCallePowerTransferRo) object;
powerrTransferLogServiceImpl.savePowerTransferLog(calledRo);
// 获取力量调派发送人员
List<String> persons = new ArrayList<>();
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())) {
alertSubmittedService.ruleCallbackActionForPowerTransferForAid(smsCode, sendIds, object);//120急救站
alertSubmittedService.ruleCallbackActionForPowerTransferForAid(smsCode, sendIds, object,persons);//120急救站
} 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;
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.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.PowerTransferCompanyResources;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerrTransferLog;
......@@ -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.service.IPowerrTransferLogService;
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.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
......@@ -42,6 +44,9 @@ public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogD
@Autowired
PowerTransferCompanyResourcesServiceImpl powerTransferCompanyResourcesService;
@Autowired
AlertCalledServiceImpl iAlertCalledService;
/**
* 分页查询
*/
......@@ -98,11 +103,16 @@ public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogD
}
public void savePowerTransferLog( AlertCallePowerTransferRo alertCallePowerTransferRo) {
String powerTransType = alertCallePowerTransferRo.getPowerTransType();
public void savePowerTransferLog( AlertCallePowerTransferRo alertCallePowerTransferRo, List<String> persons) {
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<>();
if (FireBrigadeTypeEnum.专职消防队.getKey().equals(powerTransType)) {
List<Object> companyDetail = JSONArray.parseArray(JSON.toJSON(alertCallePowerTransferRo.getCompany()).toString(),Object.class);
for (Object powerTransferCompanyDto : companyDetail) {
PowerTransferCompanyDto powerDto = JSONObject.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
......@@ -110,7 +120,8 @@ public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogD
powerTransferCompanyResourcesDtoList.stream().forEach(f-> {
PowerrTransferLog pw = new PowerrTransferLog();
pw.setResourceId(f.getSequenceNbr());
pw.setReceiveName(f.getRecUserName());
pw.setReceiveName(receiveName);
pw.setRecUserName(alertCalled.getRecUserName());
try {
pw.setSendTime(DateUtils.dateTimeToDateString(new Date(System.currentTimeMillis())));
} catch (ParseException ex) {
......@@ -127,7 +138,8 @@ public class PowerrTransferLogServiceImpl extends BaseService<PowerrTransferLogD
PowerTransferCompanyDto powerDto = JSONObject.parseObject(JSON.toJSON(powerTransferCompanyDto).toString(), PowerTransferCompanyDto.class);
PowerrTransferLog pw = new PowerrTransferLog();
pw.setTeamId(powerDto.getSequenceNbr());
pw.setReceiveName(powerDto.getRecUserName());
pw.setReceiveName(receiveName);
pw.setRecUserName(alertCalled.getRecUserName());
try {
pw.setSendTime(DateUtils.dateTimeToDateString(new Date(System.currentTimeMillis())));
} catch (ParseException ex) {
......
......@@ -71,6 +71,7 @@ public class RuleAlertCalledService {
if(!ValidationUtil.isEmpty(mobiles)) {
alertCalledRo.setIds(mobiles);
}
System.out.println("触发规则调用--------------西咸机场119接处警规则/alertCalledRule");
//触发规则
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