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

修改多城市排班问题

parent f0dd2be8
......@@ -55,6 +55,8 @@ public interface UserMapper {
List<UserEntity> getDutyUserByCity(Map<String, Object> map);
List<UserEntity> getDutyUserByCityAndOnDuty(String cityCode);
List<UserEntity> getUserByCity(Map<String, Object> map);
void deleteDutyById(Integer userId);
......
......@@ -107,7 +107,7 @@ public class StaffDuty implements IStaffDuty {
@Override
public void updateDutyStaff() {
System.out.println("1122334411223344");
// List<UserEntity> entities = usermapper.getDutyUserByCityAndOnDuty("nj");
Map<String, Object> searchParams = new HashMap<>();
Page page = new Page(1000);
DepartmentListRequest listRequest = new DepartmentListRequest();
......@@ -179,41 +179,54 @@ public class StaffDuty implements IStaffDuty {
Date now = new Date();
for (String city : cityList) {
//南京和其他城市区分
Map<String, Object> map = new HashMap<>(5);
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);
}
}
List<UserEntity> entities = usermapper.getDutyUserByCityAndOnDuty(city);
UserEntity user = entities.get(0);
//每天新增一个云迹活动
CloudActivityEntity entity = new CloudActivityEntity();
String name = "云迹数据" + date;
entity.setName(name);
entity.setCity(city);
entity.setCreateId(entity.getId());
entity.setCreateName(entity.getName());
entity.setCreateTime(now);
setData(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 @@
order by b.`order`
</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 a.id, a.realName,a.position
from user a
......
......@@ -1547,6 +1547,14 @@
c.is_show_in_plat $searchFilters.isShowInPlat.operation$ #searchFilters.isShowInPlat.value#
]]>
</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">
<![CDATA[
starCustomer $searchFilters.starCustomer.operation$ #searchFilters.starCustomer.value#
......
......@@ -262,6 +262,14 @@
order by b.`order`
</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 a.id, a.realName,a.position
from user a
......
......@@ -262,6 +262,14 @@
order by b.`order`
</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 a.id, a.realName,a.position
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