Compare commits
11 Commits
7137904683
...
d1d6874178
| Author | SHA1 | Date |
|---|---|---|
|
|
d1d6874178 | |
|
|
1c7e3d2fc6 | |
|
|
4901af59a8 | |
|
|
39873804a3 | |
|
|
ba8285c918 | |
|
|
9d638fb7a5 | |
|
|
6ac373d254 | |
|
|
6803f3cb0d | |
|
|
33f1b52a3b | |
|
|
bc685775f6 | |
|
|
085f766c8f |
|
|
@ -23,7 +23,7 @@ public interface ServiceConstant {
|
|||
* 工单 相关
|
||||
* 项目-工单
|
||||
*/
|
||||
String INSPECTION = "inspection-service";
|
||||
String INSPECTION = "inspection-service-2";
|
||||
|
||||
/**
|
||||
* 工单模块消费者组
|
||||
|
|
@ -49,7 +49,7 @@ public interface ServiceConstant {
|
|||
/**
|
||||
* 后台任务
|
||||
*/
|
||||
String TASK = "task-service";
|
||||
String TASK = "task-service-1";
|
||||
/**
|
||||
* 后台任务模块消费者组
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -47,6 +47,12 @@ public class SysDept extends BaseEntity
|
|||
/** 部门状态:0停用,1正常 */
|
||||
private Boolean status;
|
||||
|
||||
private String email;
|
||||
|
||||
private String leader;
|
||||
|
||||
private String phone;
|
||||
|
||||
/** 父部门名称 */
|
||||
@TableField(exist = false)
|
||||
private String parentName;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,13 @@ import java.time.LocalDateTime;
|
|||
@Data
|
||||
public class EmployeeVO {
|
||||
|
||||
|
||||
private String projectName;
|
||||
|
||||
private String taskName;
|
||||
|
||||
private Long userId;
|
||||
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
|
|
@ -54,5 +61,10 @@ public class EmployeeVO {
|
|||
*/
|
||||
private Integer terminalNum;
|
||||
|
||||
/**
|
||||
* 新增商户数
|
||||
*/
|
||||
private Integer storeNum;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -71,4 +71,7 @@ public class WrkProjectPaymentVO {
|
|||
*/
|
||||
private String paymentMonth;
|
||||
|
||||
private Long userId;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import java.time.LocalDateTime;
|
|||
import com.chushang.inspection.terminal.enums.MerTypeOperation;
|
||||
import com.chushang.inspection.work.dto.WrkIcbcJsReceive;
|
||||
import com.chushang.inspection.work.enums.BankBranchesEnum;
|
||||
import com.chushang.inspection.work.po.WrkIcbcJs;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
|
@ -176,16 +177,30 @@ public class Store extends BaseEntity {
|
|||
this.storePhone = dto.getContactWay();
|
||||
this.storeAddress = dto.getMerAddress();
|
||||
this.storeType = MerTypeOperation.valueOfCode(dto.getMerType());
|
||||
// todo 所属 任务id
|
||||
this.taskId = 1L;
|
||||
// todo 所属部门id
|
||||
this.deptId = 1L;
|
||||
this.taskId = 1701151817643495425L;
|
||||
this.deptId = 218L;
|
||||
this.createBy = "zhuguihua";
|
||||
this.isEnter = 2;
|
||||
Long lowerTaskId = BankBranchesEnum.getByCode(dto.getArea());
|
||||
this.lowerTaskId = lowerTaskId == null ? this.taskId : lowerTaskId;
|
||||
// todo 此处需要获取对应的项目id
|
||||
this.projectId = BankBranchesEnum.getProjectByCode(dto.getArea());
|
||||
return this;
|
||||
}
|
||||
|
||||
public Store saveJcIcbc(WrkIcbcJs w) {
|
||||
this.storeNo = w.getMerId();
|
||||
this.storeName = w.getMerName();
|
||||
this.storeContact = w.getLinkName();
|
||||
this.storePhone = w.getContactWay();
|
||||
this.storeAddress = w.getMerAddress();
|
||||
this.storeType = MerTypeOperation.valueOfCode(w.getMerType());
|
||||
this.taskId = 1701151817643495425L;
|
||||
this.deptId = 218L;
|
||||
this.createBy = "zhuguihua";
|
||||
this.isEnter = 2;
|
||||
Long lowerTaskId = BankBranchesEnum.getByCode(w.getArea());
|
||||
this.lowerTaskId = lowerTaskId == null ? this.taskId : lowerTaskId;
|
||||
this.projectId = BankBranchesEnum.getProjectByCode(w.getArea());
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ import com.chushang.common.mybatis.base.BaseEntity;
|
|||
|
||||
import com.chushang.inspection.work.dto.WrkIcbcJsReceive;
|
||||
import com.chushang.inspection.work.enums.TerminalTypeOperation;
|
||||
import com.chushang.inspection.work.po.WrkIcbcJs;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
|
@ -146,4 +147,20 @@ public class Terminal extends BaseEntity {
|
|||
this.projectId = store.getProjectId();
|
||||
return this;
|
||||
}
|
||||
|
||||
public Terminal save(Store store, WrkIcbcJs w) {
|
||||
this.storeId = store.getStoreId();
|
||||
this.storeNo = store.getStoreNo();
|
||||
this.taskId = store.getTaskId();
|
||||
this.lowerTaskId = store.getLowerTaskId();
|
||||
this.deptId = store.getDeptId();
|
||||
this.createBy = store.getCreateBy();
|
||||
this.terminalNo = w.getTermId();
|
||||
this.terminalSn = w.getDeviceNo();
|
||||
this.terminalType = TerminalTypeOperation.valueOfCode(w.getDeviceType());
|
||||
this.remark = w.getNoteMsg();
|
||||
this.occupy = 0;
|
||||
this.projectId = store.getProjectId();
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,19 +10,19 @@ import lombok.Getter;
|
|||
@AllArgsConstructor
|
||||
public enum BankBranchesEnum {
|
||||
|
||||
NANJING_BRANCH("4301", 82582240034336768L, 1L),
|
||||
SUZHOU_BRANCH("1102", 75464095280726016L, 1L),
|
||||
WUXI_BRANCH("1103", 1712316534449692673L, 1L),
|
||||
ZHENJIANG_BRANCH("1104", 130057876893859840L, 1L),
|
||||
CHANGZHOU_BRANCH("1105", 130058354490892288L, 1L),
|
||||
XUZHOU_BRANCH("1106", 130058663179059200L, 1L),
|
||||
LIANYUNGANG_BRANCH("1107", 104793956746788864L, 1L),
|
||||
YANGZHOU_BRANCH("1108", 130041300719325184L, 1L),
|
||||
YANCheng_BRANCH("1109", 130058775791927296L, 1L),
|
||||
HUAIAN_BRANCH("1110", 130058895585443840L, 1L),
|
||||
NANTONG_BRANCH("1111", 130058943010463744L, 1L),
|
||||
TAIZHOU_BRANCH("1115", 1706151311862829058L, 1L),
|
||||
SUQIAN_BRANCH("1116", 130059053442293760L, 1L);
|
||||
NANJING_BRANCH("4301", 82582240034336768L, 1818103750965534722L),
|
||||
SUZHOU_BRANCH("1102", 75464095280726016L, 1818103750965534722L),
|
||||
WUXI_BRANCH("1103", 1712316534449692673L, 1818103750965534722L),
|
||||
ZHENJIANG_BRANCH("1104", 130057876893859840L, 1818103750965534722L),
|
||||
CHANGZHOU_BRANCH("1105", 130058354490892288L, 1818103750965534722L),
|
||||
XUZHOU_BRANCH("1106", 130058663179059200L, 1818103750965534722L),
|
||||
LIANYUNGANG_BRANCH("1107", 104793956746788864L, 1818103750965534722L),
|
||||
YANGZHOU_BRANCH("1108", 130041300719325184L, 1818103750965534722L),
|
||||
YANCheng_BRANCH("1109", 130058775791927296L, 1818103750965534722L),
|
||||
HUAIAN_BRANCH("1110", 130058895585443840L, 1818103750965534722L),
|
||||
NANTONG_BRANCH("1111", 130058943010463744L, 1818103750965534722L),
|
||||
TAIZHOU_BRANCH("1115", 1706151311862829058L, 1818103750965534722L),
|
||||
SUQIAN_BRANCH("1116", 130059053442293760L, 1818103750965534722L);
|
||||
|
||||
|
||||
private final String code;
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.chushang.common.dict.annotation.DictFormat;
|
||||
import com.chushang.common.mybatis.base.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
|
@ -11,6 +12,7 @@ import lombok.EqualsAndHashCode;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @auther: zhao
|
||||
|
|
@ -65,15 +67,32 @@ public class WrkAuditRule extends BaseEntity {
|
|||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 规则内容
|
||||
*/
|
||||
@TableField(value = "content")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField(value = "dept_id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 分钟数量
|
||||
*/
|
||||
@TableField(value = "number")
|
||||
private Integer number;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@TableField(value = "number_type")
|
||||
@DictFormat(dictType = "sys_auditTime_type")
|
||||
private Integer numberType;
|
||||
|
||||
/**
|
||||
* 条数
|
||||
*/
|
||||
@TableField(value = "number_wrk")
|
||||
private Integer numberWrk;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<String> ruleTimeList;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ public class WrkDispatchRecord extends BaseEntity {
|
|||
private String userName;
|
||||
|
||||
@TableField(value = "work_no")
|
||||
private Long workNo;
|
||||
private String workNo;
|
||||
|
||||
@TableField(value = "terminal_source")
|
||||
private Integer terminalSource;
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public class WrkInfo extends BaseEntity {
|
|||
* 工单编号
|
||||
*/
|
||||
@TableField(value = "work_no")
|
||||
private Long workNo;
|
||||
private String workNo;
|
||||
|
||||
/**
|
||||
* 工单类型
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.chushang.common.mybatis.page.CommonParam;
|
|||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
|
|
@ -52,11 +53,6 @@ public class WrkAuditRuleDTO {
|
|||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 规则内容
|
||||
*/
|
||||
@TableField(value = "content")
|
||||
private String content;
|
||||
|
||||
/**
|
||||
* 所属部门
|
||||
|
|
@ -64,5 +60,26 @@ public class WrkAuditRuleDTO {
|
|||
@TableField(value = "dept_id")
|
||||
private Long deptId;
|
||||
|
||||
/**
|
||||
* 分钟数量
|
||||
*/
|
||||
@TableField(value = "number")
|
||||
private Integer number;
|
||||
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
@TableField(value = "number_type")
|
||||
private Integer numberType;
|
||||
|
||||
/**
|
||||
* 条数
|
||||
*/
|
||||
@TableField(value = "number_wrk")
|
||||
private Integer numberWrk;
|
||||
|
||||
|
||||
@TableField(exist = false)
|
||||
private List<String> ruleTimeList;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@
|
|||
<groupId>com.chushang</groupId>
|
||||
<artifactId>system-feign</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mariadb.jdbc</groupId>
|
||||
<artifactId>mariadb-java-client</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ public class GeneratedInsFactory {
|
|||
null,
|
||||
false,
|
||||
"",
|
||||
"downFile", SecurityConstants.INNER);
|
||||
"wrkGen", SecurityConstants.INNER);
|
||||
// 不为空时, 说明 上传成功
|
||||
if (listResult.isSuccess() && CollectionUtil.isNotEmpty(listResult.getData())){
|
||||
log.info("上传成功");
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 模板相关管理
|
||||
|
|
@ -90,8 +91,9 @@ public class TemplateController {
|
|||
@SysLog(value = "模板", businessType = BusinessType.UPLOAD)
|
||||
@PostMapping(value = "/upload")
|
||||
@RequiresPermissions(value = "ins:template:upload")
|
||||
public AjaxResult uploadTemplate(@RequestParam MultipartFile file){
|
||||
return AjaxResult.success(tbTemplateService.uploadFile(file));
|
||||
public AjaxResult uploadTemplate(@RequestPart(name = "file") MultipartFile file,
|
||||
@RequestParam String templateType) throws IOException {
|
||||
return AjaxResult.success(tbTemplateService.uploadFile(file, templateType));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -201,6 +201,40 @@ public class WrkProjectController {
|
|||
return AjaxResult.success(projectService.empData(projectQuery));
|
||||
}
|
||||
|
||||
/**
|
||||
* 人工数据详情
|
||||
*/
|
||||
@GetMapping(value = "/detail/{userId}")
|
||||
// @RequiresPermissions("inspection:project:info")
|
||||
public AjaxResult detail(@PathVariable Long userId)
|
||||
{
|
||||
return AjaxResult.success(projectService.empDetail(userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目数据导出
|
||||
* @param projectQuery 查询条件
|
||||
*/
|
||||
@SysLog(value = "项目数据", businessType = BusinessType.EXPORT)
|
||||
@GetMapping(value = "/emp/data/export")
|
||||
// @RequiresPermissions("inspection:project:export")
|
||||
public AjaxResult empDataExport(ProjectQuery projectQuery)
|
||||
{
|
||||
return AjaxResult.success("人员数据导出成功, 请在后台任务中查看, 任务id: ["+ projectService.projectDataExport(projectQuery) +"]");
|
||||
}
|
||||
|
||||
/**
|
||||
* 财务数据导出
|
||||
* @param projectQuery 查询条件
|
||||
*/
|
||||
@SysLog(value = "财务数据", businessType = BusinessType.EXPORT)
|
||||
@GetMapping(value = "/payMentData/data/export")
|
||||
// @RequiresPermissions("inspection:project:export")
|
||||
public AjaxResult payMentDataExport(ProjectQuery projectQuery)
|
||||
{
|
||||
return AjaxResult.success("财务数据导出成功, 请在后台任务中查看, 任务id: ["+ projectService.projectDataExport(projectQuery) +"]");
|
||||
}
|
||||
//
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ import com.chushang.inspection.project.po.Template;
|
|||
import com.chushang.oss.entity.vo.FileSourceVo;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* @auther: zhao
|
||||
* @date: 2024/7/2 11:04
|
||||
|
|
@ -27,5 +29,5 @@ public interface TbTemplateService extends IService<Template> {
|
|||
);
|
||||
}
|
||||
|
||||
FileSourceVo uploadFile(MultipartFile file);
|
||||
FileSourceVo uploadFile(MultipartFile file, String templateType) throws IOException;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@ public class WrkProjectPaymentService extends ServiceImpl<WrkProjectPaymentMappe
|
|||
@Resource
|
||||
WrkProjectContractService contractService;
|
||||
|
||||
public List<WrkProjectPaymentVO> payMentData(WrkProjectPayment query, CommonParam commonParam)
|
||||
public PageResult payMentData(WrkProjectPayment query, CommonParam commonParam)
|
||||
{
|
||||
Page<Store> page = new Page<>(commonParam.getPage(), commonParam.getLimit());
|
||||
return baseMapper.payMentData(query,page);
|
||||
return new PageResult(baseMapper.payMentData(query,page),page.getTotal(),page.getSize(),page.getCurrent());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -305,13 +305,13 @@ public class WrkProjectService extends ServiceImpl<WrkProjectMapper, WrkProject>
|
|||
AssertUtil.invalidate (recordList <= 0, "导出数据为空");
|
||||
CreateTaskDTO createTask = CreateTaskDTO.builder()
|
||||
.params(JSON.toJSONString(projectQuery))
|
||||
.taskName("项目数据导出")
|
||||
.taskName("人员数据导出")
|
||||
.applicationName(ServiceEnum.INSPECTION)
|
||||
.methodName("export")
|
||||
.className(this.getClass().getName())
|
||||
.deptId(SecurityUtils.getDeptId())
|
||||
.taskType(TaskTypeEnum.DOWN)
|
||||
.remark("五统一商户明细导出")
|
||||
.remark("人员数据明细导出")
|
||||
.createBy(SecurityUtils.getUsername())
|
||||
.userId(SecurityUtils.getUserId())
|
||||
.build();
|
||||
|
|
@ -396,11 +396,33 @@ public class WrkProjectService extends ServiceImpl<WrkProjectMapper, WrkProject>
|
|||
}
|
||||
|
||||
public PageResult empData(ProjectQuery projectQuery) {
|
||||
CommonParam commonParam = CommonParam.buildPageRequest();
|
||||
Page<WrkInfoDetailsVO> page = new Page<>(commonParam.getPage(), commonParam.getLimit());
|
||||
List<EmployeeVO> employeeVOList1 = wrkInfoService.empData(
|
||||
projectQuery
|
||||
return wrkInfoService.empData(projectQuery);
|
||||
}
|
||||
|
||||
public PageResult empDetail(Long userId){
|
||||
return wrkInfoService.detailData(userId);
|
||||
}
|
||||
|
||||
@DataScope
|
||||
public Long empDataExport(ProjectQuery projectQuery) {
|
||||
|
||||
LambdaQueryWrapper<WrkProject> sql = WrapperUtils.builder(projectQuery, CommonParam.buildAllRequest());
|
||||
long recordList = this.count(
|
||||
sql
|
||||
);
|
||||
return new PageResult(employeeVOList1,page.getTotal(),page.getSize(),page.getCurrent());
|
||||
AssertUtil.invalidate (recordList <= 0, "导出数据为空");
|
||||
|
||||
return remoteTaskService.createTask(CreateTaskDTO.builder()
|
||||
.params(JSON.toJSONString(projectQuery))
|
||||
.taskName("项目数据导出")
|
||||
.applicationName(ServiceEnum.INSPECTION)
|
||||
.methodName("export")
|
||||
.className(this.getClass().getName())
|
||||
.deptId(SecurityUtils.getDeptId())
|
||||
.taskType(TaskTypeEnum.DOWN)
|
||||
.remark("五统一商户明细导出")
|
||||
.createBy(SecurityUtils.getUsername())
|
||||
.build(), SecurityConstants.INNER).getData();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import com.chushang.common.mybatis.utils.WrapperUtils;
|
|||
import com.chushang.inspection.project.mapper.TemplateMapper;
|
||||
import com.chushang.inspection.project.po.Template;
|
||||
import com.chushang.inspection.project.service.TbTemplateService;
|
||||
import com.chushang.oss.entity.dto.UploadFileDTO;
|
||||
import com.chushang.oss.entity.dto.UploadBytesDTO;
|
||||
import com.chushang.oss.entity.vo.FileSourceVo;
|
||||
import com.chushang.oss.feign.RemoteOssService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -22,6 +22,7 @@ import org.springframework.stereotype.Service;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -72,12 +73,15 @@ public class TemplateServiceImpl extends ServiceImpl<TemplateMapper, Template> i
|
|||
}
|
||||
|
||||
@Override
|
||||
public FileSourceVo uploadFile(MultipartFile file) {
|
||||
public FileSourceVo uploadFile(MultipartFile file, String templateType) throws IOException {
|
||||
// 上传模板信息
|
||||
Result<List<FileSourceVo>> listResult =
|
||||
remoteOssService.uploadFile(UploadFileDTO.builder()
|
||||
.files(new MultipartFile[]{file})
|
||||
.build(), null, false, null, "template", SecurityConstants.INNER);
|
||||
remoteOssService.uploadBytes(
|
||||
UploadBytesDTO.builder()
|
||||
.bytes(file.getBytes())
|
||||
.build(),
|
||||
file.getOriginalFilename(),
|
||||
false, null, templateType, SecurityConstants.INNER);
|
||||
if (listResult.isSuccess() && CollectionUtil.isNotEmpty(listResult.getData())){
|
||||
FileSourceVo fileSourceVo = listResult.getData().get(0);
|
||||
Template template = new Template();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.chushang.inspection.project.vo.CountVO;
|
|||
import com.chushang.inspection.terminal.po.Store;
|
||||
import com.chushang.inspection.terminal.query.StoreQuery;
|
||||
import com.chushang.inspection.work.dto.WrkIcbcJsReceive;
|
||||
import com.chushang.inspection.work.po.WrkIcbcJs;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -39,4 +40,6 @@ public interface StoreService extends IService<Store>{
|
|||
}
|
||||
return Map.of();
|
||||
}
|
||||
|
||||
Store saveJcIcbc(WrkIcbcJs w);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.chushang.inspection.terminal.query.TerminalAppQuery;
|
|||
import com.chushang.inspection.terminal.query.TerminalQuery;
|
||||
import com.chushang.inspection.work.dto.DispatchDTO;
|
||||
import com.chushang.inspection.work.dto.WrkIcbcJsReceive;
|
||||
import com.chushang.inspection.work.po.WrkIcbcJs;
|
||||
import com.chushang.inspection.work.query.DispatchQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
|
|
@ -88,4 +89,6 @@ public interface TerminalService extends IService<Terminal>{
|
|||
}
|
||||
return Map.of();
|
||||
}
|
||||
|
||||
JSONObject save(Store store, WrkIcbcJs w);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.chushang.inspection.terminal.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.alibaba.csp.sentinel.util.StringUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.chushang.common.core.constant.SecurityConstants;
|
||||
|
|
@ -13,6 +14,7 @@ import com.chushang.inspection.terminal.query.StoreQuery;
|
|||
import com.chushang.inspection.terminal.service.StoreService;
|
||||
import com.chushang.inspection.terminal.vo.StoreVO;
|
||||
import com.chushang.inspection.work.dto.WrkIcbcJsReceive;
|
||||
import com.chushang.inspection.work.po.WrkIcbcJs;
|
||||
import com.chushang.system.feign.RemoteDeptService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
|
@ -63,14 +65,33 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
|||
*/
|
||||
@Override
|
||||
public Store saveJcIcbc(WrkIcbcJsReceive dto) {
|
||||
Store store = getOne(new LambdaQueryWrapper<Store>()
|
||||
.eq(Store::getTaskId, "")
|
||||
List<Store> stores = list(new LambdaQueryWrapper<Store>()
|
||||
.eq(Store::getTaskId, 1701151817643495425L)
|
||||
.eq(Store::getStoreNo, dto.getMerId())
|
||||
);
|
||||
if (store == null) {
|
||||
Store store;
|
||||
if (CollectionUtil.isEmpty(stores)){
|
||||
store = new Store().saveJcIcbc(dto);
|
||||
save(store);
|
||||
}
|
||||
// 如果不为空, 不需要重新创建一条数据
|
||||
else {
|
||||
store = stores.stream()
|
||||
.filter(s -> StringUtil.isNotEmpty(s.getStoreAddress())
|
||||
&& s.getStoreAddress().equals(dto.getMerAddress()))
|
||||
.collect(Collectors.toSet()).stream().findFirst().orElse(null);
|
||||
if (store != null){
|
||||
store = new Store().saveJcIcbc(dto);
|
||||
save(store);
|
||||
}
|
||||
// 判断两个地址是否相同, 不同的话, 重新入库一条商户id
|
||||
// String storeAddress = store.getStoreAddress();
|
||||
// String merAddress = dto.getMerAddress();
|
||||
// if (StringUtil.isNotEmpty(storeAddress) && StringUtil.isNotEmpty(merAddress) &&
|
||||
// storeAddress.equals(merAddress)){
|
||||
//
|
||||
// }
|
||||
}
|
||||
return store;
|
||||
}
|
||||
|
||||
|
|
@ -79,4 +100,35 @@ public class StoreServiceImpl extends ServiceImpl<StoreMapper, Store> implements
|
|||
return baseMapper.countByProjectIds(projectIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Store saveJcIcbc(WrkIcbcJs w) {
|
||||
List<Store> stores = list(new LambdaQueryWrapper<Store>()
|
||||
.eq(Store::getTaskId, 1701151817643495425L)
|
||||
.eq(Store::getStoreNo, w.getMerId())
|
||||
);
|
||||
Store store;
|
||||
if (CollectionUtil.isEmpty(stores)){
|
||||
store = new Store().saveJcIcbc(w);
|
||||
save(store);
|
||||
}
|
||||
// 如果不为空, 不需要重新创建一条数据
|
||||
else {
|
||||
store = stores.stream()
|
||||
.filter(s -> s.getStoreAddress().equals(w.getMerAddress()))
|
||||
.collect(Collectors.toSet()).stream().findFirst().orElse(null);
|
||||
if (store == null){
|
||||
store = new Store().saveJcIcbc(w);
|
||||
save(store);
|
||||
}
|
||||
// 判断两个地址是否相同, 不同的话, 重新入库一条商户id
|
||||
// String storeAddress = store.getStoreAddress();
|
||||
// String merAddress = dto.getMerAddress();
|
||||
// if (StringUtil.isNotEmpty(storeAddress) && StringUtil.isNotEmpty(merAddress) &&
|
||||
// storeAddress.equals(merAddress)){
|
||||
//
|
||||
// }
|
||||
}
|
||||
return store;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ import com.chushang.inspection.utils.TaskConfigUtils;
|
|||
import com.chushang.inspection.work.dto.DispatchDTO;
|
||||
import com.chushang.inspection.work.dto.WrkIcbcJsReceive;
|
||||
import com.chushang.inspection.work.po.WrkDispatchRecord;
|
||||
import com.chushang.inspection.work.po.WrkIcbcJs;
|
||||
import com.chushang.inspection.work.po.WrkInfo;
|
||||
import com.chushang.inspection.work.query.DispatchQuery;
|
||||
import com.chushang.system.feign.RemoteDeptService;
|
||||
|
|
@ -168,6 +169,28 @@ public class TerminalServiceImpl extends ServiceImpl<TerminalMapper, Terminal> i
|
|||
return baseMapper.countByProjectIds(projectIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONObject save(Store store, WrkIcbcJs w) {
|
||||
Terminal terminal = getOne(new LambdaQueryWrapper<Terminal>()
|
||||
.eq(Terminal::getStoreId, store.getStoreId())
|
||||
.eq(Terminal::getTerminalNo, w.getTermId())
|
||||
);
|
||||
TerminalIns terminalIns;
|
||||
if (terminal == null){
|
||||
terminal = new Terminal().save(store, w);
|
||||
save(terminal);
|
||||
terminalIns = new TerminalIns();
|
||||
terminalIns.setTerminalId(terminal.getTerminalId());
|
||||
terminalIns.setIsEnter(2);
|
||||
terminalIns.setCreateBy(store.getCreateBy());
|
||||
terminalInsService.save(terminalIns);
|
||||
return JSONObject.of("terminal", terminal, "terminalIns", terminalIns);
|
||||
}else {
|
||||
terminalIns = terminalInsService.getById(terminal.getTerminalId());
|
||||
}
|
||||
return JSONObject.of("terminal", terminal, "terminalIns", terminalIns);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public long updateTerminalAndStore(TerminalQuery query) {
|
||||
|
|
|
|||
|
|
@ -50,4 +50,7 @@ public interface WrkInfoMapper extends BaseMapper<WrkInfo> {
|
|||
List<WrkDataVO> wrkData(@Param("query") WrkDataQuery wrkDataQuery, Page<WrkDataVO> page);
|
||||
|
||||
List<EmployeeVO> empData(@Param("query") ProjectQuery projectQuery, Page<WrkInfo> page);
|
||||
|
||||
|
||||
List<EmployeeVO> empDetail(@Param("userId") Long userId, Page<WrkInfo> page);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,5 @@ public interface WrkAuditRuleService extends IService<WrkAuditRule> {
|
|||
|
||||
int saveOrUpdate(WrkAuditRuleDTO dto);
|
||||
|
||||
int update(WrkAuditRuleDTO dto);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,4 +26,5 @@ public interface WrkIcbcJsService extends IService<WrkIcbcJs> {
|
|||
void manualPush(Long id);
|
||||
|
||||
void push(WrkInfoDetailsVO infoDetail);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.chushang.inspection.work.service;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.chushang.common.mybatis.utils.PageResult;
|
||||
import com.chushang.common.mybatis.utils.WrapperUtils;
|
||||
import com.chushang.inspection.project.dto.AuditDTO;
|
||||
import com.chushang.inspection.project.query.ProjectQuery;
|
||||
import com.chushang.inspection.project.vo.CountVO;
|
||||
|
|
@ -52,7 +54,10 @@ public interface WrkInfoService extends IService<WrkInfo> {
|
|||
|
||||
List<CountVO> countByProjectIds(Set<Long> projectIds, Set<Integer> wrkType);
|
||||
|
||||
List<EmployeeVO> empData(ProjectQuery projectQuery);
|
||||
PageResult empData(ProjectQuery projectQuery);
|
||||
|
||||
PageResult detailData(Long userId);
|
||||
|
||||
default Map<Long, Integer> countByProjectIdsMap(Set<Long> projectIds, Set<Integer> wrkType){
|
||||
List<CountVO> countVOS = countByProjectIds(projectIds, wrkType);
|
||||
if (CollectionUtil.isNotEmpty(countVOS)){
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ import com.chushang.task.enums.ServiceEnum;
|
|||
import com.chushang.task.enums.TaskTypeEnum;
|
||||
import com.chushang.task.feign.RemoteTaskService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.bouncycastle.util.Strings;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
|
@ -86,12 +87,30 @@ public class WrkAuditRuleServiceImpl extends ServiceImpl<WrkAuditRuleMapper, Wrk
|
|||
|
||||
@Override
|
||||
public PageResult queryRulePage(WrkAuditRuleQuery query) {
|
||||
Map<String,String> date = new HashMap<>();
|
||||
date.put("1","周一");
|
||||
date.put("2","周二");
|
||||
date.put("3","周三");
|
||||
date.put("4","周四");
|
||||
date.put("5","周五");
|
||||
date.put("6","周六");
|
||||
date.put("7","周日");
|
||||
CommonParam commonParam = CommonParam.buildPageRequest();
|
||||
LambdaQueryWrapper<WrkAuditRule> queryWrapper = WrapperUtils.builder(query, commonParam);
|
||||
IPage<WrkAuditRule> page = this.page(
|
||||
new com.baomidou.mybatisplus.extension.plugins.pagination.Page<>(commonParam.getPage(), commonParam.getLimit()),
|
||||
queryWrapper
|
||||
);
|
||||
for (WrkAuditRule record : page.getRecords()) {
|
||||
List<String> list = new ArrayList<>();
|
||||
for (String s : record.getRuleTime().split(",")) {
|
||||
list.add(date.get(s));
|
||||
}
|
||||
record.setRuleTimeList(Arrays.asList(record.getRuleTime().split(",")));
|
||||
record.setRuleTime(String.join(",", list));
|
||||
|
||||
}
|
||||
|
||||
return new PageResult(page);
|
||||
}
|
||||
|
||||
|
|
@ -101,18 +120,19 @@ public class WrkAuditRuleServiceImpl extends ServiceImpl<WrkAuditRuleMapper, Wrk
|
|||
WrkAuditRule wrkAuditRule = this.getById(dto.getId());
|
||||
Assert.notNull(wrkAuditRule, "修改失败,数据不存在");
|
||||
BeanUtil.copyProperties(dto, wrkAuditRule);
|
||||
if(!dto.getRuleTimeList().isEmpty()){
|
||||
wrkAuditRule.setRuleTime(String.join(",", dto.getRuleTimeList()));
|
||||
}
|
||||
return this.updateById(wrkAuditRule) ? 1 : 0;
|
||||
} else {
|
||||
WrkAuditRule wrkAuditRule = new WrkAuditRule();
|
||||
BeanUtil.copyProperties(dto, wrkAuditRule);
|
||||
wrkAuditRule.setId(IdUtil.getSnowflakeNextId());
|
||||
wrkAuditRule.setDeptId(SecurityUtils.getDeptId());
|
||||
wrkAuditRule.setUserId(SecurityUtils.getUserId());
|
||||
wrkAuditRule.setRuleTime(String.join(",", dto.getRuleTimeList()));
|
||||
return this.save(wrkAuditRule) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int update(WrkAuditRuleDTO dto) {
|
||||
|
||||
return this.removeById(dto.getId()) ? 1 : 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,8 +44,10 @@ import com.chushang.inspection.work.vo.WrkInfoDetailsVO;
|
|||
import com.chushang.inspection.work.vo.WrkInfoVO;
|
||||
import com.chushang.security.entity.po.SysUser;
|
||||
import com.chushang.system.feign.RemoteUserService;
|
||||
import com.mysql.cj.jdbc.JdbcConnection;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.chushang.inspection.work.mapper.WrkIcbcJsMapper;
|
||||
|
|
@ -189,7 +191,7 @@ public class WrkIcbcJsServiceImpl extends ServiceImpl<WrkIcbcJsMapper, WrkIcbcJs
|
|||
private WrkInfo dispatchWrkInfo(DispatchDTO dispatch, Long userId, String userName, Integer workType) {
|
||||
WrkInfo wrkInfo = BeanUtil.copyProperties(dispatch, WrkInfo.class);
|
||||
wrkInfo.setUserId(userId);
|
||||
wrkInfo.setWorkNo(IdUtil.getSnowflake().nextId());
|
||||
wrkInfo.setWorkNo(String.valueOf(IdUtil.getSnowflake().nextId()));
|
||||
wrkInfo.setUserName(userName);
|
||||
wrkInfo.setWrkStatus(1);
|
||||
wrkInfo.setWorkType(workType);
|
||||
|
|
|
|||
|
|
@ -331,7 +331,7 @@ public class WrkInfoPhoneServiceImpl extends ServiceImpl<WrkInfoPhoneMapper, Wrk
|
|||
ExcelUtils.exportList(outputStream, WrkInfoPhoneImportDTO.class, errList,"电话工单导入异常");
|
||||
Result<List<FileSourceVo>> ossResult = remoteOssService.uploadBytes(
|
||||
UploadBytesDTO.builder().bytes(outputStream.toByteArray()).build()
|
||||
, "", null, null, "importFile", SecurityConstants.INNER);
|
||||
, "", null, null, "phoneWrk", SecurityConstants.INNER);
|
||||
if (ossResult.isSuccess() && CollectionUtil.isNotEmpty(ossResult.getData())){
|
||||
List<FileSourceVo> data = ossResult.getData();
|
||||
FileSourceVo fileSourceVo = data.get(0);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import com.alibaba.fastjson2.JSON;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.chushang.common.core.constant.SecurityConstants;
|
||||
import com.chushang.common.core.exception.ResultException;
|
||||
import com.chushang.common.core.exception.utils.AssertUtil;
|
||||
import com.chushang.common.core.util.DateUtils;
|
||||
import com.chushang.common.core.util.IPUtils;
|
||||
|
|
@ -31,12 +32,14 @@ import com.chushang.common.mybatis.utils.WrapperUtils;
|
|||
import com.chushang.datascope.annotation.DataScope;
|
||||
import com.chushang.inspection.ins.GeneratedInsFactory;
|
||||
import com.chushang.inspection.project.dto.AuditDTO;
|
||||
import com.chushang.inspection.project.po.InspectionConfig;
|
||||
import com.chushang.inspection.project.po.InspectionData;
|
||||
import com.chushang.inspection.project.query.ProjectQuery;
|
||||
import com.chushang.inspection.project.service.InspectionDataService;
|
||||
import com.chushang.inspection.project.service.PollingTaskService;
|
||||
import com.chushang.inspection.project.vo.CountVO;
|
||||
import com.chushang.inspection.project.vo.EmployeeVO;
|
||||
import com.chushang.inspection.project.vo.ProjectVO;
|
||||
import com.chushang.inspection.terminal.po.FiveStore;
|
||||
import com.chushang.inspection.terminal.po.Store;
|
||||
import com.chushang.inspection.terminal.po.Terminal;
|
||||
|
|
@ -251,7 +254,7 @@ public class WrkInfoServiceImpl extends ServiceImpl<WrkInfoMapper, WrkInfo> impl
|
|||
wrkInfo.setAccountPhone(store.getAccountPhone());
|
||||
wrkInfo.setAccountManager(store.getAccountManager());
|
||||
wrkInfo.setUserName(userInfoData.getNickName());
|
||||
wrkInfo.setWorkNo(IdUtil.getSnowflake().nextId());
|
||||
wrkInfo.setWorkNo(String.valueOf(IdUtil.getSnowflake().nextId()));
|
||||
wrkInfo.setWorkType(query.getWorkType());
|
||||
wrkInfo.setWorkMethod(method);
|
||||
wrkInfo.setWorkSort(query.getWorkSort());
|
||||
|
|
@ -790,10 +793,55 @@ public class WrkInfoServiceImpl extends ServiceImpl<WrkInfoMapper, WrkInfo> impl
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<EmployeeVO> empData(ProjectQuery projectQuery) {
|
||||
public PageResult empData(ProjectQuery projectQuery) {
|
||||
CommonParam commonParam = CommonParam.buildPageRequest();
|
||||
Page<WrkInfo> page = new Page<>(commonParam.getPage(), commonParam.getLimit());
|
||||
return baseMapper.empData(projectQuery,page);
|
||||
List<EmployeeVO> employeeVOList = baseMapper.empData(projectQuery, page);
|
||||
Set<Long> deptIds = employeeVOList.stream().map(EmployeeVO::getDeptId).collect(Collectors.toSet());
|
||||
Set<Long> userIds = employeeVOList.stream().map(EmployeeVO::getUserId).collect(Collectors.toSet());
|
||||
// 查询全部部门
|
||||
Map<Long, String> deptNameMap
|
||||
= remoteDeptService.getDeptNameByIds(deptIds, SecurityConstants.INNER);
|
||||
|
||||
Map<Long, SysUser> userNameByIds = userFeignService.getUserNameByIds(userIds, SecurityConstants.INNER);
|
||||
System.out.println(JSON.toJSONString(userNameByIds));
|
||||
// 被派单次数
|
||||
LambdaQueryWrapper<WrkInfo> configSql = WrapperUtils.builder();
|
||||
configSql.in(WrkInfo::getUserId, userIds);
|
||||
|
||||
// 查询全部工单
|
||||
for (EmployeeVO employeeVO:employeeVOList){
|
||||
employeeVO.setDeptName(deptNameMap.get(employeeVO.getDeptId()));
|
||||
employeeVO.setProjectConcat(userNameByIds.get(employeeVO.getUserId()) == null ?"admin":userNameByIds.get(employeeVO.getUserId()).getNickName());
|
||||
employeeVO.setProjectPhone(userNameByIds.get(employeeVO.getUserId())== null ? "17638147107":userNameByIds.get(employeeVO.getUserId()).getPhone());
|
||||
}
|
||||
|
||||
return new PageResult(employeeVOList,page.getTotal(),page.getSize(),page.getCurrent());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult detailData(Long userId) {
|
||||
CommonParam commonParam = CommonParam.buildPageRequest();
|
||||
Page<WrkInfo> page = new Page<>(commonParam.getPage(), commonParam.getLimit());
|
||||
List<EmployeeVO> employeeVOList = baseMapper.empDetail(userId,page);
|
||||
Set<Long> deptIds = employeeVOList.stream().map(EmployeeVO::getDeptId).collect(Collectors.toSet());
|
||||
Set<Long> userIds = employeeVOList.stream().map(EmployeeVO::getUserId).collect(Collectors.toSet());
|
||||
// 查询全部部门
|
||||
Map<Long, String> deptNameMap
|
||||
= remoteDeptService.getDeptNameByIds(deptIds, SecurityConstants.INNER);
|
||||
|
||||
Map<Long, SysUser> userNameByIds = userFeignService.getUserNameByIds(userIds, SecurityConstants.INNER);
|
||||
// 被派单次数
|
||||
LambdaQueryWrapper<WrkInfo> configSql = WrapperUtils.builder();
|
||||
configSql.in(WrkInfo::getUserId, userIds);
|
||||
|
||||
// 查询全部工单
|
||||
for (EmployeeVO employeeVO:employeeVOList){
|
||||
employeeVO.setDeptName(deptNameMap.get(employeeVO.getDeptId()));
|
||||
employeeVO.setProjectConcat(userNameByIds.get(employeeVO.getUserId()) == null ?"admin":userNameByIds.get(employeeVO.getUserId()).getNickName());
|
||||
employeeVO.setProjectPhone(userNameByIds.get(employeeVO.getUserId())== null ? "17638147107":userNameByIds.get(employeeVO.getUserId()).getPhone());
|
||||
}
|
||||
return new PageResult(employeeVOList,page.getTotal(),page.getSize(),page.getCurrent());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -177,8 +177,7 @@
|
|||
ORDER BY i.create_time desc
|
||||
</select>
|
||||
<sql id="wrkInfoDetailSql">
|
||||
SELECT
|
||||
i.wrk_id,
|
||||
SELECT i.wrk_id,
|
||||
i.`dept_id`,
|
||||
i.`task_id`,
|
||||
i.`lower_task_id`,
|
||||
|
|
@ -242,8 +241,7 @@
|
|||
itr.`terminal_version`,
|
||||
itr.`terminal_property`,
|
||||
itr.`terminal_status`
|
||||
FROM
|
||||
`wrk_info` i
|
||||
FROM `wrk_info` i
|
||||
LEFT JOIN wrk_info_store_record isr ON i.wrk_id = isr.wrk_id
|
||||
LEFT JOIN wrk_info_terminal_record itr ON i.wrk_id = itr.wrk_id
|
||||
LEFT JOIN wrk_info_terminal_ins_record itir ON i.wrk_id = itir.wrk_id
|
||||
|
|
@ -302,14 +300,26 @@
|
|||
</select>
|
||||
|
||||
<select id="empData" resultType="com.chushang.inspection.project.vo.EmployeeVO">
|
||||
SELECT account_manager as projectConcat ,account_phone as projectPhone,
|
||||
count(user_id) as dispatchNum,
|
||||
count(case when wrk_status = 3 then 1 when wrk_status = 4 then 1 end) as aduitNum
|
||||
SELECT user_id as userId,dept_id as deptId,count(user_id) as dispatchNum,count(CASE WHEN wrk_status = 4 OR wrk_status = 7
|
||||
THEN 1 ELSE 0 END) as aduitNum
|
||||
FROM wrk_info
|
||||
where del_state = 0
|
||||
<if test="query.projectConcat != null and query.projectConcat != ''">
|
||||
AND project_concat = #{projectConcat}
|
||||
AND project_concat = #{query.projectConcat}
|
||||
</if>
|
||||
GROUP BY user_id
|
||||
</select>
|
||||
|
||||
<select id="empDetail" resultType="com.chushang.inspection.project.vo.EmployeeVO">
|
||||
SELECT t1.user_id as userId,
|
||||
t1.dept_id as deptId,
|
||||
t1.lower_task_name as taskName,
|
||||
t2.project_name as projectName,
|
||||
count(1) as dispatchNum,count(CASE WHEN t1.wrk_status = 4 OR t1.wrk_status = 7
|
||||
THEN 1 ELSE 0 END) as aduitNum
|
||||
FROM wrk_info t1 inner join wrk_project t2 on t1.project_id = t2.project_id
|
||||
where t1.del_state = 0
|
||||
and t1.user_id = #{userId}
|
||||
GROUP BY t1.project_id,t1.lower_task_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
t2.dept_name as deptName,
|
||||
t1.contract_amount as contractAmount,
|
||||
t2.dept_id as deptId,
|
||||
t1.payment_amount as paymentAmount,
|
||||
t1.payment_amount as paymentAmount
|
||||
from
|
||||
wrk_project_contract t1 inner join wrk_project t2 on t1.project_id = t2.project_id
|
||||
<where>
|
||||
|
|
@ -33,4 +33,33 @@
|
|||
</where>
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCountByUserId" resultType="com.chushang.inspection.project.vo.CountVO">
|
||||
select
|
||||
|
||||
t1.contract_amount as contractAmount,
|
||||
t2.dept_id as deptId,
|
||||
t1.project_id as projectId,
|
||||
t2.project_name as projectName,
|
||||
from
|
||||
wrk_info t1 inner join wrk_project t2 on t1.project_id = t2.project_id
|
||||
<where>
|
||||
<if test="query.projectName != null and query.projectName != ''">
|
||||
AND t2.project_name like concat('%', #{query.projectName}, '%')
|
||||
</if>
|
||||
<if test="query.projectConcat != null">
|
||||
AND t2.project_concat = #{query.projectConcat}
|
||||
</if>
|
||||
<if test="query.projectPhone != null">
|
||||
AND t2.project_phone = #{query.projectPhone}
|
||||
</if>
|
||||
<if test="query.deptId != null">
|
||||
AND t2.dept_id = #{query.deptId}
|
||||
</if>
|
||||
<if test="1 == 1">
|
||||
${query.sqlParam.get('dataScope')}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class GenInsTest {
|
|||
wrkInfo.setTaskId(200L);
|
||||
wrkInfo.setUserId(1L);
|
||||
wrkInfo.setUserName("admin");
|
||||
wrkInfo.setWorkNo(IdUtil.getSnowflakeNextId());
|
||||
wrkInfo.setWorkNo(String.valueOf(IdUtil.getSnowflakeNextId()));
|
||||
wrkInfo.setWorkSort(1);
|
||||
// wrkInfo.setWrkId(1814239505998278658L);
|
||||
wrkInfoService.save(wrkInfo);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,310 @@
|
|||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.chushang.InspectionApplication;
|
||||
import com.chushang.inspection.terminal.po.Store;
|
||||
import com.chushang.inspection.terminal.po.Terminal;
|
||||
import com.chushang.inspection.terminal.po.TerminalIns;
|
||||
import com.chushang.inspection.terminal.service.StoreService;
|
||||
import com.chushang.inspection.terminal.service.TerminalInsService;
|
||||
import com.chushang.inspection.terminal.service.TerminalService;
|
||||
import com.chushang.inspection.work.po.*;
|
||||
import com.chushang.inspection.work.service.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
import po.Column;
|
||||
import po.WrkInfoEntity;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.lang.reflect.Field;
|
||||
import java.sql.*;
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Slf4j
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = InspectionApplication.class)
|
||||
public class JsIcbcTest {
|
||||
@Resource
|
||||
private WrkIcbcJsService wrkIcbcJsService;
|
||||
@Resource
|
||||
TerminalService terminalService;
|
||||
@Resource
|
||||
StoreService storeService;
|
||||
@Resource
|
||||
TerminalInsService terminalInsService;
|
||||
|
||||
@Resource
|
||||
WrkInfoService wrkInfoService;
|
||||
@Resource
|
||||
WrkInfoStoreRecordService storeRecordService;
|
||||
@Resource
|
||||
WrkInfoTerminalRecordService terminalRecordService;
|
||||
@Resource
|
||||
WrkInfoTerminalInsRecordService terminalInsRecordService;
|
||||
|
||||
private WrkIcbcJs update(WrkIcbcJs w, JSONObject terJson, Store store) {
|
||||
Terminal terminal = terJson.getObject("terminal", Terminal.class);
|
||||
// 江苏工行实体类信息
|
||||
WrkIcbcJs wrkIcbcJs = new WrkIcbcJs();
|
||||
wrkIcbcJs.setStoreId(store.getStoreId());
|
||||
wrkIcbcJs.setTerminalId(terminal.getTerminalId());
|
||||
wrkIcbcJs.setId(w.getId());
|
||||
wrkIcbcJsService.updateById(wrkIcbcJs);
|
||||
return wrkIcbcJs;
|
||||
}
|
||||
|
||||
@Test
|
||||
public void jsWrkTest() {
|
||||
// JDBC连接URL
|
||||
String url = "jdbc:mariadb://119.97.184.98:3306/work_inspection?serverTimezone=GMT%2B8&characterEncoding=utf8&useSSL=false&autoReconnect=true&failOverReadOnly=false&rewriteBatchedStatements=true";
|
||||
String username = "inspection";
|
||||
String password = "qq630638001";
|
||||
List<WrkIcbcJs> list = wrkIcbcJsService.list();
|
||||
mergeJsIcbc(list);
|
||||
|
||||
Map<Long, WrkInfo> wrkInfos = new HashMap<>();
|
||||
Map<Long, WrkInfoStoreRecord> storeRecords = new HashMap<>();
|
||||
Map<Long, WrkInfoTerminalRecord> terminalRecords = new HashMap<>();
|
||||
Map<Long, WrkInfoTerminalInsRecord> terminalInsRecords = new HashMap<>();
|
||||
try {
|
||||
// 创建数据库连接
|
||||
Connection conn = DriverManager.getConnection(url, username, password);
|
||||
String collect = list.stream()
|
||||
.filter(w -> null != w.getWrkId()).map(w -> String.valueOf(w.getWrkId()))
|
||||
.collect(Collectors.joining(","));
|
||||
|
||||
Map<Long, WrkIcbcJs> jsMap = list.stream()
|
||||
.filter(w -> null != w.getWrkId()).collect(Collectors.toMap(
|
||||
WrkIcbcJs::getWrkId,
|
||||
w -> w,
|
||||
(o, n) -> n
|
||||
));
|
||||
|
||||
|
||||
String selectSql = "SELECT * FROM wrk_info WHERE id in ( " + collect + ")";
|
||||
PreparedStatement pstmt = conn.prepareStatement(selectSql);
|
||||
List<WrkInfoEntity> wrkInfoEntitys = convertToList(pstmt.executeQuery(), WrkInfoEntity.class);
|
||||
for (WrkInfoEntity wrkInfoEntity : wrkInfoEntitys) {
|
||||
Long wrkId = wrkInfoEntity.getId();
|
||||
if (null == wrkId) continue;
|
||||
WrkIcbcJs wrkIcbcJs = jsMap.get(wrkId);
|
||||
Store store = storeService.getById(wrkIcbcJs.getStoreId());
|
||||
Terminal terminal = terminalService.getById(wrkIcbcJs.getTerminalId());
|
||||
TerminalIns terminalIns = terminalInsService.getById(terminal.getTerminalId());
|
||||
terminal.setTerminalId(wrkIcbcJs.getTerminalId());
|
||||
terminal.setTerminalStatus(wrkInfoEntity.getTerminalStatus());
|
||||
terminal.setOccupy(wrkInfoEntity.getState() == 1 ? 1 : 0);
|
||||
terminal.setTerminalModel(wrkInfoEntity.getTerminalModel());
|
||||
terminal.setTerminalAddress(wrkInfoEntity.getTerminalAddress());
|
||||
terminal.setTerminalSource(wrkInfoEntity.getTerminalSource());
|
||||
terminal.setTerminalVersion(wrkInfoEntity.getTerminalVersion());
|
||||
|
||||
store.setState(wrkInfoEntity.getStoreStatus());
|
||||
store.setInsFre(wrkInfoEntity.getInsFre());
|
||||
store.setSpecialNum(wrkInfoEntity.getSpecialNum());
|
||||
store.setShopName(wrkInfoEntity.getShopName());
|
||||
store.setStoreName(wrkInfoEntity.getName());
|
||||
store.setStoreType(wrkInfoEntity.getType());
|
||||
store.setProducts(wrkInfoEntity.getProducts());
|
||||
store.setAccountManager(wrkInfoEntity.getAccountManager());
|
||||
store.setAccountPhone(wrkInfoEntity.getAccountPhone());
|
||||
store.setRegisterTime(null != wrkInfoEntity.getRegisterTime() ? wrkInfoEntity.getRegisterTime().atStartOfDay() : null);
|
||||
store.setRegisterAddress(wrkInfoEntity.getRegisterAddress());
|
||||
|
||||
terminalIns.setTerminalId(wrkIcbcJs.getTerminalId());
|
||||
terminalIns.setServiceResult(wrkInfoEntity.getServiceResult());
|
||||
terminalIns.setIsEnter(2);
|
||||
terminalIns.setDeviation(wrkInfoEntity.getDeviation());
|
||||
terminalIns.setPreCodeEncoding(wrkInfoEntity.getPrecodeEncoding());
|
||||
terminalIns.setInspectionStatus(1);
|
||||
terminalIns.setInspectionTime(wrkInfoEntity.getDisposeTime());
|
||||
terminalIns.setOperatorId(String.valueOf(wrkInfoEntity.getUserId()));
|
||||
terminalIns.setWorkAddress(wrkInfoEntity.getWorkAdderss());
|
||||
terminalIns.setWorkLocation(wrkInfoEntity.getWorkLocation());
|
||||
terminalIns.setGeographicAddress(wrkInfoEntity.getLocationAddress());
|
||||
terminalIns.setGeographicLocation(wrkInfoEntity.getGeographicLocation());
|
||||
|
||||
updateStoreAndTer(store, terminal, terminalIns);
|
||||
|
||||
WrkInfo wrkInfo = getWrkInfo(wrkInfoEntity);
|
||||
wrkInfo.setProjectId(store.getProjectId());
|
||||
wrkInfo.setDeptId(store.getDeptId());
|
||||
|
||||
WrkInfoStoreRecord wrkInfoStoreRecord = BeanUtil.copyProperties(store, WrkInfoStoreRecord.class);
|
||||
wrkInfoStoreRecord.setWrkId(wrkInfoEntity.getId());
|
||||
wrkInfoStoreRecord.setProjectId(store.getProjectId());
|
||||
|
||||
WrkInfoTerminalRecord wrkInfoTerminalRecord = BeanUtil.copyProperties(terminal, WrkInfoTerminalRecord.class);
|
||||
wrkInfoTerminalRecord.setWrkId(wrkInfo.getWrkId());
|
||||
wrkInfoTerminalRecord.setProjectId(store.getProjectId());
|
||||
WrkInfoTerminalInsRecord wrkInfoTerminalInsRecord = BeanUtil.copyProperties(terminalIns, WrkInfoTerminalInsRecord.class);
|
||||
wrkInfoTerminalInsRecord.setWrkId(wrkInfo.getWrkId());
|
||||
|
||||
saveWrk(wrkInfo, wrkInfoStoreRecord, wrkInfoTerminalRecord, wrkInfoTerminalInsRecord);
|
||||
|
||||
wrkInfos.put(wrkId, wrkInfo);
|
||||
storeRecords.put(wrkId, wrkInfoStoreRecord);
|
||||
terminalRecords.put(wrkId, wrkInfoTerminalRecord);
|
||||
terminalInsRecords.put(wrkId, wrkInfoTerminalInsRecord);
|
||||
|
||||
}
|
||||
|
||||
conn.close();
|
||||
// 关闭连接
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
log.info("wrk {}", wrkInfos.size());
|
||||
log.info("storeRecords {}", storeRecords.size());
|
||||
log.info("terminalRecords {}", terminalRecords.size());
|
||||
log.info("terminalInsRecords {}", terminalInsRecords.size());
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void saveWrk(WrkInfo wrkInfo, WrkInfoStoreRecord wrkInfoStoreRecord, WrkInfoTerminalRecord wrkInfoTerminalRecord, WrkInfoTerminalInsRecord wrkInfoTerminalInsRecord) {
|
||||
wrkInfoService.save(wrkInfo);
|
||||
storeRecordService.save(wrkInfoStoreRecord);
|
||||
terminalRecordService.save(wrkInfoTerminalRecord);
|
||||
terminalInsRecordService.save(wrkInfoTerminalInsRecord);
|
||||
}
|
||||
|
||||
public void mergeJsIcbc(List<WrkIcbcJs> list) {
|
||||
for (WrkIcbcJs w : list) {
|
||||
Store store = storeService.saveJcIcbc(w);
|
||||
JSONObject save = terminalService.save(store, w);
|
||||
update(w, save, store);
|
||||
}
|
||||
}
|
||||
|
||||
public void updateStoreAndTer(Store store, Terminal terminal, TerminalIns terminalIns) {
|
||||
storeService.updateById(store);
|
||||
terminalService.updateById(terminal);
|
||||
terminalInsService.updateById(terminalIns);
|
||||
}
|
||||
|
||||
public WrkInfo getWrkInfo(WrkInfoEntity wrkInfoEntity) {
|
||||
WrkInfo wrkInfo = new WrkInfo();
|
||||
wrkInfo.setWrkId(wrkInfoEntity.getId());
|
||||
wrkInfo.setWorkNo(wrkInfoEntity.getWorkNo());
|
||||
wrkInfo.setWorkType(wrkInfoEntity.getWorkType());
|
||||
wrkInfo.setWorkSource(wrkInfoEntity.getWorkSource());
|
||||
wrkInfo.setWorkMethod(wrkInfoEntity.getWorkMethod());
|
||||
wrkInfo.setWorkSort(wrkInfoEntity.getWorkSort());
|
||||
wrkInfo.setDisposeTime(wrkInfoEntity.getDisposeTime());
|
||||
wrkInfo.setAccountManager(wrkInfoEntity.getAccountManager());
|
||||
wrkInfo.setAccountPhone(wrkInfoEntity.getAccountPhone());
|
||||
wrkInfo.setServiceResult(wrkInfoEntity.getServiceResult());
|
||||
wrkInfo.setRemark(wrkInfo.getRemark());
|
||||
wrkInfo.setEndTime(wrkInfoEntity.getEndTime());
|
||||
//
|
||||
Integer state = wrkInfoEntity.getState();
|
||||
wrkInfo.setWrkStatus(state == 3 ? 7 : state);
|
||||
wrkInfo.setRegisterTime(wrkInfoEntity.getRegisterTime());
|
||||
wrkInfo.setDisSchedule(wrkInfo.getDisSchedule());
|
||||
wrkInfo.setUserId(wrkInfoEntity.getUserId());
|
||||
wrkInfo.setUserName(wrkInfoEntity.getWorkName());
|
||||
wrkInfo.setTaskId(wrkInfoEntity.getTaskId());
|
||||
wrkInfo.setLowerTaskId(wrkInfoEntity.getLowerTaskId());
|
||||
return wrkInfo;
|
||||
}
|
||||
|
||||
private static final Pattern UNDERLINE_PATTERN = Pattern.compile("_([a-z])");
|
||||
|
||||
/**
|
||||
* 字符串转换为驼峰命名
|
||||
*
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
public static String underlineToHump(String str) {
|
||||
//正则匹配下划线及后一个字符,删除下划线并将匹配的字符转成大写
|
||||
Matcher matcher = UNDERLINE_PATTERN.matcher(str);
|
||||
StringBuilder sb = new StringBuilder(str);
|
||||
if (matcher.find()) {
|
||||
sb = new StringBuilder();
|
||||
//将当前匹配的子串替换成指定字符串,并且将替换后的子串及之前到上次匹配的子串之后的字符串添加到StringBuffer对象中
|
||||
//正则之前的字符和被替换的字符
|
||||
matcher.appendReplacement(sb, matcher.group(1).toUpperCase());
|
||||
//把之后的字符串也添加到StringBuffer对象中
|
||||
matcher.appendTail(sb);
|
||||
} else {
|
||||
//去除除字母之外的前面带的下划线
|
||||
return sb.toString().replaceAll("_", "");
|
||||
}
|
||||
return underlineToHump(sb.toString());
|
||||
}
|
||||
|
||||
|
||||
public static <T> T convertToTarget(ResultSet rs, Class clazz) throws SQLException, InstantiationException, IllegalAccessException {
|
||||
//结果集的元素对象
|
||||
ResultSetMetaData rsmd = rs.getMetaData();
|
||||
//获取结果集的元素个数
|
||||
int colCount = rsmd.getColumnCount();
|
||||
//业务对象的属性数组
|
||||
Field[] fields = clazz.getDeclaredFields();
|
||||
T obj = (T) clazz.newInstance();//构造业务对象实体
|
||||
//将每一个字段取出进行赋值
|
||||
for (int i = 1; i <= colCount; i++) {
|
||||
boolean match = false;
|
||||
//寻找该列对应的对象属性
|
||||
for (int j = 0; j < fields.length; j++) {
|
||||
Field field = fields[j];
|
||||
//查看是否有注解,有则根据注解中的名称来匹配
|
||||
if (field.isAnnotationPresent(Column.class)) {
|
||||
Column column = field.getAnnotation(Column.class);
|
||||
if (column.ignore()) {
|
||||
break;
|
||||
}
|
||||
String columnName = column.value();
|
||||
String columnNameOfSql = rsmd.getColumnName(i);
|
||||
if (columnName.equalsIgnoreCase(columnNameOfSql) && columnNameOfSql != null) {
|
||||
match = true;
|
||||
}
|
||||
}
|
||||
//如果匹配进行赋值,匹配时,将数据库的列名称转换为驼峰命名法再比较
|
||||
else if (field.getName().equalsIgnoreCase(underlineToHump(rsmd.getColumnName(i)))) {
|
||||
match = true;
|
||||
}
|
||||
if (match) {
|
||||
boolean flag = field.isAccessible();
|
||||
//通过类型获取属性值
|
||||
Class<?> type = field.getType();
|
||||
Object value = rs.getObject(i, type);
|
||||
//直接获取会使jdbc将数据库中的int直接转化为Long类型,导致类型赋值错误
|
||||
//Object value = rs.getObject(i);
|
||||
field.setAccessible(true);
|
||||
field.set(obj, value);
|
||||
field.setAccessible(flag);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将rs结果转换成对象列表
|
||||
*
|
||||
* @param rs jdbc结果集
|
||||
* @param clazz 对象的映射类
|
||||
* return 封装了对象的结果列表
|
||||
*/
|
||||
public static <T> List<T> convertToList(ResultSet rs, Class clazz) throws SQLException, InstantiationException, IllegalAccessException {
|
||||
//返回结果的列表集合
|
||||
List list = new ArrayList();
|
||||
//对每一条记录进行操作
|
||||
while (rs.next()) {
|
||||
T obj = convertToTarget(rs, clazz);
|
||||
list.add(obj);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package po;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* @author wansheng
|
||||
* @createDate 2023/6/26 16:30
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.FIELD)
|
||||
public @interface Column {
|
||||
/**
|
||||
* 属性对应的数据库列名称
|
||||
* @return
|
||||
*/
|
||||
String value();
|
||||
|
||||
/**
|
||||
* 是否忽视该属性的赋值
|
||||
* @return
|
||||
*/
|
||||
boolean ignore() default false;
|
||||
}
|
||||
|
|
@ -0,0 +1,334 @@
|
|||
package po;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 工单信息 实体类。
|
||||
*
|
||||
* @author 单傲
|
||||
* @since v1.0
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class WrkInfoEntity {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
protected Long id;
|
||||
|
||||
/**
|
||||
* 创建者
|
||||
*/
|
||||
@Column("create_by")
|
||||
protected String createBy;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@Column("update_by")
|
||||
protected String updateBy;
|
||||
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@Column("create_time")
|
||||
protected LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column("update_time")
|
||||
protected LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
@Column("tenant_id")
|
||||
private Long tenantId;
|
||||
|
||||
/**
|
||||
* 商户id
|
||||
*/
|
||||
@Column("store_id")
|
||||
private Long storeId;
|
||||
|
||||
/**
|
||||
* 终端id
|
||||
*/
|
||||
@Column("terminal_id")
|
||||
private Long terminalId;
|
||||
|
||||
/**
|
||||
* 总任务id
|
||||
*/
|
||||
@Column("task_id")
|
||||
private Long taskId;
|
||||
|
||||
/**
|
||||
* 本级id
|
||||
*/
|
||||
@Column("lower_task_id")
|
||||
private Long lowerTaskId;
|
||||
|
||||
/**
|
||||
* 业务员id
|
||||
*/
|
||||
@Column("user_id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 业务员名字
|
||||
*/
|
||||
@Column("work_name")
|
||||
private String workName;
|
||||
|
||||
/**
|
||||
* 工单编号
|
||||
*/
|
||||
@Column("work_no")
|
||||
private String workNo;
|
||||
|
||||
/**
|
||||
* 工单类型
|
||||
*/
|
||||
@Column("work_type")
|
||||
private Integer workType;
|
||||
|
||||
/**
|
||||
* 巡检方式
|
||||
*/
|
||||
@Column("work_method")
|
||||
private Integer workMethod;
|
||||
|
||||
/**
|
||||
* 工单优先级
|
||||
*/
|
||||
@Column("work_sort")
|
||||
private Integer workSort;
|
||||
|
||||
/**
|
||||
* 工单来源
|
||||
*/
|
||||
@Column("work_source")
|
||||
private Integer workSource;
|
||||
|
||||
/**
|
||||
* 业务员处理时间
|
||||
*/
|
||||
@Column("dispose_time")
|
||||
private LocalDateTime disposeTime;
|
||||
|
||||
/**
|
||||
* 终端状态
|
||||
*/
|
||||
@Column("terminal_status")
|
||||
private Integer terminalStatus;
|
||||
|
||||
/**
|
||||
* 服务结果
|
||||
*/
|
||||
@Column("service_result")
|
||||
private Integer serviceResult;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Column("remark")
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Column("state")
|
||||
private Integer state;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@Column("end_time")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 门店状态
|
||||
*/
|
||||
@Column("store_status")
|
||||
private Integer storeStatus;
|
||||
|
||||
/**
|
||||
* 商户编号
|
||||
*/
|
||||
private String no;
|
||||
|
||||
/**
|
||||
* 商户名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 商户联系人
|
||||
*/
|
||||
private String contact;
|
||||
|
||||
/**
|
||||
* 商户联系电话
|
||||
*/
|
||||
private String phone;
|
||||
|
||||
/**
|
||||
* 商户地址
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 商户特殊编号
|
||||
*/
|
||||
@Column("special_num")
|
||||
private String specialNum;
|
||||
|
||||
/**
|
||||
* 门店名称
|
||||
*/
|
||||
@Column("shop_name")
|
||||
private String shopName;
|
||||
|
||||
/**
|
||||
* 终端sn号
|
||||
*/
|
||||
@Column("terminal_sn")
|
||||
private String terminalSn;
|
||||
|
||||
/**
|
||||
* 终端类型
|
||||
*/
|
||||
@Column("terminal_type")
|
||||
private Integer terminalType;
|
||||
|
||||
/**
|
||||
* 终端型号
|
||||
*/
|
||||
@Column("terminal_model")
|
||||
private String terminalModel;
|
||||
|
||||
/**
|
||||
* 终端编号
|
||||
*/
|
||||
@Column("terminal_no")
|
||||
private String terminalNo;
|
||||
|
||||
/**
|
||||
* 终端来源
|
||||
*/
|
||||
@Column("terminal_source")
|
||||
private Integer terminalSource;
|
||||
|
||||
/**
|
||||
* 终端版地址
|
||||
*/
|
||||
@Column("terminal_address")
|
||||
private String terminalAddress;
|
||||
|
||||
/**
|
||||
* 终端版本号
|
||||
*/
|
||||
@Column("terminal_version")
|
||||
private String terminalVersion;
|
||||
|
||||
/**
|
||||
* 建档日期
|
||||
*/
|
||||
@Column("register_time")
|
||||
private LocalDate registerTime;
|
||||
|
||||
/**
|
||||
* 商户类型
|
||||
*/
|
||||
private Integer type;
|
||||
|
||||
/**
|
||||
* 现有其他收单产品
|
||||
*/
|
||||
private String products;
|
||||
|
||||
/**
|
||||
* 商户提示工具
|
||||
*/
|
||||
@Column("tip_tool")
|
||||
private String tipTool;
|
||||
|
||||
/**
|
||||
* 操作员编号
|
||||
*/
|
||||
@Column("admin_id")
|
||||
private String adminId;
|
||||
|
||||
/**
|
||||
* 巡检频次
|
||||
*/
|
||||
@Column("ins_fre")
|
||||
private Integer insFre;
|
||||
|
||||
/**
|
||||
* 客户经理
|
||||
*/
|
||||
@Column("account_manager")
|
||||
private String accountManager;
|
||||
|
||||
/**
|
||||
* 经理电话
|
||||
*/
|
||||
@Column("account_phone")
|
||||
private String accountPhone;
|
||||
|
||||
/**
|
||||
* 注册地址
|
||||
*/
|
||||
@Column("register_address")
|
||||
private String registerAddress;
|
||||
|
||||
/**
|
||||
* 法人/负责人
|
||||
*/
|
||||
@Column("legal_name")
|
||||
private String legalName;
|
||||
|
||||
/**
|
||||
* 地理位置信息
|
||||
*/
|
||||
@Column("geographic_location")
|
||||
private String geographicLocation;
|
||||
|
||||
/**
|
||||
* 地理位置信息地址
|
||||
*/
|
||||
@Column("location_address")
|
||||
private String locationAddress;
|
||||
|
||||
/**
|
||||
* 本次巡检位置经纬度
|
||||
*/
|
||||
@Column("work_location")
|
||||
private String workLocation;
|
||||
|
||||
/**
|
||||
* 本次巡检位置信息(根据经纬度)
|
||||
*/
|
||||
@Column("work_adderss")
|
||||
private String workAdderss;
|
||||
|
||||
/**
|
||||
* 偏差(直线距离 米)
|
||||
*/
|
||||
private Long deviation;
|
||||
|
||||
/**
|
||||
* 预制码编码
|
||||
*/
|
||||
@Column("precode_encoding")
|
||||
private String precodeEncoding;
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
package com.chushang.oss.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.chushang.common.dict.annotation.DictFormat;
|
||||
import com.chushang.common.mybatis.annotation.Condition;
|
||||
import com.chushang.common.mybatis.base.BaseEntity;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
|
@ -34,6 +36,8 @@ public class FileSourceInfo extends BaseEntity{
|
|||
* 查看字典 sys_file_type
|
||||
*/
|
||||
@TableField("file_type")
|
||||
@Condition(name = "file_type")
|
||||
@DictFormat(dictType = "sys_file_type")
|
||||
private String fileType;
|
||||
/**
|
||||
* 文件大小
|
||||
|
|
|
|||
|
|
@ -4,13 +4,19 @@ import lombok.Builder;
|
|||
import lombok.Data;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @auther: zhao
|
||||
* @date: 2024/6/29 18:09
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
public class UploadFileDTO {
|
||||
public class UploadFileDTO implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private MultipartFile[] files;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import com.chushang.oss.entity.dto.UploadStreamDTO;
|
|||
import com.chushang.oss.entity.vo.FileSourceVo;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
|
@ -20,7 +21,7 @@ import java.util.Set;
|
|||
public interface RemoteOssService {
|
||||
|
||||
@PostMapping(value = "/upload")
|
||||
Result<List<FileSourceVo>> uploadFile(@RequestBody UploadFileDTO uploadFile,
|
||||
Result<List<FileSourceVo>> uploadFile(@RequestPart(name = "files") MultipartFile[] files,
|
||||
@RequestParam(value = "ocrType", required = false) String ocrType,
|
||||
@RequestParam(value = "sealFlag", required = false, defaultValue= "false") Boolean sealFlag,
|
||||
@RequestParam(value = "formats", required = false) String formats,
|
||||
|
|
|
|||
|
|
@ -33,13 +33,12 @@ public class RemoteFileController implements RemoteOssService {
|
|||
@SysLog(value = "feign文件上传", businessType = BusinessType.INSERT)
|
||||
@PostMapping(value = "/upload")
|
||||
@InnerAuth
|
||||
public Result<List<FileSourceVo>> uploadFile(@RequestBody UploadFileDTO uploadFile,
|
||||
public Result<List<FileSourceVo>> uploadFile(@RequestPart(name = "files") MultipartFile[] files,
|
||||
@RequestParam(value = "ocrType", required = false) String ocrType,
|
||||
@RequestParam(value = "sealFlag", required = false, defaultValue= "false") Boolean sealFlag,
|
||||
@RequestParam(value = "formats", required = false) String formats,
|
||||
@RequestHeader(SecurityConstants.FROM_SOURCE)String source,
|
||||
@RequestParam(value = "fileType", required = false) String fileType) {
|
||||
MultipartFile[] files = uploadFile.getFiles();
|
||||
return Result.ok(fileSourceService.addFile(files, ocrType, sealFlag, formats, fileType));
|
||||
}
|
||||
|
||||
|
|
@ -106,7 +105,8 @@ public class RemoteFileController implements RemoteOssService {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Result<List<FileSourceVo>> uploadStream(UploadStreamDTO uploadStream, String fileName, Boolean sealFlag, String formats, String fileType, String source)
|
||||
@PostMapping(value = "/upload/stream")
|
||||
public Result<List<FileSourceVo>> uploadStream(@RequestBody UploadStreamDTO uploadStream, String fileName, Boolean sealFlag, String formats, String fileType, String source)
|
||||
{
|
||||
InputStream is = uploadStream.getIs();
|
||||
return Result.ok(fileSourceService.uploadFile(is, fileName, sealFlag, formats, fileType));
|
||||
|
|
|
|||
|
|
@ -58,4 +58,8 @@ public interface RemoteUserService {
|
|||
@GetMapping("/nickname")
|
||||
Result<Map<String, Long>> getIdByNicknames(@RequestParam(value = "nickNames") Set<String> nickNames, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
|
||||
|
||||
@GetMapping("/querynamebyid")
|
||||
Map<Long, SysUser> getUserNameByIds(@RequestParam(value = "userIds") Set<Long> userIds,
|
||||
@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ public class DictController {
|
|||
public AjaxResult add(@Validated @RequestBody SysDictData dict)
|
||||
{
|
||||
dict.setCreateBy(SecurityUtils.getUsername());
|
||||
dictDataService.saveOrUpdate(dict);
|
||||
dictDataService.save(dict);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
|
@ -90,7 +90,7 @@ public class DictController {
|
|||
public AjaxResult edit(@Validated @RequestBody SysDictData dict)
|
||||
{
|
||||
dict.setUpdateBy(SecurityUtils.getUsername());
|
||||
dictDataService.saveOrUpdate(dict);
|
||||
dictDataService.updateById(dict);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,20 +1,24 @@
|
|||
package com.chushang.system.remote;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.chushang.common.core.util.StringUtils;
|
||||
import com.chushang.common.core.web.AjaxResult;
|
||||
import com.chushang.common.core.web.Result;
|
||||
import com.chushang.common.mybatis.utils.PageResult;
|
||||
import com.chushang.security.entity.po.DataScopeEntity;
|
||||
import com.chushang.security.annotation.InnerAuth;
|
||||
import com.chushang.security.entity.po.SysDept;
|
||||
import com.chushang.security.entity.vo.LoginUser;
|
||||
import com.chushang.security.entity.po.SysUser;
|
||||
import com.chushang.system.entity.dto.ListUserDTO;
|
||||
import com.chushang.system.feign.RemoteUserService;
|
||||
import com.chushang.system.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RestController
|
||||
@RequestMapping(value = "/user/remote")
|
||||
|
|
@ -81,4 +85,23 @@ public class RemoteUserController implements RemoteUserService {
|
|||
return Result.ok(sysUserService.getIdByNicknames(nickNames));
|
||||
}
|
||||
|
||||
@Override
|
||||
@GetMapping(value = "/querynamebyid")
|
||||
@InnerAuth
|
||||
public Map<Long, SysUser> getUserNameByIds(Set<Long> userIds, String source) {
|
||||
if (CollectionUtil.isEmpty(userIds)) return Map.of();
|
||||
List<SysUser> sysUsers = sysUserService.listByIds(userIds);
|
||||
if (CollectionUtil.isNotEmpty(sysUsers)){
|
||||
return sysUsers.stream().collect(Collectors.toMap(SysUser::getUserId, Function.identity() ));
|
||||
}
|
||||
return Map.of();
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/empData")
|
||||
@InnerAuth
|
||||
public AjaxResult empData(ListUserDTO listUser) {
|
||||
return sysUserService.listUser(listUser);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ public class TaskController {
|
|||
public AjaxResult page(TaskInfo taskInfo){
|
||||
CommonParam commonParam = CommonParam.buildPageRequest();
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
if (userId != 1)
|
||||
taskInfo.setUserId(userId);
|
||||
PageResult pageResult = taskInfoService.pagePostList(taskInfo, commonParam);
|
||||
return AjaxResult.success(pageResult);
|
||||
|
|
|
|||
Loading…
Reference in New Issue