Commit 025f1c3c by 刘鑫

Merge remote-tracking branch 'origin/develop' into develop

2 parents 1132e3da 76567c40
Showing with 359 additions and 189 deletions
......@@ -84,45 +84,44 @@ public class BatchServiceImpl implements BatchService {
batchDay = optional.get().getBatchDate();
}
// FIXME 因为系统暂时没有订单,每次固定拉取2023-08-13号订单数据生成新订单
LocalDate localDt = LocalDate.parse(batchDay, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<OrderInfo> orders = orderInfoRepository.findByOrgGroupIdAndDt(groupId, localDt);
if (CollectionUtils.isEmpty(orders)) {
String tempDay = "2023-08-13";
String createOrder = "INSERT INTO order_info (\r\n" + " order_id,\r\n" + " dt,\r\n" + " sub_id,\r\n"
+ " NAME,\r\n" + " phone,\r\n" + " province,\r\n" + " city,\r\n" + " county,\r\n"
+ " address,\r\n" + " X,\r\n" + " Y,\r\n" + " bean_brand,\r\n" + " brand,\r\n" + " TYPE,\r\n"
+ " skill,\r\n" + " take_time,\r\n" + " is_workshop,\r\n" + " fault_describe,\r\n"
+ " apply_note,\r\n" + " expect_time_begin,\r\n" + " expect_time_end,\r\n"
+ " expect_time_desc,\r\n" + " source,\r\n" + " bean_priority,\r\n" + " bean_tags,\r\n"
+ " bean_status,\r\n" + " bean_sub_status,\r\n" + " area_id,\r\n" + " org_cluster_id,\r\n"
+ " org_branch_id,\r\n" + " org_group_id,\r\n" + " org_team_id,\r\n" + " priority,\r\n"
+ " tags,\r\n" + " appointment_method,\r\n" + " appointment_status,\r\n" + " dispatcher,\r\n"
+ " order_status,\r\n" + " service_status,\r\n" + " engineer_code,\r\n" + " engineer_name,\r\n"
+ " engineer_phone,\r\n" + " engineer_code_sub,\r\n" + " plan_start_time,\r\n"
+ " plan_end_time,\r\n" + " arrive_elapsed,\r\n" + " arrive_distance,\r\n"
+ " actual_start_time,\r\n" + " actual_end_time,\r\n" + " description,\r\n" + " extra_info,\r\n"
+ " create_time,\r\n" + " update_time\r\n" + ") \r\n" + "SELECT \r\n" + " CONCAT(order_id,'" + batchDay + "') order_id,\r\n" + " '"
+ batchDay + "',\r\n" + " sub_id,\r\n" + " NAME,\r\n" + " phone,\r\n" + " province,\r\n"
+ " city,\r\n" + " county,\r\n" + " address,\r\n" + " X,\r\n" + " Y,\r\n" + " bean_brand,\r\n"
+ " brand,\r\n" + " TYPE,\r\n" + " skill,\r\n" + " take_time,\r\n" + " is_workshop,\r\n"
+ " fault_describe,\r\n" + " apply_note,\r\n" + " expect_time_begin,\r\n"
+ " expect_time_end,\r\n" + " expect_time_desc,\r\n" + " source,\r\n" + " bean_priority,\r\n"
+ " bean_tags,\r\n" + " bean_status,\r\n" + " bean_sub_status,\r\n" + " area_id,\r\n"
+ " org_cluster_id,\r\n" + " org_branch_id,\r\n" + " org_group_id,\r\n" + " org_team_id,\r\n"
+ " priority,\r\n" + " tags,\r\n" + " appointment_method,\r\n" + " appointment_status,\r\n"
+ " dispatcher,\r\n" + " order_status,\r\n" + " service_status,\r\n" + " engineer_code,\r\n"
+ " engineer_name,\r\n" + " engineer_phone,\r\n" + " engineer_code_sub,\r\n"
+ " plan_start_time,\r\n" + " plan_end_time,\r\n" + " arrive_elapsed,\r\n"
+ " arrive_distance,\r\n" + " actual_start_time,\r\n" + " actual_end_time,\r\n"
+ " description,\r\n" + " extra_info,\r\n" + " create_time,\r\n" + " update_time \r\n"
+ "FROM\r\n" + " order_info a \r\n" + "WHERE a.org_group_id = 'gsuzhou' \r\n" + " AND a.dt = '"
+ tempDay + "' \r\n" + " AND bean_status = 'OPEN' \r\n"
+ " AND appointment_method LIKE 'AUTO%' \r\n"
+ " AND a.appointment_status IN ('INIT', 'PRE') \r\n" + " AND order_status = 'NORMAL' \r\n"
+ " AND service_status = 'INIT' \r\n" + "";
int createCount = jdbcTemplate.update(createOrder);
}
// LocalDate localDt = LocalDate.parse(batchDay, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
// List<OrderInfo> orders = orderInfoRepository.findByOrgGroupIdAndDt(groupId, localDt);
// if (CollectionUtils.isEmpty(orders)) {
// String tempDay = "2023-08-13";
// String createOrder = "INSERT INTO order_info (\r\n" + " order_id,\r\n" + " dt,\r\n" + " sub_id,\r\n"
// + " NAME,\r\n" + " phone,\r\n" + " province,\r\n" + " city,\r\n" + " county,\r\n"
// + " address,\r\n" + " X,\r\n" + " Y,\r\n" + " bean_brand,\r\n" + " brand,\r\n" + " TYPE,\r\n"
// + " skill,\r\n" + " take_time,\r\n" + " is_workshop,\r\n" + " fault_describe,\r\n"
// + " apply_note,\r\n" + " expect_time_begin,\r\n" + " expect_time_end,\r\n"
// + " expect_time_desc,\r\n" + " source,\r\n" + " bean_priority,\r\n" + " bean_tags,\r\n"
// + " bean_status,\r\n" + " bean_sub_status,\r\n" + " area_id,\r\n" + " org_cluster_id,\r\n"
// + " org_branch_id,\r\n" + " org_group_id,\r\n" + " org_team_id,\r\n" + " priority,\r\n"
// + " tags,\r\n" + " appointment_method,\r\n" + " appointment_status,\r\n" + " dispatcher,\r\n"
// + " order_status,\r\n" + " service_status,\r\n" + " engineer_code,\r\n" + " engineer_name,\r\n"
// + " engineer_phone,\r\n" + " engineer_code_sub,\r\n" + " plan_start_time,\r\n"
// + " plan_end_time,\r\n" + " arrive_elapsed,\r\n" + " arrive_distance,\r\n"
// + " actual_start_time,\r\n" + " actual_end_time,\r\n" + " description,\r\n" + " extra_info,\r\n"
// + " create_time,\r\n" + " update_time\r\n" + ") \r\n" + "SELECT \r\n" + " CONCAT(order_id,'" + batchDay + "') order_id,\r\n" + " '"
// + batchDay + "',\r\n" + " sub_id,\r\n" + " NAME,\r\n" + " phone,\r\n" + " province,\r\n"
// + " city,\r\n" + " county,\r\n" + " address,\r\n" + " X,\r\n" + " Y,\r\n" + " bean_brand,\r\n"
// + " brand,\r\n" + " TYPE,\r\n" + " skill,\r\n" + " take_time,\r\n" + " is_workshop,\r\n"
// + " fault_describe,\r\n" + " apply_note,\r\n" + " '" + batchDay + " 08:00:00' expect_time_begin,\r\n"
// + " '" + batchDay + " 18:00:00' expect_time_end,\r\n" + " expect_time_desc,\r\n" + " source,\r\n" + " bean_priority,\r\n"
// + " bean_tags,\r\n" + " bean_status,\r\n" + " bean_sub_status,\r\n" + " area_id,\r\n"
// + " org_cluster_id,\r\n" + " org_branch_id,\r\n" + " org_group_id,\r\n" + " org_team_id,\r\n"
// + " priority,\r\n" + " tags,\r\n" + " appointment_method,\r\n" + " appointment_status,\r\n"
// + " dispatcher,\r\n" + " order_status,\r\n" + " service_status,\r\n" + " null engineer_code,\r\n"
// + " null engineer_name,\r\n" + " null engineer_phone,\r\n" + " null engineer_code_sub,\r\n"
// + " null plan_start_time,\r\n" + " null plan_end_time,\r\n" + " arrive_elapsed,\r\n"
// + " arrive_distance,\r\n" + " actual_start_time,\r\n" + " actual_end_time,\r\n"
// + " description,\r\n" + " extra_info,\r\n" + " create_time,\r\n" + " update_time \r\n"
// + "FROM\r\n" + " order_info a \r\n" + "WHERE a.org_group_id = 'gsuzhou' \r\n" + " AND a.dt = '"
// + tempDay + "' \r\n" + " AND bean_status = 'OPEN' \r\n"
// + " AND appointment_method LIKE 'AUTO%' \r\n"
// + " AND a.appointment_status IN ('INIT', 'PRE') \r\n" + " AND order_status = 'NORMAL' \r\n"
// + " AND service_status = 'INIT' \r\n" + "";
// int createCount = jdbcTemplate.update(createOrder);
// }
log.info("清理原批次数据, groupId:{}, day:{}, batchNo:{}", groupId, batchDay, batchNo);
jdbcTemplate.update("delete from dispatch_engineer where group_id=? and batch_no=?", groupId, batchNo);
......
......@@ -3,9 +3,7 @@ package com.dituhui.pea.order.controller;
import cn.hutool.core.util.StrUtil;
import com.dituhui.pea.common.PageResult;
import com.dituhui.pea.common.Result;
import com.dituhui.pea.order.dto.MsgDTO;
import com.dituhui.pea.order.dto.MsgGroupResp;
import com.dituhui.pea.order.dto.MsgResp;
import com.dituhui.pea.order.dto.*;
import com.dituhui.pea.order.service.MsgService;
import com.dituhui.pea.order.utils.AssertUtil;
import com.dituhui.pea.order.utils.CommonUtil;
......@@ -39,7 +37,7 @@ public class MsgController {
*/
@GetMapping("/msg/list")
public Result<PageResult<MsgGroupResp>> list(@RequestHeader(name = "userId", required = true) String userId,
MsgDTO.Request request) {
MsgQuery request) {
CommonUtil.setNullValue(request);
request.setUserId(userId);
if (!"is_read".equalsIgnoreCase(request.getSort())) {
......@@ -65,8 +63,9 @@ public class MsgController {
* @date 2023/10/24
*/
@PostMapping("/msg/delete")
public Result<Boolean> delete(@RequestHeader(name = "userId", required = true) String userId, @RequestBody @Valid MsgDTO.DeleteDto dto) {
public Result<Boolean> delete(@RequestHeader(name = "userId", required = true) String userId, @RequestBody @Valid IdDTO dto) {
AssertUtil.isNotEmpty(userId, "用户ID不能为空");
AssertUtil.isNotNull(dto.getId(), "消息ID不能为空");
msgService.delete(dto.getId(), userId);
return Result.success(true);
}
......@@ -81,7 +80,7 @@ public class MsgController {
* @date 2023/10/24
*/
@PostMapping("/msg/read")
public Result<Boolean> read(@RequestHeader(name = "userId", required = true) String userId, @RequestBody @Valid MsgDTO.ReadDto dto) {
public Result<Boolean> read(@RequestHeader(name = "userId", required = true) String userId, @RequestBody @Valid IdsDTO dto) {
AssertUtil.isNotEmpty(userId, "用户ID不能为空");
msgService.readMsg(dto.getIds(), userId);
return Result.success(true);
......@@ -96,7 +95,7 @@ public class MsgController {
* @date 2023/10/25
*/
@PostMapping("/msg/add")
public Result<Boolean> add(@RequestBody @Valid MsgDTO.addDto dto) {
public Result<Boolean> add(@RequestBody @Valid MsgDTO dto) {
CommonUtil.setNullValue(dto);
AssertUtil.checkArgument(StrUtil.isNotEmpty(dto.getClusterId())
|| StrUtil.isNotEmpty(dto.getBranchId())
......
package com.dituhui.pea.order.dao;
import com.dituhui.pea.order.dto.MsgDTO;
import com.dituhui.pea.order.dto.MsgGroupResp;
import com.dituhui.pea.order.dto.MsgResp;
import com.dituhui.pea.order.dto.MsgQuery;
import com.dituhui.pea.order.entity.MsgEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
......@@ -23,6 +21,7 @@ public interface MsgDao extends JpaRepository<MsgEntity, Integer> {
" where IF(:#{#req.startDate} is not null, tt.create_time>=:#{#req.startDate}, 1=1)" +
" and IF(:#{#req.endDate} is not null, tt.create_time<:#{#req.endDate}, 1=1)" +
" and IF(:#{#req.keyWord} is not null, tt.content like concat('%',:#{#req.keyWord},'%'), 1=1)" +
" and IF(:#{#req.orgTreeValue} is not null, (tt.cluster_id=:#{#req.orgTreeValue} or tt.branch_id=:#{#req.orgTreeValue} or tt.group_id=:#{#req.orgTreeValue}), 1=1)" +
"group by tt.cluster_id,tt.branch_id,tt.group_id" +
") t",
countQuery = "select count(t.cluster_id)" +
......@@ -32,11 +31,12 @@ public interface MsgDao extends JpaRepository<MsgEntity, Integer> {
" where IF(:#{#req.startDate} is not null, tt.create_time>=:#{#req.startDate}, 1=1)" +
" and IF(:#{#req.endDate} is not null, tt.create_time<:#{#req.endDate}, 1=1)" +
" and IF(:#{#req.keyWord} is not null, tt.content like concat('%',:#{#req.keyWord},'%'), 1=1)" +
" and IF(:#{#req.orgTreeValue} is not null, (tt.cluster_id=:#{#req.orgTreeValue} or tt.branch_id=:#{#req.orgTreeValue} or tt.group_id=:#{#req.orgTreeValue}), 1=1)" +
"group by tt.cluster_id,tt.branch_id,tt.group_id" +
") t"
, nativeQuery = true // 开启原生sql
)
Page<Map<String, Objects>> getGroupList(@Param("req") MsgDTO.Request req, Pageable pageable);
Page<Map<String, Objects>> getGroupList(@Param("req") MsgQuery req, Pageable pageable);
@Query(value = "select t.* from (select tt.*,r.is_read," +
......@@ -51,7 +51,7 @@ public interface MsgDao extends JpaRepository<MsgEntity, Integer> {
") t"
, nativeQuery = true // 开启原生sql
)
List<Map<String, Objects>> getList(@Param("req") MsgDTO.Request req
List<Map<String, Objects>> getList(@Param("req") MsgQuery req
, @Param("msgGroupResp") MsgGroupResp msgGroupResp, Pageable pageable);
/**
......
......@@ -26,6 +26,10 @@ public class BusinessTeamAddDTO {
* 开放工作日
*/
private List<String> workdays;
private String workOn;
private String workOff;
}
......
......@@ -33,5 +33,9 @@ public class BusinessTeamUpdateDTO {
* 开放工作日
*/
private List<String> workdays;
private String workOn;
private String workOff;
}
}
......@@ -26,5 +26,10 @@ public class EngineerInfoListResp {
private List<String> tags;
private List<String> credentials;
private String grade;
/**
* 工作地址
*/
private String workAddress;
}
}
package com.dituhui.pea.order.dto;
import lombok.Data;
import javax.validation.constraints.NotNull;
/**
* 公共 id类
*
* @author RenPing
* @date 2023/10/26
*/
@Data
public class IdDTO {
@NotNull(message = "ID不能为空")
private Integer id;
}
package com.dituhui.pea.order.dto;
import lombok.Data;
import javax.validation.constraints.NotEmpty;
import java.util.List;
/**
* 公共 id集合类,用于批量操作
*
* @author RenPing
* @date 2023/10/26
*/
@Data
public class IdsDTO {
@NotEmpty(message = "Id集合不能为空")
private List<Integer> ids;
}
package com.dituhui.pea.order.dto;
import com.dituhui.pea.pojo.PageRequest;
import org.springframework.format.annotation.DateTimeFormat;
import lombok.Data;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.time.LocalDate;
import java.util.Date;
import java.util.List;
import static com.dituhui.pea.order.config.OrderConfig.DEFAULT_PAGE_SIZE;
@Data
public class MsgDTO {
@lombok.Data
public static class Request {
/**
* 每页大小
*/
private Integer size = DEFAULT_PAGE_SIZE;
/**
* 页码
*/
private Integer page = 1;
/**
* 当前用户Id,前端将userId放在header中
*/
private String userId;
/**
* 排序字段:create_time、is_read
*/
private String sort;
/**
* 排序类型:asc、desc
*/
private String sortType;
/**
* 开始日期
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date startDate;
/**
* 结束日期
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endDate;
/**
* 关键词模糊查询
*/
private String keyWord;
}
@lombok.Data
public static class DeleteDto {
@NotNull(message = "消息ID不能为空")
private Integer id;
}
@lombok.Data
public static class ReadDto {
/**
* 消息Id集合
*/
@NotEmpty(message = "消息Id集合不能为空")
private List<Integer> ids;
}
@lombok.Data
public static class addDto {
/**
* 大区ID(大区Id、分部Id、分组Id只需传一个)
*/
private String clusterId;
/**
* 分部ID
*/
private String branchId;
/**
* 小组ID
*/
private String groupId;
/**
* 消息类型,0:派工类,1:服务类,2:容量类
*/
@NotNull(message = "消息类型不能为空")
@Min(value = 0, message = "消息类型格式不对")
@Max(value = 2, message = "消息类型格式不对")
private Integer type;
/**
* 消息内容
*/
@NotNull(message = "消息内容不能为空")
private String content;
/**
* 单号集合,以“、”连接
*/
private String orderIds;
/**
* 标签类型,0:紧急,1:正常
*/
@NotNull(message = "标签类型不能为空")
@Min(value = 0, message = "标签类型格式不对")
@Max(value = 1, message = "标签类型格式不对")
private Integer tag;
}
/**
* 大区ID(大区Id、分部Id、分组Id只需传一个)
*/
private String clusterId;
/**
* 分部ID
*/
private String branchId;
/**
* 小组ID
*/
private String groupId;
/**
* 消息类型,0:派工类,1:服务类,2:容量类
*/
@NotNull(message = "消息类型不能为空")
@Min(value = 0, message = "消息类型格式不对")
@Max(value = 2, message = "消息类型格式不对")
private Integer type;
/**
* 消息内容
*/
@NotNull(message = "消息内容不能为空")
private String content;
/**
* 单号集合,以“、”连接
*/
private String orderIds;
/**
* 标签类型,0:紧急,1:正常
*/
@NotNull(message = "标签类型不能为空")
@Min(value = 0, message = "标签类型格式不对")
@Max(value = 1, message = "标签类型格式不对")
private Integer tag;
}
\ No newline at end of file
package com.dituhui.pea.order.dto;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.Date;
import static com.dituhui.pea.order.config.OrderConfig.DEFAULT_PAGE_SIZE;
@lombok.Data
public class MsgQuery {
/**
* 每页大小
*/
private Integer size = DEFAULT_PAGE_SIZE;
/**
* 页码
*/
private Integer page = 1;
/**
* 当前用户Id,前端将userId放在header中
*/
private String userId;
/**
* 排序字段:create_time、is_read
*/
private String sort;
/**
* 排序类型:asc、desc
*/
private String sortType;
/**
* 开始日期
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date startDate;
/**
* 结束日期
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endDate;
/**
* 关键词模糊查询
*/
private String keyWord;
/**
* 大区ID、部门ID、小组ID
*/
private String orgTreeValue;
}
\ No newline at end of file
......@@ -58,8 +58,11 @@ public class EngineerBusinessEntity implements Serializable {
@Column(name = "priority", nullable = false, columnDefinition = "tinyint(4) default '1'")
private int priority;
@Column(name = "departure", nullable = false, columnDefinition = "tinyint(4) default '0'")
private int departure;
/**
* 常规出发地,1配件仓,2家庭住址,3工作地址 默认工作地址
*/
@Column(name = "departure", nullable = false, columnDefinition = "tinyint(4) default '3'")
private int departure = 3;
@Column(name = "dispatch_strategy", nullable = false, length = 32, columnDefinition = "varchar(32) default 'CENTER'")
private String dispatchStrategy;
......
......@@ -58,6 +58,11 @@ public class EngineerInfoEntity {
private String address;
/**
* 工作地址
*/
private String workAddress;
/**
* 类型(1全职 2兼职)
*/
private Integer kind;
......
......@@ -31,7 +31,7 @@ public class OrgClusterEntity {
private String cityName;
private Integer status;
private Integer status = 1;
private String updateUser;
......
......@@ -88,5 +88,37 @@ public class OrgGroupEntity {
*/
private LocalDateTime updateTime = LocalDateTime.now();
public OrgGroupEntity() {}
public OrgGroupEntity() {
}
/**
* 管理城市列表
*/
private String citycodeList;
/**
* 部门缩写
*/
private String abbreviation;
/**
* 部门编号
*/
private String code;
/**
* 部门负责人联系方式
*/
private String phone;
/**
* 是否启用外围仓 0未启用 1启用
*/
private Integer warehouseEnabled = 0;
/**
* 最长配件保留时长(天)
*/
private Integer reserveTimeMax = 0;
/**
* 帐号状态(0无效 1有效)
*/
private Integer status = 1;
}
......@@ -49,9 +49,15 @@ public class OrgTeamEntity {
@Column(name = "update_time", nullable = false, columnDefinition = "timestamp default current_timestamp on update current_timestamp")
private LocalDateTime updateTime;
/**
* 工作起始时间
*/
@Column(name = "work_on", nullable = false, columnDefinition = "varchar(5) default '08:00'")
private String workOn = "08:00";
/**
* 工作截止时间
*/
@Column(name = "work_off", nullable = false, columnDefinition = "varchar(5) default '18:00'")
private String workOff = "18:00";
......
......@@ -22,7 +22,7 @@ public class ServiceOrg {
/**
* 状态;1正常、0注销
*/
private int status;
private Integer status;
/**
* 服务商类型
*/
......
......@@ -3,6 +3,7 @@ package com.dituhui.pea.order.service;
import com.dituhui.pea.common.PageResult;
import com.dituhui.pea.order.dto.MsgDTO;
import com.dituhui.pea.order.dto.MsgGroupResp;
import com.dituhui.pea.order.dto.MsgQuery;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
......@@ -17,7 +18,7 @@ public interface MsgService {
* @author RenPing
* @date 2023/10/23
*/
PageResult<MsgGroupResp> list(MsgDTO.Request request);
PageResult<MsgGroupResp> list(MsgQuery request);
/**
* 删除
......@@ -47,5 +48,5 @@ public interface MsgService {
* @author RenPing
* @date 2023/10/25
*/
void add(MsgDTO.addDto dto);
void add(MsgDTO dto);
}
......@@ -141,6 +141,11 @@ public class BeanRemoteServiceImpl {
}
/**
* 处理全部机构
*
* @return
*/
public Result allDepartment() {
//获取token
final String accessToken = getAccessToken();
......@@ -149,13 +154,20 @@ public class BeanRemoteServiceImpl {
return Result.failed(beanR.getMessage());
}
for (Department department : beanR.getData()) {
log.info("处理部门详情---->{}" + department.getBsDeptId());
log.info("处理部门详情---->{}", department.getBsDeptId());
Result result = this.departmentDetail(accessToken, department.getBsDeptId());
log.info("处理部门详情,id:{},结果---->{}" + department.getBsDeptId(), result.getCode());
log.info("处理部门详情,id:{},结果---->{}", department.getBsDeptId(), result.getCode());
}
return Result.success();
}
/**
* 处理单极机构,包含大区,分部,分站
*
* @param token
* @param orgId
* @return
*/
public Result departmentDetail(String token, String orgId) {
//获取token
BeanR<Department> departmentBeanR = beanRemoteService.departmentDetail(token, orgId);
......@@ -207,14 +219,33 @@ public class BeanRemoteServiceImpl {
groupEntity = new OrgGroupEntity();
}
groupEntity.setGroupName(data.getTagName());
//groupEntity.setAbbreviation(data.getAbbreviation());
//groupEntity.setStatus(data.getEnable());
//groupEntity.setCitycodeList(CollectionUtils.isEmpty(data.getManageCityList()) ? "" : JSONObject.toJSONString(data.getManageCityList()));
//groupEntity.setMemo(data.getDesc());
//groupEntity.setCode(data.getCode());
//groupEntity.setPhone(data.getPhone());
//groupEntity.setWarehouseEnabled(data.getPeripheralWarehouseEnabled());
//groupEntity.setReserveTimeMax(data.getPartReserveTimeMax());
groupEntity.setAbbreviation(data.getAbbreviation());
groupEntity.setStatus(data.getEnable());
groupEntity.setCitycodeList(CollectionUtils.isEmpty(data.getManageCityList()) ? "" : JSONObject.toJSONString(data.getManageCityList()));
groupEntity.setMemo(data.getDesc());
groupEntity.setCode(data.getCode());
groupEntity.setPhone(data.getPhone());
groupEntity.setWarehouseEnabled(data.getPeripheralWarehouseEnabled());
groupEntity.setReserveTimeMax(data.getPartReserveTimeMax());
//处理clusterId和branchId
OrgBranchEntity branchEntity = branchMap.get(data.getParentId());
if (ObjUtil.isNull(branchEntity)) {
branchEntity = orgBranchDao.getByBranchId(data.getParentId());
if (ObjUtil.isNull(branchEntity)) {
return Result.failed();
}
branchMap.put(data.getParentId(), branchEntity);
}
groupEntity.setBranchId(data.getParentId());
groupEntity.setClusterId(branchEntity.getClusterId());
//处理分站外围
if (data.getDeptType().equals(BeanOrgLevelEnum.PERIPHERY.getCode())) {
groupEntity.setKind(2);
}
if (data.getDeptType().equals(BeanOrgLevelEnum.STATION.getCode())) {
groupEntity.setKind(1);
}
groupEntity.setCategory(1);
orgGroupDao.save(groupEntity);
return Result.success();
}
......@@ -223,6 +254,53 @@ public class BeanRemoteServiceImpl {
/**
* 处理全部网点
*
* @return
*/
public Result serviceOrgList() {
//获取token
final String accessToken = getAccessToken();
BeanR<List<ServiceOrg>> listBeanR = beanRemoteService.serviceOrgList(accessToken, 1);
log.info("[查询网点/车队列表]【/api/openapi/department/queryServiceOrgList】返回值-------------------->{}", JsonUtil.toJson(listBeanR));
if (!listBeanR.getSuccess() || ObjUtil.isNull(listBeanR.getData())) {
return Result.failed(listBeanR.getMessage());
}
for (ServiceOrg serviceOrg : listBeanR.getData()) {
log.info("处理网点部门详情---->{}", serviceOrg.getServiceOrgId());
Result result = this.serviceOrgDetail(accessToken, serviceOrg);
log.info("处理网点部门详情,id:{},结果---->{}", serviceOrg.getServiceOrgId(), result.getCode());
}
return Result.success();
}
private Result serviceOrgDetail(String accessToken, ServiceOrg serviceOrg) {
BeanR<ServiceOrgDetail> beanR = beanRemoteService.serviceOrgDetail(accessToken, serviceOrg.getServiceOrgId());
log.info("[查询网点/车队列表]【/api/openapi/department/queryServiceOrgList】返回值-------------------->{}", JsonUtil.toJson(beanR));
if (!beanR.getSuccess() || ObjUtil.isNull(beanR.getData())) {
return Result.failed(beanR.getMessage());
}
ServiceOrgDetail data = beanR.getData();
OrgGroupEntity groupEntity = orgGroupDao.getByGroupId(data.getServiceOrgId());
if (ObjUtil.isNull(groupEntity)) {
groupEntity = new OrgGroupEntity();
}
groupEntity.setGroupName(data.getName());
groupEntity.setStatus(data.getStatus());
groupEntity.setCitycodeList(CollectionUtils.isEmpty(data.getServiceRange()) ? "" : JSONObject.toJSONString(data.getServiceRange()));
groupEntity.setPhone(data.getContactPhone());
groupEntity.setBranchId(data.getBelongBranch().getBsDeptId());
groupEntity.setClusterId(data.getBelongRegion().getBsDeptId());
//处理分站外围
groupEntity.setKind(4);
groupEntity.setCategory(2);
groupEntity.setAddress(data.getBusinessAddress().getAddress());
orgGroupDao.save(groupEntity);
return Result.success();
}
/**
* 获取bean token
*
* @return
......
......@@ -131,6 +131,8 @@ public class BusinessTeamServiceImpl implements BusinessTeamService {
.setTeamName(req.getTeamName())
.setTeamType(TEAMTYPE_PEA)
.setWarehouseId(req.getWarehouseId())
.setWorkOn(req.getWorkOn())
.setWorkOff(req.getWorkOff())
.setCreateTime(LocalDateTime.now())
.setUpdateTime(LocalDateTime.now());
if (req.getWorkdays() != null) {
......@@ -177,6 +179,12 @@ public class BusinessTeamServiceImpl implements BusinessTeamService {
if (StringUtils.isNotBlank(req.getGroupId())) {
entity.setGroupId(req.getGroupId());
}
if (StringUtils.isNotBlank(req.getWorkOn())) {
entity.setWorkOn(req.getWorkOn());
}
if (StringUtils.isNotBlank(req.getWorkOff())) {
entity.setWorkOff(req.getWorkOff());
}
entity.setUpdateTime(LocalDateTime.now());
orgTeamDao.save(entity);
......
......@@ -7,6 +7,7 @@ import com.dituhui.pea.common.PageResult;
import com.dituhui.pea.order.dao.*;
import com.dituhui.pea.order.dto.MsgDTO;
import com.dituhui.pea.order.dto.MsgGroupResp;
import com.dituhui.pea.order.dto.MsgQuery;
import com.dituhui.pea.order.dto.MsgResp;
import com.dituhui.pea.order.entity.MsgEntity;
import com.dituhui.pea.order.entity.MsgReceiverEntity;
......@@ -47,7 +48,7 @@ public class MsgServiceImpl implements MsgService {
private OrgGroupDao groupDao;
@Override
public PageResult<MsgGroupResp> list(MsgDTO.Request request) {
public PageResult<MsgGroupResp> list(MsgQuery request) {
Sort sort = Sort.by("asc".equalsIgnoreCase(request.getSortType()) ? Sort.Direction.ASC : Sort.Direction.DESC, request.getSort());
Pageable pageable = PageRequest.of(request.getPage() - 1, request.getSize(), sort);
Page<Map<String, Objects>> page = msgDao.getGroupList(request, pageable);
......@@ -100,7 +101,7 @@ public class MsgServiceImpl implements MsgService {
@Override
@Transactional(rollbackFor = Exception.class)
public void add(MsgDTO.addDto dto) {
public void add(MsgDTO dto) {
if (Objects.nonNull(dto.getGroupId())) {
OrgGroupEntity group = groupDao.getByGroupId(dto.getGroupId());
dto.setBranchId(group.getBranchId());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!