Commit 99baf506 authored by 徐州's avatar 徐州

修改多城市排班问题

parent f0dd2be8
...@@ -55,6 +55,8 @@ public interface UserMapper { ...@@ -55,6 +55,8 @@ public interface UserMapper {
List<UserEntity> getDutyUserByCity(Map<String, Object> map); List<UserEntity> getDutyUserByCity(Map<String, Object> map);
List<UserEntity> getDutyUserByCityAndOnDuty(String cityCode);
List<UserEntity> getUserByCity(Map<String, Object> map); List<UserEntity> getUserByCity(Map<String, Object> map);
void deleteDutyById(Integer userId); void deleteDutyById(Integer userId);
......
...@@ -107,7 +107,7 @@ public class StaffDuty implements IStaffDuty { ...@@ -107,7 +107,7 @@ public class StaffDuty implements IStaffDuty {
@Override @Override
public void updateDutyStaff() { public void updateDutyStaff() {
System.out.println("1122334411223344"); // List<UserEntity> entities = usermapper.getDutyUserByCityAndOnDuty("nj");
Map<String, Object> searchParams = new HashMap<>(); Map<String, Object> searchParams = new HashMap<>();
Page page = new Page(1000); Page page = new Page(1000);
DepartmentListRequest listRequest = new DepartmentListRequest(); DepartmentListRequest listRequest = new DepartmentListRequest();
...@@ -179,41 +179,54 @@ public class StaffDuty implements IStaffDuty { ...@@ -179,41 +179,54 @@ public class StaffDuty implements IStaffDuty {
Date now = new Date(); Date now = new Date();
for (String city : cityList) { for (String city : cityList) {
//南京和其他城市区分 //南京和其他城市区分
Map<String, Object> map = new HashMap<>(5);
if ("nj".equals(city)) { List<UserEntity> entities = usermapper.getDutyUserByCityAndOnDuty(city);
map.put("onduty", 1); UserEntity user = entities.get(0);
List<DutyStaffEntity> list = usermapper.getDutyByCondition(map);
if (CollectionUtils.isNotEmpty(list)) {
DutyStaffEntity staffEntity = list.get(0);
//每天新增一个云迹活动
CloudActivityEntity entity = new CloudActivityEntity();
String name = "云迹数据" + date;
entity.setName(name);
entity.setCity(city);
entity.setCreateId(Integer.valueOf(staffEntity.getUserId()));
entity.setCreateName(staffEntity.getName());
entity.setCreateTime(now);
setData(entity);
activityMapper.save(entity);
}
} else {
map.put("isDuty", 1);
map.put("city", city);
List<DutyStaffOtherEntity> dutyList = staffOtherMapper.queryByConditions(map);
if (CollectionUtils.isNotEmpty(dutyList)) {
DutyStaffOtherEntity staffEntity = dutyList.get(0);
//每天新增一个云迹活动 //每天新增一个云迹活动
CloudActivityEntity entity = new CloudActivityEntity(); CloudActivityEntity entity = new CloudActivityEntity();
String name = "云迹数据" + date; String name = "云迹数据" + date;
entity.setName(name); entity.setName(name);
entity.setCity(city); entity.setCity(city);
entity.setCreateId(staffEntity.getUserId()); entity.setCreateId(entity.getId());
entity.setCreateName(staffEntity.getName()); entity.setCreateName(entity.getName());
entity.setCreateTime(now); entity.setCreateTime(now);
setData(entity); setData(entity);
activityMapper.save(entity); activityMapper.save(entity);
}
} // if ("nj".equals(city)) {
// map.put("onduty", 1);
// List<DutyStaffEntity> list = usermapper.getDutyByCondition(map);
// if (CollectionUtils.isNotEmpty(list)) {
// DutyStaffEntity staffEntity = list.get(0);
// //每天新增一个云迹活动
// CloudActivityEntity entity = new CloudActivityEntity();
// String name = "云迹数据" + date;
// entity.setName(name);
// entity.setCity(city);
// entity.setCreateId(Integer.valueOf(staffEntity.getUserId()));
// entity.setCreateName(staffEntity.getName());
// entity.setCreateTime(now);
// setData(entity);
// activityMapper.save(entity);
// }
// } else {
// map.put("isDuty", 1);
// map.put("city", city);
// List<DutyStaffOtherEntity> dutyList = staffOtherMapper.queryByConditions(map);
// if (CollectionUtils.isNotEmpty(dutyList)) {
// DutyStaffOtherEntity staffEntity = dutyList.get(0);
// //每天新增一个云迹活动
// CloudActivityEntity entity = new CloudActivityEntity();
// String name = "云迹数据" + date;
// entity.setName(name);
// entity.setCity(city);
// entity.setCreateId(staffEntity.getUserId());
// entity.setCreateName(staffEntity.getName());
// entity.setCreateTime(now);
// setData(entity);
// activityMapper.save(entity);
// }
// }
} }
} }
} }
......
...@@ -262,6 +262,14 @@ ...@@ -262,6 +262,14 @@
order by b.`order` order by b.`order`
</select> </select>
<select id="getDutyUserByCityAndOnDuty" resultMap="infoMap">
select a.id, a.realName
from user a
join `duty_staff` b on a.id = b.userId
where a.`deptUrlPath` REGEXP CONCAT('^', (select urlPath from `department` where `descripition` = #{cityCode}))
and b.onduty = 1
</select>
<select id="getUserByCity" resultMap="infoMap"> <select id="getUserByCity" resultMap="infoMap">
select a.id, a.realName,a.position select a.id, a.realName,a.position
from user a from user a
......
...@@ -1547,6 +1547,14 @@ ...@@ -1547,6 +1547,14 @@
c.is_show_in_plat $searchFilters.isShowInPlat.operation$ #searchFilters.isShowInPlat.value# c.is_show_in_plat $searchFilters.isShowInPlat.operation$ #searchFilters.isShowInPlat.value#
]]> ]]>
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend="AND" property="searchFilters.actSources">
<![CDATA[ c.act_source in ]]>
<iterate prepend="" property="searchFilters.actSources.value" close=")" open="(" conjunction=",">
<![CDATA[ #searchFilters.actSources.value[]# ]]>
</iterate>
</isNotEmpty>
<isNotEmpty prepend="AND" property="searchFilters.starCustomer"> <isNotEmpty prepend="AND" property="searchFilters.starCustomer">
<![CDATA[ <![CDATA[
starCustomer $searchFilters.starCustomer.operation$ #searchFilters.starCustomer.value# starCustomer $searchFilters.starCustomer.operation$ #searchFilters.starCustomer.value#
......
...@@ -262,6 +262,14 @@ ...@@ -262,6 +262,14 @@
order by b.`order` order by b.`order`
</select> </select>
<select id="getDutyUserByCityAndOnDuty" resultMap="infoMap">
select a.id, a.realName
from user a
join `duty_staff` b on a.id = b.userId
where a.`deptUrlPath` REGEXP CONCAT('^', (select urlPath from `department` where `descripition` = #{cityCode}))
and b.onduty = 1
</select>
<select id="getUserByCity" resultMap="infoMap"> <select id="getUserByCity" resultMap="infoMap">
select a.id, a.realName,a.position select a.id, a.realName,a.position
from user a from user a
......
...@@ -262,6 +262,14 @@ ...@@ -262,6 +262,14 @@
order by b.`order` order by b.`order`
</select> </select>
<select id="getDutyUserByCityAndOnDuty" resultMap="infoMap">
select a.id, a.realName
from user a
join `duty_staff` b on a.id = b.userId
where a.`deptUrlPath` REGEXP CONCAT('^', (select urlPath from `department` where `descripition` = #{cityCode}))
and b.onduty = 1
</select>
<select id="getUserByCity" resultMap="infoMap"> <select id="getUserByCity" resultMap="infoMap">
select a.id, a.realName,a.position select a.id, a.realName,a.position
from user a from user a
......
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