Commit 89c6cb1b authored by maoying's avatar maoying

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

parents 3078e08a 7cdbdf0d
...@@ -6,6 +6,7 @@ import org.springframework.boot.autoconfigure.http.HttpMessageConverters; ...@@ -6,6 +6,7 @@ import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringEncoder; import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextListener;
import feign.codec.Encoder; import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder; import feign.form.spring.SpringFormEncoder;
...@@ -25,4 +26,12 @@ public class MultipartSupportConfig { ...@@ -25,4 +26,12 @@ public class MultipartSupportConfig {
public Encoder feignFormEncoder() { public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters)); return new SpringFormEncoder(new SpringEncoder(messageConverters));
} }
/**
* 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
* @return
*/
@Bean
public RequestContextListener requestInterceptor() {
return new RequestContextListener();
}
} }
...@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.common.api.service; ...@@ -3,6 +3,9 @@ package com.yeejoin.amos.boot.module.common.api.service;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto; import com.yeejoin.amos.boot.module.common.api.dto.DutyCarDto;
import java.util.List;
import java.util.Map;
/** /**
* @author DELL * @author DELL
*/ */
...@@ -30,4 +33,5 @@ public interface IDutyCarService extends IDutyCommonService { ...@@ -30,4 +33,5 @@ public interface IDutyCarService extends IDutyCommonService {
*/ */
JSONObject isFireCarDriver(); JSONObject isFireCarDriver();
int getDutyCarCount(Long carId); int getDutyCarCount(Long carId);
List<Map<String, Object>> getDutyCaruser(Long carId);
} }
...@@ -144,6 +144,15 @@ select * from ( ...@@ -144,6 +144,15 @@ select * from (
cd.FIELD_VALUE cd.FIELD_VALUE
END END
) AS #{equipmentId}, ) AS #{equipmentId},
MAX(
CASE
WHEN cd.FIELD_CODE = 'userName' THEN
cd.FIELD_VALUE
END
) AS 'userName',
MAX( MAX(
CASE CASE
WHEN cd.FIELD_CODE = #{equipmentName} THEN WHEN cd.FIELD_CODE = #{equipmentName} THEN
......
...@@ -1104,6 +1104,7 @@ public class CommandController extends BaseController { ...@@ -1104,6 +1104,7 @@ public class CommandController extends BaseController {
if (e.get("carState").equals("在位")) { if (e.get("carState").equals("在位")) {
e.put("carState", FireCarStatusEnum.执勤.getName()); e.put("carState", FireCarStatusEnum.执勤.getName());
} }
String sequenceNbr = e.get("sequenceNbr").toString(); String sequenceNbr = e.get("sequenceNbr").toString();
//同步力量调派车辆任务状态 //同步力量调派车辆任务状态
alertFormValue.stream().forEach(v -> { alertFormValue.stream().forEach(v -> {
...@@ -1470,12 +1471,21 @@ public class CommandController extends BaseController { ...@@ -1470,12 +1471,21 @@ public class CommandController extends BaseController {
powerTransferCompanyResources = powerTransferCompanyResourcesService.getByAlertCalledIdCarId(alertCalledId, carid); powerTransferCompanyResources = powerTransferCompanyResourcesService.getByAlertCalledIdCarId(alertCalledId, carid);
// 随车人员 // 随车人员
List<PowerData> powerDataOne = powerTransferMapper.getPowerDataOne(carid); // List<PowerData> powerDataOne = powerTransferMapper.getPowerDataOne(carid);
if(!ValidationUtil.isEmpty(powerDataOne)) {
List<Map<String, Object>> equipmentList = iDutyCarService.getDutyCaruser(carid);
if(!ValidationUtil.isEmpty(equipmentList)) {
String str = ""; String str = "";
String newStr = ""; String newStr = "";
for(int i = 0; i < powerDataOne.size(); i++ ) { for(int i = 0; i < equipmentList.size(); i++ ) {
newStr = str.concat(powerDataOne.get(i).getPostTypeName()).concat(":").concat(powerDataOne.get(i).getUser()); if(i==equipmentList.size()-1){
newStr = str.concat(equipmentList.get(i).get("userName")+"");
}else{
newStr = str.concat(equipmentList.get(i).get("userName")+",");
}
} }
powerTransferCompanyResources.setPw(newStr); powerTransferCompanyResources.setPw(newStr);
} else { } else {
......
...@@ -238,4 +238,16 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa ...@@ -238,4 +238,16 @@ public class DutyCarServiceImpl extends DutyCommonServiceImpl implements IDutyCa
return count; return count;
} }
@Override
public List<Map<String, Object>> getDutyCaruser(Long carId) {
List<Map<String, Object>> equipmentList = dutyPersonShiftMapper.getEquipmentForSpecifyDate(DateUtils.getDateNowShortStr(),
this.getGroupCode(), "carId", "carName", "teamName","");
equipmentList = equipmentList.stream().filter((e) ->
e.containsKey("carId") && e.get("carId").equals(Long.toString(carId))
).collect(Collectors.toList());
return equipmentList;
}
} }
package com.yeejoin.amos.fas.business.feign; //package com.yeejoin.amos.fas.business.feign;
//
import feign.codec.Encoder; //import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder; //import feign.form.spring.SpringFormEncoder;
import org.springframework.beans.factory.ObjectFactory; //import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters; //import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringEncoder; //import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextListener; //import org.springframework.web.context.request.RequestContextListener;
//
/** ///**
* @Author: xinglei // * @Author: xinglei
* @Description: // * @Description:
* @Date: 2020/3/30 16:26 // * @Date: 2020/3/30 16:26
*/ // */
@Configuration //@Configuration
public class MultipartSupportConfig { //public class MultipartSupportConfig {
//
@Autowired // @Autowired
private ObjectFactory<HttpMessageConverters> messageConverters; // private ObjectFactory<HttpMessageConverters> messageConverters;
//
@Bean // @Bean
public Encoder feignFormEncoder() { // public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters)); // return new SpringFormEncoder(new SpringEncoder(messageConverters));
} // }
//
/** // /**
* 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用 // * 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
* @return // * @return
*/ // */
@Bean // @Bean
public RequestContextListener requestInterceptor() { // public RequestContextListener requestInterceptor() {
return new RequestContextListener(); // return new RequestContextListener();
} // }
} //}
...@@ -6,6 +6,8 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -6,6 +6,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
@FeignClient(name = "${outSystem.fegin.name}", configuration = {MultipartSupportConfig.class}) @FeignClient(name = "${outSystem.fegin.name}", configuration = {MultipartSupportConfig.class})
public interface OutTokenLoginFeign { public interface OutTokenLoginFeign {
......
package com.yeejoin.amos.fas.business.feign; package com.yeejoin.amos.fas.business.feign;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import java.util.Map;
import org.springframework.cloud.openfeign.FeignClient; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.Map; import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import com.yeejoin.amos.component.feign.model.FeignClientResult;
@FeignClient(name = "${privilege.fegin.name}", configuration = {MultipartSupportConfig.class}) @FeignClient(name = "${privilege.fegin.name}", configuration = {MultipartSupportConfig.class})
public interface PrivilegeFeign { public interface PrivilegeFeign {
......
package com.yeejoin.amos.fas.business.feign; package com.yeejoin.amos.fas.business.feign;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import com.yeejoin.amos.fas.business.jpush.PushMsgParam; import com.yeejoin.amos.fas.business.jpush.PushMsgParam;
import com.yeejoin.amos.fas.core.util.CommonResponse; import com.yeejoin.amos.fas.core.util.CommonResponse;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import org.springframework.cloud.openfeign.FeignClient;
/** /**
......
package com.yeejoin.amos.maintenance.feign; //package com.yeejoin.amos.maintenance.feign;
//
import feign.codec.Encoder; //import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder; //import feign.form.spring.SpringFormEncoder;
import org.springframework.beans.factory.ObjectFactory; //import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired; //import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters; //import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringEncoder; //import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean; //import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; //import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.request.RequestContextListener; //import org.springframework.web.context.request.RequestContextListener;
//
/** ///**
* @Author: xinglei // * @Author: xinglei
* @Description: // * @Description:
* @Date: 2020/3/30 16:26 // * @Date: 2020/3/30 16:26
*/ // */
@Configuration //@Configuration
public class MultipartSupportConfig { //public class MultipartSupportConfig {
//
@Autowired // @Autowired
private ObjectFactory<HttpMessageConverters> messageConverters; // private ObjectFactory<HttpMessageConverters> messageConverters;
//
@Bean // @Bean
public Encoder feignFormEncoder() { // public Encoder feignFormEncoder() {
return new SpringFormEncoder(new SpringEncoder(messageConverters)); // return new SpringFormEncoder(new SpringEncoder(messageConverters));
} // }
//
/** // /**
* 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用 // * 创建Feign请求拦截器,在发送请求前设置认证的token,各个微服务将token设置到环境变量中来达到通用
* @return // * @return
*/ // */
@Bean // @Bean
public RequestContextListener requestInterceptor() { // public RequestContextListener requestInterceptor() {
return new RequestContextListener(); // return new RequestContextListener();
} // }
} //}
package com.yeejoin.amos.maintenance.feign; package com.yeejoin.amos.maintenance.feign;
import com.yeejoin.amos.maintenance.business.util.CommonResponse; import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import com.yeejoin.amos.boot.biz.common.feign.MultipartSupportConfig;
import com.yeejoin.amos.maintenance.business.param.PushMsgParam; import com.yeejoin.amos.maintenance.business.param.PushMsgParam;
import org.springframework.web.bind.annotation.RequestBody; import com.yeejoin.amos.maintenance.business.util.CommonResponse;
import org.springframework.cloud.openfeign.FeignClient;
......
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