Compare commits
13 Commits
ff2c600ae7
...
17b5476c03
| Author | SHA1 | Date |
|---|---|---|
|
|
17b5476c03 | |
|
|
aeb53568f6 | |
|
|
a85135e428 | |
|
|
9869fe9f73 | |
|
|
2e6e8da7aa | |
|
|
e6bb4439e1 | |
|
|
562d80c102 | |
|
|
ecdc1c52e3 | |
|
|
4fe0ba321c | |
|
|
9b4cbe5d8a | |
|
|
22dd3330dc | |
|
|
349e9066ad | |
|
|
14ae1d0e39 |
|
|
@ -4,10 +4,12 @@ import com.njzscloud.supervisory.sys.log.utils.SpringBeanHolder;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.scheduling.annotation.EnableAsync;
|
||||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||||
|
|
||||||
@EnableScheduling
|
@EnableScheduling
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
|
@EnableAsync
|
||||||
public class Main {
|
public class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
SpringApplication.run(Main.class, args);
|
SpringApplication.run(Main.class, args);
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.njzscloud.supervisory.biz.constant;
|
||||||
|
|
||||||
|
import com.njzscloud.common.core.ienum.DictStr;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发票类型
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public enum InvoiceType implements DictStr {
|
||||||
|
GENERAL("GENERAL", "普票"),
|
||||||
|
EXCLUSIVE("EXCLUSIVE", "专票");
|
||||||
|
private final String val;
|
||||||
|
private final String txt;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.njzscloud.supervisory.biz.controller;
|
||||||
|
|
||||||
|
import com.njzscloud.common.core.utils.R;
|
||||||
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.supervisory.biz.pojo.entity.BizInvoiceEntity;
|
||||||
|
import com.njzscloud.supervisory.biz.pojo.param.SearchBizInvoiceParam;
|
||||||
|
import com.njzscloud.supervisory.biz.service.BizInvoiceService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发票抬头管理
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/biz_invoice")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class BizInvoiceController {
|
||||||
|
|
||||||
|
private final BizInvoiceService bizInvoiceService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/add")
|
||||||
|
public R<?> add(@RequestBody BizInvoiceEntity entity) {
|
||||||
|
bizInvoiceService.add(entity);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/modify")
|
||||||
|
public R<?> modify(@RequestBody BizInvoiceEntity entity) {
|
||||||
|
bizInvoiceService.modify(entity);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@GetMapping("/remove")
|
||||||
|
public R<?> remove(@RequestParam Long id) {
|
||||||
|
bizInvoiceService.remove(id);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
public R<BizInvoiceEntity> detail(@RequestParam Long id) {
|
||||||
|
return R.success(bizInvoiceService.detail(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*/
|
||||||
|
@GetMapping("/paging")
|
||||||
|
public R<PageResult<BizInvoiceEntity>> paging(PageParam pageParam, SearchBizInvoiceParam searchParam) {
|
||||||
|
return R.success(bizInvoiceService.paging(pageParam, searchParam));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,68 @@
|
||||||
|
package com.njzscloud.supervisory.biz.controller;
|
||||||
|
|
||||||
|
import com.njzscloud.common.core.utils.R;
|
||||||
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.supervisory.biz.pojo.entity.BizPatrolReportEntity;
|
||||||
|
import com.njzscloud.supervisory.biz.pojo.param.SearchBizPatrolReportParam;
|
||||||
|
import com.njzscloud.supervisory.biz.service.BizPatrolReportService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡查上报
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/biz_patrol_report")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class BizPatrolReportController {
|
||||||
|
|
||||||
|
private final BizPatrolReportService bizPatrolReportService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
@PostMapping("/add")
|
||||||
|
public R<?> add(@RequestBody BizPatrolReportEntity entity) {
|
||||||
|
bizPatrolReportService.add(entity);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*/
|
||||||
|
@PostMapping("/modify")
|
||||||
|
public R<?> modify(@RequestBody BizPatrolReportEntity entity) {
|
||||||
|
bizPatrolReportService.modify(entity);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*/
|
||||||
|
@GetMapping("/remove")
|
||||||
|
public R<?> remove(@RequestParam Long id) {
|
||||||
|
bizPatrolReportService.remove(id);
|
||||||
|
return R.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
@GetMapping("/detail")
|
||||||
|
public R<BizPatrolReportEntity> detail(@RequestParam Long id) {
|
||||||
|
return R.success(bizPatrolReportService.detail(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*/
|
||||||
|
@GetMapping("/paging")
|
||||||
|
public R<PageResult<BizPatrolReportEntity>> paging(PageParam pageParam, SearchBizPatrolReportParam searchParam) {
|
||||||
|
return R.success(bizPatrolReportService.paging(pageParam, searchParam));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,34 @@
|
||||||
|
package com.njzscloud.supervisory.biz.controller;
|
||||||
|
|
||||||
|
import com.njzscloud.common.core.utils.R;
|
||||||
|
import com.njzscloud.supervisory.biz.pojo.param.QRCodeParam;
|
||||||
|
import com.njzscloud.supervisory.biz.service.QRCodeService;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取二维码
|
||||||
|
*
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/qr")
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class QRCodeController {
|
||||||
|
|
||||||
|
private final QRCodeService qrCodeService;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取二维码
|
||||||
|
*/
|
||||||
|
@GetMapping("/getCode")
|
||||||
|
public R<?> getCode(QRCodeParam codeParam) {
|
||||||
|
return R.success(qrCodeService.getCode(codeParam));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.njzscloud.supervisory.biz.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njzscloud.supervisory.biz.pojo.entity.BizInvoiceEntity;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发票抬头管理
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BizInvoiceMapper extends BaseMapper<BizInvoiceEntity> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.njzscloud.supervisory.biz.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.njzscloud.supervisory.biz.pojo.entity.BizPatrolReportEntity;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡查上报
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface BizPatrolReportMapper extends BaseMapper<BizPatrolReportEntity> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,107 @@
|
||||||
|
package com.njzscloud.supervisory.biz.pojo.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.njzscloud.supervisory.biz.constant.InvoiceType;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发票抬头管理
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName(value = "biz_invoice", autoResultMap = true)
|
||||||
|
public class BizInvoiceEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系人
|
||||||
|
*/
|
||||||
|
private String contact;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司名称
|
||||||
|
*/
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司ID
|
||||||
|
*/
|
||||||
|
private Long companyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发票类型:general 普票 exclusive 专票
|
||||||
|
*/
|
||||||
|
private InvoiceType type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统一社会信用代码
|
||||||
|
*/
|
||||||
|
private String uscc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开户银行
|
||||||
|
*/
|
||||||
|
private String bank;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开户账号
|
||||||
|
*/
|
||||||
|
private String accountNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人 Id; sys_user.id
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人 Id; sys_user.id
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private Long modifierId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private LocalDateTime modifyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除; 0-->未删除、1-->已删除
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,90 @@
|
||||||
|
package com.njzscloud.supervisory.biz.pojo.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.njzscloud.common.mp.support.handler.j.JsonTypeHandler;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡查上报
|
||||||
|
*
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName(value = "biz_patrol_report", autoResultMap = true)
|
||||||
|
public class BizPatrolReportEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Id
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系人
|
||||||
|
*/
|
||||||
|
private String contact;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详细地址
|
||||||
|
*/
|
||||||
|
private String address;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 上报时间
|
||||||
|
*/
|
||||||
|
private LocalDateTime reportTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡查照片
|
||||||
|
*/
|
||||||
|
@TableField(typeHandler = JsonTypeHandler.class)
|
||||||
|
private List<String> picture;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建人 Id; sys_user.id
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private Long creatorId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改人 Id; sys_user.id
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private Long modifierId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT)
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改时间
|
||||||
|
*/
|
||||||
|
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||||
|
private LocalDateTime modifyTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否删除; 0-->未删除、1-->已删除
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Boolean deleted;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.njzscloud.supervisory.biz.pojo.param;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class QRCodeParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 内容
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 二维码宽度
|
||||||
|
*/
|
||||||
|
private Integer width;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 二维码高度
|
||||||
|
*/
|
||||||
|
private Integer height;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 二维码图片类型,jpg 或 png
|
||||||
|
*/
|
||||||
|
private String imgType;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.njzscloud.supervisory.biz.pojo.param;
|
||||||
|
|
||||||
|
import com.njzscloud.supervisory.biz.constant.InvoiceType;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发票抬头管理查询参数
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SearchBizInvoiceParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系人
|
||||||
|
*/
|
||||||
|
private String contact;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 公司名称
|
||||||
|
*/
|
||||||
|
private String companyName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发票类型:general 普票 exclusive 专票
|
||||||
|
*/
|
||||||
|
private InvoiceType type;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.njzscloud.supervisory.biz.pojo.param;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.ToString;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡查上报查询参数
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@ToString
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class SearchBizPatrolReportParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系人
|
||||||
|
*/
|
||||||
|
private String contact;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 联系电话
|
||||||
|
*/
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,99 @@
|
||||||
|
package com.njzscloud.supervisory.biz.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njzscloud.common.core.ex.Exceptions;
|
||||||
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.supervisory.biz.constant.InvoiceType;
|
||||||
|
import com.njzscloud.supervisory.biz.mapper.BizInvoiceMapper;
|
||||||
|
import com.njzscloud.supervisory.biz.pojo.entity.BizInvoiceEntity;
|
||||||
|
import com.njzscloud.supervisory.biz.pojo.param.SearchBizInvoiceParam;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发票抬头管理
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class BizInvoiceService extends ServiceImpl<BizInvoiceMapper, BizInvoiceEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*
|
||||||
|
* @param bizInvoiceEntity 数据
|
||||||
|
*/
|
||||||
|
public void add(BizInvoiceEntity bizInvoiceEntity) {
|
||||||
|
this.save(bizInvoiceEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*
|
||||||
|
* @param bizInvoiceEntity 数据
|
||||||
|
*/
|
||||||
|
public void modify(BizInvoiceEntity bizInvoiceEntity) {
|
||||||
|
Long id = bizInvoiceEntity.getId();
|
||||||
|
BizInvoiceEntity oldData = getById(id);
|
||||||
|
if (oldData == null) {
|
||||||
|
throw Exceptions.exception("未找到要修改的数据");
|
||||||
|
}
|
||||||
|
this.updateById(bizInvoiceEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*
|
||||||
|
* @param id Id
|
||||||
|
*/
|
||||||
|
public void remove(Long id) {
|
||||||
|
BizInvoiceEntity oldData = getById(id);
|
||||||
|
if (oldData == null) {
|
||||||
|
throw Exceptions.exception("未找到要删除的数据");
|
||||||
|
}
|
||||||
|
this.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*
|
||||||
|
* @param id Id
|
||||||
|
* @return BizInvoiceEntity 结果
|
||||||
|
*/
|
||||||
|
public BizInvoiceEntity detail(Long id) {
|
||||||
|
BizInvoiceEntity bizInvoiceEntity = this.getById(id);
|
||||||
|
if (bizInvoiceEntity == null) {
|
||||||
|
throw Exceptions.exception("数据不存在");
|
||||||
|
}
|
||||||
|
return bizInvoiceEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param pageParam 分页参数
|
||||||
|
* @param searchParam 查询参数
|
||||||
|
* @return PageResult<BizInvoiceEntity> 分页结果
|
||||||
|
*/
|
||||||
|
public PageResult<BizInvoiceEntity> paging(PageParam pageParam, SearchBizInvoiceParam searchParam) {
|
||||||
|
String contact = searchParam.getContact();
|
||||||
|
String companyName = searchParam.getCompanyName();
|
||||||
|
String phone = searchParam.getPhone();
|
||||||
|
InvoiceType type = searchParam.getType();
|
||||||
|
|
||||||
|
Page<BizInvoiceEntity> page = this.page(pageParam.toPage(), Wrappers.<BizInvoiceEntity>lambdaQuery()
|
||||||
|
.like(StrUtil.isNotBlank(contact), BizInvoiceEntity::getContact, contact)
|
||||||
|
.like(StrUtil.isNotBlank(companyName), BizInvoiceEntity::getCompanyName, companyName)
|
||||||
|
.like(StrUtil.isNotBlank(phone), BizInvoiceEntity::getPhone, phone)
|
||||||
|
.eq(type != null, BizInvoiceEntity::getType, type)
|
||||||
|
.orderByDesc(BizInvoiceEntity::getCreateTime));
|
||||||
|
return PageResult.of(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,95 @@
|
||||||
|
package com.njzscloud.supervisory.biz.service;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njzscloud.common.core.ex.Exceptions;
|
||||||
|
import com.njzscloud.common.mp.support.PageParam;
|
||||||
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
|
import com.njzscloud.supervisory.biz.mapper.BizPatrolReportMapper;
|
||||||
|
import com.njzscloud.supervisory.biz.pojo.entity.BizPatrolReportEntity;
|
||||||
|
import com.njzscloud.supervisory.biz.pojo.param.SearchBizPatrolReportParam;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 巡查上报
|
||||||
|
*
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class BizPatrolReportService extends ServiceImpl<BizPatrolReportMapper, BizPatrolReportEntity> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*
|
||||||
|
* @param bizPatrolReportEntity 数据
|
||||||
|
*/
|
||||||
|
public void add(BizPatrolReportEntity bizPatrolReportEntity) {
|
||||||
|
this.save(bizPatrolReportEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改
|
||||||
|
*
|
||||||
|
* @param bizPatrolReportEntity 数据
|
||||||
|
*/
|
||||||
|
public void modify(BizPatrolReportEntity bizPatrolReportEntity) {
|
||||||
|
Long id = bizPatrolReportEntity.getId();
|
||||||
|
BizPatrolReportEntity oldData = getById(id);
|
||||||
|
if (oldData == null) {
|
||||||
|
throw Exceptions.exception("未找到要修改的数据");
|
||||||
|
}
|
||||||
|
this.updateById(bizPatrolReportEntity);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除
|
||||||
|
*
|
||||||
|
* @param id Id
|
||||||
|
*/
|
||||||
|
public void remove(Long id) {
|
||||||
|
BizPatrolReportEntity oldData = getById(id);
|
||||||
|
if (oldData == null) {
|
||||||
|
throw Exceptions.exception("未找到要删除的数据");
|
||||||
|
}
|
||||||
|
this.removeById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*
|
||||||
|
* @param id Id
|
||||||
|
* @return BizPatrolReportEntity 结果
|
||||||
|
*/
|
||||||
|
public BizPatrolReportEntity detail(Long id) {
|
||||||
|
BizPatrolReportEntity bizPatrolReportEntity = this.getById(id);
|
||||||
|
if (bizPatrolReportEntity == null) {
|
||||||
|
throw Exceptions.exception("数据不存在");
|
||||||
|
}
|
||||||
|
return bizPatrolReportEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页查询
|
||||||
|
*
|
||||||
|
* @param pageParam 分页参数
|
||||||
|
* @param searchParam 查询参数
|
||||||
|
* @return PageResult<BizPatrolReportEntity> 分页结果
|
||||||
|
*/
|
||||||
|
public PageResult<BizPatrolReportEntity> paging(PageParam pageParam, SearchBizPatrolReportParam searchParam) {
|
||||||
|
String contact = searchParam.getContact();
|
||||||
|
String phone = searchParam.getPhone();
|
||||||
|
|
||||||
|
Page<BizPatrolReportEntity> page = this.page(pageParam.toPage(), Wrappers.<BizPatrolReportEntity>lambdaQuery()
|
||||||
|
.like(StrUtil.isNotBlank(contact), BizPatrolReportEntity::getContact, contact)
|
||||||
|
.like(StrUtil.isNotBlank(phone), BizPatrolReportEntity::getPhone, phone)
|
||||||
|
.orderByDesc(BizPatrolReportEntity::getCreateTime));
|
||||||
|
return PageResult.of(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.njzscloud.supervisory.biz.service;
|
||||||
|
|
||||||
|
|
||||||
|
import cn.hutool.core.img.ImgUtil;
|
||||||
|
import cn.hutool.extra.qrcode.QrCodeUtil;
|
||||||
|
import cn.hutool.extra.qrcode.QrConfig;
|
||||||
|
import com.njzscloud.supervisory.biz.pojo.param.QRCodeParam;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取二维码
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public class QRCodeService {
|
||||||
|
|
||||||
|
public String getCode(QRCodeParam codeParam) {
|
||||||
|
Integer width = codeParam.getWidth();
|
||||||
|
Integer height = codeParam.getHeight();
|
||||||
|
if (width == null) {
|
||||||
|
width = 300;
|
||||||
|
}
|
||||||
|
if (height == null) {
|
||||||
|
height = 300;
|
||||||
|
}
|
||||||
|
String imgType = codeParam.getImgType();
|
||||||
|
if (imgType == null) {
|
||||||
|
imgType = ImgUtil.IMAGE_TYPE_JPG;
|
||||||
|
}
|
||||||
|
|
||||||
|
return QrCodeUtil.generateAsBase64(codeParam.getContent(), new QrConfig(width, height), imgType);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -15,6 +15,7 @@ public enum ExpenseItemCategory implements DictStr {
|
||||||
ChanPin("ChanPin", "产品"),
|
ChanPin("ChanPin", "产品"),
|
||||||
QingYunFuWuFei("QingYunFuWuFei", "清运服务费"),
|
QingYunFuWuFei("QingYunFuWuFei", "清运服务费"),
|
||||||
YunFei("YunFei", "运费"),
|
YunFei("YunFei", "运费"),
|
||||||
|
ZhongZhuanYunYingFei("ZhongZhuanYunYingFei", "中转运营费"),
|
||||||
;
|
;
|
||||||
private final String val;
|
private final String val;
|
||||||
private final String txt;
|
private final String txt;
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ public class ExpenseItemsConfigService extends ServiceImpl<ExpenseItemsConfigMap
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
public void add(ExpenseItemsConfigEntity expenseItemsConfigEntity) {
|
public void add(ExpenseItemsConfigEntity expenseItemsConfigEntity) {
|
||||||
expenseItemsConfigEntity.setExpenseItemCategory(ExpenseItemCategory.QingYunFuWuFei.getVal());
|
// expenseItemsConfigEntity.setExpenseItemCategory(ExpenseItemCategory.QingYunFuWuFei.getVal());
|
||||||
this.save(expenseItemsConfigEntity);
|
this.save(expenseItemsConfigEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -55,7 +55,8 @@ public class ExpenseItemsConfigService extends ServiceImpl<ExpenseItemsConfigMap
|
||||||
* 分页查询
|
* 分页查询
|
||||||
*/
|
*/
|
||||||
public PageResult<ExpenseItemsConfigEntity> paging(PageParam pageParam, ExpenseItemsConfigEntity expenseItemsConfigEntity) {
|
public PageResult<ExpenseItemsConfigEntity> paging(PageParam pageParam, ExpenseItemsConfigEntity expenseItemsConfigEntity) {
|
||||||
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<ExpenseItemsConfigEntity>query(expenseItemsConfigEntity)));
|
expenseItemsConfigEntity.setDeleted(Boolean.FALSE);
|
||||||
|
return PageResult.of(this.page(pageParam.toPage(), Wrappers.query(expenseItemsConfigEntity)));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
package com.njzscloud.supervisory.money.contant;
|
||||||
|
|
||||||
|
import com.njzscloud.common.core.ienum.DictStr;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 资金明细类型
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public enum MoneyDetailType implements DictStr {
|
||||||
|
COMPANY("company", "企业"),
|
||||||
|
WX("wx", "微信");
|
||||||
|
|
||||||
|
private final String val;
|
||||||
|
private final String txt;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.njzscloud.supervisory.money.contant;
|
||||||
|
|
||||||
|
import com.njzscloud.common.core.ienum.DictStr;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典代码:payment_status
|
||||||
|
* 字典名称:支付状态
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
public enum PayStatus implements DictStr {
|
||||||
|
PENDING("PENDING", "待支付"),
|
||||||
|
PAID("PAID", "已支付"),
|
||||||
|
REFUNDING("REFUNDING", "待退款"),
|
||||||
|
REFUNDED("REFUNDED", "已退款"),
|
||||||
|
;
|
||||||
|
private final String val;
|
||||||
|
private final String txt;
|
||||||
|
}
|
||||||
|
|
@ -16,6 +16,7 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资金明细
|
* 资金明细
|
||||||
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资金账户表
|
* 资金账户表
|
||||||
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
|
@ -45,6 +46,11 @@ public class MoneyAccountEntity {
|
||||||
*/
|
*/
|
||||||
private BigDecimal revenue;
|
private BigDecimal revenue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件地址
|
||||||
|
*/
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改时间
|
* 修改时间
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ package com.njzscloud.supervisory.money.pojo.entity;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.*;
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
import com.njzscloud.supervisory.money.contant.MoneyChangeCategory;
|
import com.njzscloud.supervisory.money.contant.MoneyChangeCategory;
|
||||||
|
import com.njzscloud.supervisory.money.contant.MoneyDetailType;
|
||||||
|
import com.njzscloud.supervisory.money.contant.PayStatus;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
|
|
@ -12,12 +14,13 @@ import java.time.LocalDateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资金变动明细
|
* 资金变动明细
|
||||||
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@ToString
|
@ToString
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("money_change_detail")
|
@TableName(value = "money_change_detail", autoResultMap = true)
|
||||||
public class MoneyChangeDetailEntity {
|
public class MoneyChangeDetailEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -31,6 +34,16 @@ public class MoneyChangeDetailEntity {
|
||||||
*/
|
*/
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 类型
|
||||||
|
*/
|
||||||
|
private MoneyDetailType type;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private PayStatus status;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 公司id
|
* 公司id
|
||||||
*/
|
*/
|
||||||
|
|
@ -112,6 +125,9 @@ public class MoneyChangeDetailEntity {
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String sn;
|
private String sn;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private String licensePlate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开始时间(用于时间范围查询)
|
* 开始时间(用于时间范围查询)
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -52,4 +52,14 @@ public class MoneyAccountResult {
|
||||||
*/
|
*/
|
||||||
private Integer moneyType;
|
private Integer moneyType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 营收
|
||||||
|
*/
|
||||||
|
private BigDecimal revenue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 附件地址
|
||||||
|
*/
|
||||||
|
private String fileUrl;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ public class MoneyBillQuartz {
|
||||||
private final MoneyBillMapper moneyBillMapper;
|
private final MoneyBillMapper moneyBillMapper;
|
||||||
|
|
||||||
// @Scheduled(cron = "0 0/5 * * * ?")//每1分钟一次
|
// @Scheduled(cron = "0 0/5 * * * ?")//每1分钟一次
|
||||||
@Scheduled(cron = "0 0 1 27 * ?")// 每月27号凌晨1点执行
|
@Scheduled(cron = "0 0 1 1 * ?")// 每月1号凌晨1点执行
|
||||||
public void syncAssetsDiscover() {
|
public void syncAssetsDiscover() {
|
||||||
generateMoneyBill();
|
generateMoneyBill();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import com.njzscloud.common.mp.support.PageParam;
|
||||||
import com.njzscloud.common.mp.support.PageResult;
|
import com.njzscloud.common.mp.support.PageResult;
|
||||||
import com.njzscloud.common.security.util.SecurityUtil;
|
import com.njzscloud.common.security.util.SecurityUtil;
|
||||||
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
import com.njzscloud.supervisory.biz.pojo.result.SearchCompanyResult;
|
||||||
|
import com.njzscloud.supervisory.money.contant.MoneyDetailType;
|
||||||
import com.njzscloud.supervisory.money.mapper.MoneyChangeDetailMapper;
|
import com.njzscloud.supervisory.money.mapper.MoneyChangeDetailMapper;
|
||||||
import com.njzscloud.supervisory.money.pojo.entity.MoneyChangeDetailEntity;
|
import com.njzscloud.supervisory.money.pojo.entity.MoneyChangeDetailEntity;
|
||||||
import com.njzscloud.supervisory.money.pojo.result.MoneyChangeDetailExportResult;
|
import com.njzscloud.supervisory.money.pojo.result.MoneyChangeDetailExportResult;
|
||||||
|
|
@ -27,6 +28,7 @@ import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 资金变动明细
|
* 资金变动明细
|
||||||
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
|
@ -59,6 +61,16 @@ public class MoneyChangeDetailService extends ServiceImpl<MoneyChangeDetailMappe
|
||||||
this.removeBatchByIds(ids);
|
this.removeBatchByIds(ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据订单ID和类型查询资金明细
|
||||||
|
*/
|
||||||
|
public MoneyChangeDetailEntity getByOrderIdAndType(Long orderId, MoneyDetailType type) {
|
||||||
|
return this.lambdaQuery()
|
||||||
|
.eq(MoneyChangeDetailEntity::getOrderId, orderId)
|
||||||
|
.eq(MoneyChangeDetailEntity::getType, type)
|
||||||
|
.one();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 详情
|
* 详情
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@ import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lzq
|
||||||
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@ToString
|
@ToString
|
||||||
|
|
@ -72,6 +75,9 @@ public class OrderPagingSearchParam {
|
||||||
private LocalDateTime endTime;
|
private LocalDateTime endTime;
|
||||||
private OrderViewType type;
|
private OrderViewType type;
|
||||||
|
|
||||||
|
private LocalDateTime startPayTime;
|
||||||
|
private LocalDateTime endPayTime;
|
||||||
|
|
||||||
private Boolean isCertificatePaging = Boolean.FALSE;
|
private Boolean isCertificatePaging = Boolean.FALSE;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,11 @@ public class OrderExportDetailResult {
|
||||||
*/
|
*/
|
||||||
private Long orderId;
|
private Long orderId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 付费项类型
|
||||||
|
*/
|
||||||
|
private String expenseItemCategory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 产品名称
|
* 产品名称
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -95,4 +95,9 @@ public class OrderExportResult {
|
||||||
*/
|
*/
|
||||||
private String checkerMemo;
|
private String checkerMemo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品名称
|
||||||
|
*/
|
||||||
|
private String goodsName;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,8 @@ public class PaymentContextResult {
|
||||||
|
|
||||||
private BigDecimal settleMoney;
|
private BigDecimal settleMoney;
|
||||||
|
|
||||||
|
private Long driverUserId;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -125,6 +125,8 @@ public class TrainBillResult {
|
||||||
* 审核备注
|
* 审核备注
|
||||||
*/
|
*/
|
||||||
private String auditMemo;
|
private String auditMemo;
|
||||||
|
private String shiAuditMemo;
|
||||||
|
private String quAuditMemo;
|
||||||
private String checkerName;
|
private String checkerName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ import cn.hutool.core.thread.ThreadUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.extra.qrcode.QrCodeUtil;
|
import cn.hutool.extra.qrcode.QrCodeUtil;
|
||||||
import cn.hutool.extra.qrcode.QrConfig;
|
import cn.hutool.extra.qrcode.QrConfig;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
|
|
@ -56,6 +55,8 @@ import com.njzscloud.supervisory.order.utils.FileUtil;
|
||||||
import com.njzscloud.supervisory.station.pojo.entity.StationManageEntity;
|
import com.njzscloud.supervisory.station.pojo.entity.StationManageEntity;
|
||||||
import com.njzscloud.supervisory.station.service.StationManageService;
|
import com.njzscloud.supervisory.station.service.StationManageService;
|
||||||
import com.njzscloud.supervisory.sys.auth.pojo.result.MyResult;
|
import com.njzscloud.supervisory.sys.auth.pojo.result.MyResult;
|
||||||
|
import com.njzscloud.supervisory.sys.dict.pojo.DictItemEntity;
|
||||||
|
import com.njzscloud.supervisory.sys.dict.service.DictItemService;
|
||||||
import com.njzscloud.supervisory.sys.role.pojo.entity.RoleEntity;
|
import com.njzscloud.supervisory.sys.role.pojo.entity.RoleEntity;
|
||||||
import com.njzscloud.supervisory.sys.role.service.RoleService;
|
import com.njzscloud.supervisory.sys.role.service.RoleService;
|
||||||
import com.njzscloud.supervisory.sys.stationletter.constant.WarnCategory;
|
import com.njzscloud.supervisory.sys.stationletter.constant.WarnCategory;
|
||||||
|
|
@ -117,6 +118,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
private final BizTruckService bizTruckService;
|
private final BizTruckService bizTruckService;
|
||||||
private final DiscountManageService discountManageService;
|
private final DiscountManageService discountManageService;
|
||||||
private final HsoaService hsoaService;
|
private final HsoaService hsoaService;
|
||||||
|
private final DictItemService dictItemService;
|
||||||
private final AtomicBoolean test_thread_running = new AtomicBoolean(false);
|
private final AtomicBoolean test_thread_running = new AtomicBoolean(false);
|
||||||
Thread test_thread = null;
|
Thread test_thread = null;
|
||||||
@Value("${app.check-gps:false}")
|
@Value("${app.check-gps:false}")
|
||||||
|
|
@ -181,7 +183,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
param.setTempType(TempType.TRANS_COMPANY.getVal());
|
param.setTempType(TempType.TRANS_COMPANY.getVal());
|
||||||
param.setSn(orderInfoEntity.getSn());
|
param.setSn(orderInfoEntity.getSn());
|
||||||
param.setGoodsName(entity.getGoodsName());
|
param.setGoodsName(entity.getGoodsName());
|
||||||
param.setStartAddress(cargoPlace.getAreaName() + cargoPlace.getTownName() + cargoPlace.getAddress());
|
param.setStartAddress(cargoPlace.getAddress());
|
||||||
wechatTemplateMessageService.sendTemplateMessage(param);
|
wechatTemplateMessageService.sendTemplateMessage(param);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("通知失败", e);
|
log.error("通知失败", e);
|
||||||
|
|
@ -238,6 +240,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
OrderCategory orderCategory = orderPagingSearchParam.getOrderCategory();
|
OrderCategory orderCategory = orderPagingSearchParam.getOrderCategory();
|
||||||
String transCompanyName = orderPagingSearchParam.getTransCompanyName();
|
String transCompanyName = orderPagingSearchParam.getTransCompanyName();
|
||||||
String driverName = orderPagingSearchParam.getDriverName();
|
String driverName = orderPagingSearchParam.getDriverName();
|
||||||
|
LocalDateTime startPayTime = orderPagingSearchParam.getStartPayTime();
|
||||||
|
LocalDateTime endPayTime = orderPagingSearchParam.getEndPayTime();
|
||||||
QueryWrapper<OrderPagingResult> ew = Wrappers.<OrderPagingResult>query()
|
QueryWrapper<OrderPagingResult> ew = Wrappers.<OrderPagingResult>query()
|
||||||
.eq(stationId != null && stationId > 0, "a.station_id", stationId)
|
.eq(stationId != null && stationId > 0, "a.station_id", stationId)
|
||||||
.like(StrUtil.isNotBlank(sn), "a.sn", sn)
|
.like(StrUtil.isNotBlank(sn), "a.sn", sn)
|
||||||
|
|
@ -252,7 +256,9 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
.eq(null != transCompanyId, "a.trans_company_id", transCompanyId)
|
.eq(null != transCompanyId, "a.trans_company_id", transCompanyId)
|
||||||
.eq("a.deleted", 0)
|
.eq("a.deleted", 0)
|
||||||
.eq(StrUtil.isNotBlank(area), "b.area", area)
|
.eq(StrUtil.isNotBlank(area), "b.area", area)
|
||||||
.eq(null != goodsId, "c.origin_goods_id", goodsId);
|
.eq(null != goodsId, "c.origin_goods_id", goodsId)
|
||||||
|
.ge(startPayTime != null, "a.pay_time", startPayTime)
|
||||||
|
.le(endPayTime != null, "a.pay_time", endPayTime);
|
||||||
OrderViewType type = orderPagingSearchParam.getType();
|
OrderViewType type = orderPagingSearchParam.getType();
|
||||||
Assert.notNull(type, () -> Exceptions.clierr("订单类型不能为空"));
|
Assert.notNull(type, () -> Exceptions.clierr("订单类型不能为空"));
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
|
@ -578,6 +584,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
return PageResult.of(baseMapper.paging(page, ew));
|
return PageResult.of(baseMapper.paging(page, ew));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void audit(AuditOrderParam auditOrderParam) {
|
public void audit(AuditOrderParam auditOrderParam) {
|
||||||
OrderPagingResult detail = detail(auditOrderParam.getId());
|
OrderPagingResult detail = detail(auditOrderParam.getId());
|
||||||
Assert.notNull(detail, () -> Exceptions.clierr("订单不存在"));
|
Assert.notNull(detail, () -> Exceptions.clierr("订单不存在"));
|
||||||
|
|
@ -664,6 +671,10 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
.setCertificateSn(certificateSn)
|
.setCertificateSn(certificateSn)
|
||||||
.setCheckStatus(checkStatus)
|
.setCheckStatus(checkStatus)
|
||||||
);
|
);
|
||||||
|
if (newAuditStatus == AuditStatus.BoHui) {
|
||||||
|
baseMapper.busyDriver(detail.getDriverId(), Boolean.FALSE);
|
||||||
|
baseMapper.busyTruck(detail.getTruckId(), Boolean.FALSE);
|
||||||
|
}
|
||||||
OrderCategory orderCategory = detail.getOrderCategory();
|
OrderCategory orderCategory = detail.getOrderCategory();
|
||||||
if (orderCategory == OrderCategory.DuanBoRu) return;
|
if (orderCategory == OrderCategory.DuanBoRu) return;
|
||||||
// auditStatus为市待审核状态通知市,通过状态通知司机
|
// auditStatus为市待审核状态通知市,通过状态通知司机
|
||||||
|
|
@ -692,7 +703,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
wechatTemplateMessageService.sendTemplateMessage(param);
|
wechatTemplateMessageService.sendTemplateMessage(param);
|
||||||
} else if (AuditStatus.BoHui.equals(auditStatus)) {
|
} else if (AuditStatus.BoHui.equals(auditStatus)) {
|
||||||
param.setTempType(TempType.AUDIT_REJECT.getVal());
|
param.setTempType(TempType.AUDIT_REJECT.getVal());
|
||||||
param.setStartAddress(detail.getAreaName() + detail.getTownName() + detail.getAddress());
|
param.setStartAddress(detail.getAddress());
|
||||||
wechatTemplateMessageService.sendTemplateMessage(param);
|
wechatTemplateMessageService.sendTemplateMessage(param);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -778,7 +789,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
param.setSn(orderInfo.getSn());
|
param.setSn(orderInfo.getSn());
|
||||||
param.setDriverName(driverEntity.getDriverName());
|
param.setDriverName(driverEntity.getDriverName());
|
||||||
OrderCargoPlaceEntity cargoPlace = orderCargoPlaceService.getById(orderInfo.getCargoPlaceId());
|
OrderCargoPlaceEntity cargoPlace = orderCargoPlaceService.getById(orderInfo.getCargoPlaceId());
|
||||||
param.setStartAddress(cargoPlace.getAreaName() + cargoPlace.getTownName() + cargoPlace.getAddress());
|
param.setStartAddress(cargoPlace.getAddress());
|
||||||
BizCompanyEntity companyEntity = bizCompanyService.getById(orderInfo.getStationId());
|
BizCompanyEntity companyEntity = bizCompanyService.getById(orderInfo.getStationId());
|
||||||
param.setEndAddress(companyEntity.getStationName());
|
param.setEndAddress(companyEntity.getStationName());
|
||||||
wechatTemplateMessageService.sendTemplateMessage(param);
|
wechatTemplateMessageService.sendTemplateMessage(param);
|
||||||
|
|
@ -813,7 +824,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
OrderGoodsEntity entity = orderGoodsService.getById(orderInfo.getGoodsId());
|
OrderGoodsEntity entity = orderGoodsService.getById(orderInfo.getGoodsId());
|
||||||
param.setGoodsName(entity.getGoodsName());
|
param.setGoodsName(entity.getGoodsName());
|
||||||
OrderCargoPlaceEntity cargoPlace = orderCargoPlaceService.getById(orderInfo.getCargoPlaceId());
|
OrderCargoPlaceEntity cargoPlace = orderCargoPlaceService.getById(orderInfo.getCargoPlaceId());
|
||||||
param.setStartAddress(cargoPlace.getAreaName() + cargoPlace.getTownName() + cargoPlace.getAddress());
|
param.setStartAddress(cargoPlace.getAddress());
|
||||||
wechatTemplateMessageService.sendTemplateMessage(param);
|
wechatTemplateMessageService.sendTemplateMessage(param);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("通知失败", e);
|
log.error("通知失败", e);
|
||||||
|
|
@ -874,14 +885,19 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
param.setGoodsName(entity.getGoodsName());
|
param.setGoodsName(entity.getGoodsName());
|
||||||
BizTruckEntity truckEntity = bizTruckService.getById(truckId);
|
BizTruckEntity truckEntity = bizTruckService.getById(truckId);
|
||||||
param.setLicensePlate(truckEntity.getLicensePlate());
|
param.setLicensePlate(truckEntity.getLicensePlate());
|
||||||
|
Set<String> openId = new HashSet<>();
|
||||||
|
UserEntity orderUserEntity = userService.getById(orderInfo.getUserId());
|
||||||
|
param.setCfCompanyName(orderUserEntity.getNickname());
|
||||||
for (SysUserRoleEntity userRoleEntity : userIds) {
|
for (SysUserRoleEntity userRoleEntity : userIds) {
|
||||||
UserEntity userEntity = userService.getById(orderInfo.getUserId());
|
UserEntity userEntity = userService.getById(userRoleEntity.getUserId());
|
||||||
if (null != userEntity) {
|
if (null != userEntity && !Strings.isNullOrEmpty(userEntity.getOpenid())) {
|
||||||
param.setUserId(userRoleEntity.getUserId());
|
if (openId.add(userEntity.getOpenid())) {
|
||||||
param.setCfCompanyName(userEntity.getNickname());
|
param.setUserId(userRoleEntity.getUserId());
|
||||||
wechatTemplateMessageService.sendTemplateMessage(param);
|
log.info("发送审核通知模板消息,参数:{}", param);
|
||||||
|
wechatTemplateMessageService.sendTemplateMessage(param);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("未查到用户信息:" + userRoleEntity.getUserId());
|
log.info("未查到用户信息:{}", userRoleEntity.getUserId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1362,7 +1378,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
*/
|
*/
|
||||||
private BigDecimal calculateItemTotalMoney(OrderExpenseItemsEntity item) {
|
private BigDecimal calculateItemTotalMoney(OrderExpenseItemsEntity item) {
|
||||||
// 判断是否为清运服务费的弹性计费
|
// 判断是否为清运服务费的弹性计费
|
||||||
if (ExpenseItemCategory.QingYunFuWuFei.getVal().equals(item.getExpenseItemCategory())
|
if ((ExpenseItemCategory.QingYunFuWuFei.getVal().equals(item.getExpenseItemCategory())
|
||||||
|
|| ExpenseItemCategory.ZhongZhuanYunYingFei.getVal().equals(item.getExpenseItemCategory()))
|
||||||
&& MoneyStrategy.Dun.getVal().equals(item.getMoneyStrategy())
|
&& MoneyStrategy.Dun.getVal().equals(item.getMoneyStrategy())
|
||||||
&& BillingType.ELASTICITY.getVal().equals(item.getBillingType())) {
|
&& BillingType.ELASTICITY.getVal().equals(item.getBillingType())) {
|
||||||
// 弹性计费逻辑
|
// 弹性计费逻辑
|
||||||
|
|
@ -1416,7 +1433,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
return discountMoney;
|
return discountMoney;
|
||||||
}
|
}
|
||||||
goodsId = entity.getOriginGoodsId();
|
goodsId = entity.getOriginGoodsId();
|
||||||
} else if (ExpenseItemCategory.QingYunFuWuFei.getVal().equals(item.getExpenseItemCategory())) {
|
} else if (ExpenseItemCategory.QingYunFuWuFei.getVal().equals(item.getExpenseItemCategory())
|
||||||
|
|| ExpenseItemCategory.ZhongZhuanYunYingFei.getVal().equals(item.getExpenseItemCategory())) {
|
||||||
itemId = item.getOriginExpenseItemId();
|
itemId = item.getOriginExpenseItemId();
|
||||||
}
|
}
|
||||||
List<DiscountManageEntity> discountList = discountManageService.list(Wrappers.lambdaQuery(DiscountManageEntity.class)
|
List<DiscountManageEntity> discountList = discountManageService.list(Wrappers.lambdaQuery(DiscountManageEntity.class)
|
||||||
|
|
@ -1766,6 +1784,10 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
List<OrderExportResult> list = baseMapper.exportList(ew);
|
List<OrderExportResult> list = baseMapper.exportList(ew);
|
||||||
List<OrderExportDetailResult> detailResults = baseMapper.exportDetailList(ew);
|
List<OrderExportDetailResult> detailResults = baseMapper.exportDetailList(ew);
|
||||||
List<Map<String, Object>> downList = new ArrayList<>();
|
List<Map<String, Object>> downList = new ArrayList<>();
|
||||||
|
List<DictItemEntity> dictItems = dictItemService.list(Wrappers.<DictItemEntity>lambdaQuery()
|
||||||
|
.eq(DictItemEntity::getDictKey, "expense_item_category")
|
||||||
|
.eq(DictItemEntity::getDeleted, Boolean.FALSE)
|
||||||
|
.orderByAsc(DictItemEntity::getSort));
|
||||||
int i = 1;
|
int i = 1;
|
||||||
for (OrderExportResult result : list) {
|
for (OrderExportResult result : list) {
|
||||||
Map<String, Object> map = new LinkedHashMap<>();
|
Map<String, Object> map = new LinkedHashMap<>();
|
||||||
|
|
@ -1784,19 +1806,29 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
|
||||||
map.put("皮重(吨)", result.getTareWeight());
|
map.put("皮重(吨)", result.getTareWeight());
|
||||||
map.put("净重(吨)", result.getSettleWeight());
|
map.put("净重(吨)", result.getSettleWeight());
|
||||||
map.put("驾驶员", result.getDriverName());
|
map.put("驾驶员", result.getDriverName());
|
||||||
if (null != detailResults && detailResults.size() > 0) {
|
map.put("产品", result.getGoodsName());
|
||||||
List<OrderExportDetailResult> details = detailResults.stream().filter(t -> t.getOrderId()
|
List<OrderExportDetailResult> details = detailResults.stream()
|
||||||
.equals(result.getId())).collect(Collectors.toList());
|
.filter(t -> t.getOrderId().equals(result.getId()))
|
||||||
List<String> detailList = new ArrayList<>();
|
.collect(Collectors.toList());
|
||||||
if (details.size() > 0) {
|
// 根据dictItems动态添加费用列
|
||||||
for (OrderExportDetailResult detailResult : details) {
|
if (null != dictItems && !dictItems.isEmpty()) {
|
||||||
detailList.add(detailResult.getExpenseItemName() + detailResult.getSettleMoney() + "元");
|
for (DictItemEntity dictItem : dictItems) {
|
||||||
|
String headerName = "ChanPin".equals(dictItem.getVal()) ? "处置费" : dictItem.getTxt();
|
||||||
|
BigDecimal amount = BigDecimal.ZERO;
|
||||||
|
|
||||||
|
if (!details.isEmpty()) {
|
||||||
|
Optional<OrderExportDetailResult> matchedDetail = details.stream()
|
||||||
|
.filter(detail -> dictItem.getVal().equals(detail.getExpenseItemCategory()))
|
||||||
|
.findFirst();
|
||||||
|
if (matchedDetail.isPresent()) {
|
||||||
|
amount = matchedDetail.get().getSettleMoney();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
map.put("明细", JSONObject.toJSONString(detailList));
|
|
||||||
} else {
|
map.put(headerName, amount);
|
||||||
map.put("明细", "");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
map.put("备注", result.getCheckerMemo());
|
map.put("备注", result.getCheckerMemo());
|
||||||
downList.add(map);
|
downList.add(map);
|
||||||
i++;
|
i++;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,8 @@
|
||||||
package com.njzscloud.supervisory.wxPay.contant;
|
package com.njzscloud.supervisory.wxPay.contant;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
public class WxApiConfig {
|
public class WxApiConfig {
|
||||||
|
|
||||||
public static final String APP_ID = "wxcf5b818c19c51c07";
|
public static final String APP_ID = "wxcf5b818c19c51c07";
|
||||||
|
|
@ -8,7 +11,8 @@ public class WxApiConfig {
|
||||||
|
|
||||||
public static final String REDIRECT_URI = "https://supervisory.njzscloud.com/test/bind/index.html";
|
public static final String REDIRECT_URI = "https://supervisory.njzscloud.com/test/bind/index.html";
|
||||||
|
|
||||||
public static final String SCOPE = "snsapi_base"; // 静默授权,仅获取OpenID
|
// 静默授权,仅获取OpenID
|
||||||
|
public static final String SCOPE = "snsapi_base";
|
||||||
// String scope = "snsapi_userinfo"; // 非静默授权,可获取用户昵称、头像等更多信息[citation:1]
|
// String scope = "snsapi_userinfo"; // 非静默授权,可获取用户昵称、头像等更多信息[citation:1]
|
||||||
|
|
||||||
public static final String ENC = "UTF-8";
|
public static final String ENC = "UTF-8";
|
||||||
|
|
@ -21,5 +25,5 @@ public class WxApiConfig {
|
||||||
|
|
||||||
public static final String TICKET_URL = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=";
|
public static final String TICKET_URL = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=";
|
||||||
|
|
||||||
|
public static final String XCX_APP_ID = "wx989ea47a5ddf9bfb";
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,12 @@ import com.njzscloud.common.core.ex.ExceptionMsg;
|
||||||
import com.njzscloud.common.core.ex.Exceptions;
|
import com.njzscloud.common.core.ex.Exceptions;
|
||||||
import com.njzscloud.common.core.utils.R;
|
import com.njzscloud.common.core.utils.R;
|
||||||
import com.njzscloud.common.security.ex.UserLoginException;
|
import com.njzscloud.common.security.ex.UserLoginException;
|
||||||
|
import com.njzscloud.common.security.util.SecurityUtil;
|
||||||
import com.njzscloud.common.wechat.WechatUtil;
|
import com.njzscloud.common.wechat.WechatUtil;
|
||||||
import com.njzscloud.common.wechat.param.Code2SessionParam;
|
import com.njzscloud.common.wechat.param.Code2SessionParam;
|
||||||
import com.njzscloud.common.wechat.result.Code2SessionResult;
|
import com.njzscloud.common.wechat.result.Code2SessionResult;
|
||||||
import com.njzscloud.supervisory.device.service.DeviceInfoService;
|
import com.njzscloud.supervisory.device.service.DeviceInfoService;
|
||||||
|
import com.njzscloud.supervisory.money.contant.PayStatus;
|
||||||
import com.njzscloud.supervisory.order.contant.MoneyWay;
|
import com.njzscloud.supervisory.order.contant.MoneyWay;
|
||||||
import com.njzscloud.supervisory.order.contant.OrderStatus;
|
import com.njzscloud.supervisory.order.contant.OrderStatus;
|
||||||
import com.njzscloud.supervisory.order.contant.PaymentStatus;
|
import com.njzscloud.supervisory.order.contant.PaymentStatus;
|
||||||
|
|
@ -28,6 +30,10 @@ import com.njzscloud.supervisory.order.pojo.result.PaymentContextResult;
|
||||||
import com.njzscloud.supervisory.order.service.OrderExpenseItemsService;
|
import com.njzscloud.supervisory.order.service.OrderExpenseItemsService;
|
||||||
import com.njzscloud.supervisory.order.service.OrderGoodsService;
|
import com.njzscloud.supervisory.order.service.OrderGoodsService;
|
||||||
import com.njzscloud.supervisory.order.service.OrderInfoService;
|
import com.njzscloud.supervisory.order.service.OrderInfoService;
|
||||||
|
import com.njzscloud.supervisory.money.service.MoneyChangeDetailService;
|
||||||
|
import com.njzscloud.supervisory.money.contant.MoneyChangeCategory;
|
||||||
|
import com.njzscloud.supervisory.money.contant.MoneyDetailType;
|
||||||
|
import com.njzscloud.supervisory.money.pojo.entity.MoneyChangeDetailEntity;
|
||||||
import com.njzscloud.supervisory.wxPay.config.WxPayProperties;
|
import com.njzscloud.supervisory.wxPay.config.WxPayProperties;
|
||||||
import com.njzscloud.supervisory.wxPay.dto.RefundRequestDto;
|
import com.njzscloud.supervisory.wxPay.dto.RefundRequestDto;
|
||||||
import com.njzscloud.supervisory.wxPay.param.PaymentParam;
|
import com.njzscloud.supervisory.wxPay.param.PaymentParam;
|
||||||
|
|
@ -48,6 +54,7 @@ import java.time.LocalDateTime;
|
||||||
/**
|
/**
|
||||||
* 支付相关接口
|
* 支付相关接口
|
||||||
* 使用微信支付官方SDK的生产级实现
|
* 使用微信支付官方SDK的生产级实现
|
||||||
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@RestController
|
@RestController
|
||||||
|
|
@ -62,6 +69,7 @@ public class PaymentController {
|
||||||
private final WxPayProperties properties;
|
private final WxPayProperties properties;
|
||||||
private final OrderGoodsService orderGoodsService;
|
private final OrderGoodsService orderGoodsService;
|
||||||
private final PaymentService paymentService;
|
private final PaymentService paymentService;
|
||||||
|
private final MoneyChangeDetailService moneyChangeDetailService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 发起支付(使用生产级微信支付SDK)
|
* 发起支付(使用生产级微信支付SDK)
|
||||||
|
|
@ -114,17 +122,26 @@ public class PaymentController {
|
||||||
throw Exceptions.clierr("结算总金额与实际总金额不一致");
|
throw Exceptions.clierr("结算总金额与实际总金额不一致");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 检查是否已存在资金明细记录
|
||||||
|
MoneyChangeDetailEntity existingDetail = moneyChangeDetailService.getByOrderIdAndType(
|
||||||
|
paymentParam.getOrderId(), MoneyDetailType.WX);
|
||||||
|
if (existingDetail != null && PayStatus.PAID.equals(existingDetail.getStatus())) {
|
||||||
|
throw Exceptions.clierr("该订单已支付,无需重复支付");
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// 构建微信支付请求
|
// 构建微信支付请求
|
||||||
String outTradeNo = generateOutTradeNo(ctx.getSn());
|
String outTradeNo = generateOutTradeNo(ctx.getSn());
|
||||||
WxPayUnifiedOrderRequest wxRequest = new WxPayUnifiedOrderRequest();
|
WxPayUnifiedOrderRequest wxRequest = new WxPayUnifiedOrderRequest();
|
||||||
wxRequest.setOutTradeNo(outTradeNo);
|
wxRequest.setOutTradeNo(outTradeNo);
|
||||||
wxRequest.setBody("订单支付-" + ctx.getSn());
|
wxRequest.setBody("订单支付-" + ctx.getSn());
|
||||||
wxRequest.setTotalFee(ctx.getSettleMoney().multiply(new BigDecimal("100")).intValue()); // 转换为分
|
// 转换为分
|
||||||
|
wxRequest.setTotalFee(ctx.getSettleMoney().multiply(new BigDecimal("100")).intValue());
|
||||||
wxRequest.setOpenid(getCurrentUserOpenid(paymentParam.getWxCode()));
|
wxRequest.setOpenid(getCurrentUserOpenid(paymentParam.getWxCode()));
|
||||||
wxRequest.setTradeType("JSAPI");
|
wxRequest.setTradeType("JSAPI");
|
||||||
wxRequest.setSpbillCreateIp(RequestHolder.getClientIP());
|
wxRequest.setSpbillCreateIp(RequestHolder.getClientIP());
|
||||||
wxRequest.setNotifyUrl(properties.getNotifyUrl()); // 需要配置实际的回调地址
|
// 需要配置实际的回调地址
|
||||||
|
wxRequest.setNotifyUrl(properties.getNotifyUrl());
|
||||||
|
|
||||||
// 调用微信支付服务
|
// 调用微信支付服务
|
||||||
WxPayMpOrderResult result = (WxPayMpOrderResult) wechatPayService.createJsapiOrder(wxRequest);
|
WxPayMpOrderResult result = (WxPayMpOrderResult) wechatPayService.createJsapiOrder(wxRequest);
|
||||||
|
|
@ -137,6 +154,28 @@ public class PaymentController {
|
||||||
.set(OrderInfoEntity::getOutTradeNo, outTradeNo)
|
.set(OrderInfoEntity::getOutTradeNo, outTradeNo)
|
||||||
.update();
|
.update();
|
||||||
|
|
||||||
|
// 创建或更新资金明细
|
||||||
|
if (existingDetail == null) {
|
||||||
|
// 新建资金明细
|
||||||
|
MoneyChangeDetailEntity newDetail = new MoneyChangeDetailEntity();
|
||||||
|
newDetail.setType(MoneyDetailType.WX);
|
||||||
|
newDetail.setStatus(PayStatus.PENDING);
|
||||||
|
newDetail.setOrderId(paymentParam.getOrderId());
|
||||||
|
newDetail.setUserId(SecurityUtil.currentUserId());
|
||||||
|
// 扣款为负数
|
||||||
|
newDetail.setDelta(ctx.getSettleMoney().negate());
|
||||||
|
newDetail.setMoneyChangeCategory(MoneyChangeCategory.DingDanKouKuan);
|
||||||
|
newDetail.setMemo("微信支付订单:" + outTradeNo);
|
||||||
|
moneyChangeDetailService.save(newDetail);
|
||||||
|
} else {
|
||||||
|
// 更新现有资金明细状态为待支付
|
||||||
|
existingDetail.setStatus(PayStatus.PENDING);
|
||||||
|
existingDetail.setUserId(SecurityUtil.currentUserId());
|
||||||
|
existingDetail.setDelta(ctx.getSettleMoney().negate());
|
||||||
|
existingDetail.setMemo("微信支付订单:" + outTradeNo);
|
||||||
|
moneyChangeDetailService.updateById(existingDetail);
|
||||||
|
}
|
||||||
|
|
||||||
log.info("微信支付订单创建成功(生产级SDK),订单ID:{},微信订单号:{}", paymentParam.getOrderId(), outTradeNo);
|
log.info("微信支付订单创建成功(生产级SDK),订单ID:{},微信订单号:{}", paymentParam.getOrderId(), outTradeNo);
|
||||||
|
|
||||||
return R.success(result);
|
return R.success(result);
|
||||||
|
|
@ -168,7 +207,8 @@ public class PaymentController {
|
||||||
*/
|
*/
|
||||||
private String generateOutTradeNo(String sn) {
|
private String generateOutTradeNo(String sn) {
|
||||||
String safeSn = sn == null ? "" : sn.replaceAll("[^0-9A-Za-z_-]", "");
|
String safeSn = sn == null ? "" : sn.replaceAll("[^0-9A-Za-z_-]", "");
|
||||||
String suffix = String.valueOf(System.currentTimeMillis() % 100000000L); // 8位以内
|
// 8位以内
|
||||||
|
String suffix = String.valueOf(System.currentTimeMillis() % 100000000L);
|
||||||
String base = "ORDER_" + safeSn + "_" + suffix;
|
String base = "ORDER_" + safeSn + "_" + suffix;
|
||||||
if (base.length() <= 32) {
|
if (base.length() <= 32) {
|
||||||
return base;
|
return base;
|
||||||
|
|
@ -197,7 +237,7 @@ public class PaymentController {
|
||||||
/**
|
/**
|
||||||
* 微信支付回调接口
|
* 微信支付回调接口
|
||||||
*/
|
*/
|
||||||
@PostMapping("/wechat/notify")
|
@PostMapping(value = "/wechat/notify", produces = "text/xml;charset=utf-8")
|
||||||
public String wechatPayNotify(@RequestBody String xmlData) {
|
public String wechatPayNotify(@RequestBody String xmlData) {
|
||||||
try {
|
try {
|
||||||
log.info("收到微信支付回调:{}", xmlData);
|
log.info("收到微信支付回调:{}", xmlData);
|
||||||
|
|
@ -219,6 +259,15 @@ public class PaymentController {
|
||||||
.setOrderStatus(out ? OrderStatus.YiWanCheng : null)
|
.setOrderStatus(out ? OrderStatus.YiWanCheng : null)
|
||||||
.setPayTime(LocalDateTime.now())
|
.setPayTime(LocalDateTime.now())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 更新资金明细状态为已支付
|
||||||
|
MoneyChangeDetailEntity payDetail = moneyChangeDetailService.getByOrderIdAndType(entity.getId(), MoneyDetailType.WX);
|
||||||
|
if (payDetail != null) {
|
||||||
|
payDetail.setStatus(PayStatus.PAID);
|
||||||
|
moneyChangeDetailService.updateById(payDetail);
|
||||||
|
log.info("支付回调:资金明细状态更新为已支付,订单ID:{}", entity.getId());
|
||||||
|
}
|
||||||
|
|
||||||
if (out) {
|
if (out) {
|
||||||
DeviceInfoService.open(orderSn);
|
DeviceInfoService.open(orderSn);
|
||||||
}
|
}
|
||||||
|
|
@ -226,7 +275,9 @@ public class PaymentController {
|
||||||
} else {
|
} else {
|
||||||
log.warn("无法从商户订单号中提取订单");
|
log.warn("无法从商户订单号中提取订单");
|
||||||
}
|
}
|
||||||
return WxPayNotifyResponse.success("处理成功!");
|
String responseXml = WxPayNotifyResponse.success("OK");
|
||||||
|
log.info("准备返回给微信的支付回调XML响应: {}", responseXml);
|
||||||
|
return responseXml;
|
||||||
} catch (WxPayException e) {
|
} catch (WxPayException e) {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
return WxPayNotifyResponse.fail(e.getMessage());
|
return WxPayNotifyResponse.fail(e.getMessage());
|
||||||
|
|
@ -287,12 +338,19 @@ public class PaymentController {
|
||||||
/**
|
/**
|
||||||
* 微信退款回调
|
* 微信退款回调
|
||||||
*/
|
*/
|
||||||
@PostMapping("/wechat/refundNotify")
|
@PostMapping(value = "/wechat/refundNotify", produces = "text/xml;charset=utf-8")
|
||||||
public String parseRefundNotifyResult(@RequestBody String xmlData) {
|
public String parseRefundNotifyResult(@RequestBody String xmlData) {
|
||||||
try {
|
try {
|
||||||
|
log.info("收到微信退款回调:{}", xmlData);
|
||||||
WxPayRefundNotifyResult result = wxPayService.parseRefundNotifyResult(xmlData);
|
WxPayRefundNotifyResult result = wxPayService.parseRefundNotifyResult(xmlData);
|
||||||
|
log.info("退款回调解析结果:{}", result);
|
||||||
String orderSn = extractOrderIdFromOutTradeNo(result.getReqInfo().getOutTradeNo());
|
String orderSn = extractOrderIdFromOutTradeNo(result.getReqInfo().getOutTradeNo());
|
||||||
|
log.info("从退款回调中提取订单号:{}", orderSn);
|
||||||
OrderInfoEntity entity = orderInfoService.getOne(Wrappers.<OrderInfoEntity>lambdaQuery().eq(OrderInfoEntity::getSn, orderSn));
|
OrderInfoEntity entity = orderInfoService.getOne(Wrappers.<OrderInfoEntity>lambdaQuery().eq(OrderInfoEntity::getSn, orderSn));
|
||||||
|
if (entity == null) {
|
||||||
|
log.warn("退款回调订单不存在:{}", orderSn);
|
||||||
|
return WxPayNotifyResponse.fail("订单不存在");
|
||||||
|
}
|
||||||
// 更新订单状态为已退款
|
// 更新订单状态为已退款
|
||||||
orderInfoService.lambdaUpdate()
|
orderInfoService.lambdaUpdate()
|
||||||
.eq(OrderInfoEntity::getId, entity.getId())
|
.eq(OrderInfoEntity::getId, entity.getId())
|
||||||
|
|
@ -300,9 +358,25 @@ public class PaymentController {
|
||||||
.set(OrderInfoEntity::getRefundMoney, entity.getSettleMoney())
|
.set(OrderInfoEntity::getRefundMoney, entity.getSettleMoney())
|
||||||
.set(OrderInfoEntity::getRefundTime, LocalDateTime.now())
|
.set(OrderInfoEntity::getRefundTime, LocalDateTime.now())
|
||||||
.update();
|
.update();
|
||||||
return WxPayNotifyResponse.success("退款成功!");
|
|
||||||
|
// 更新资金明细状态为已退款
|
||||||
|
MoneyChangeDetailEntity refundDetail = moneyChangeDetailService.lambdaQuery()
|
||||||
|
.eq(MoneyChangeDetailEntity::getOrderId, entity.getId())
|
||||||
|
.eq(MoneyChangeDetailEntity::getType, MoneyDetailType.WX)
|
||||||
|
.eq(MoneyChangeDetailEntity::getStatus, PayStatus.REFUNDING)
|
||||||
|
.one();
|
||||||
|
if (refundDetail != null) {
|
||||||
|
refundDetail.setStatus(PayStatus.REFUNDED);
|
||||||
|
moneyChangeDetailService.updateById(refundDetail);
|
||||||
|
log.info("退款回调:资金明细状态更新为已退款,订单ID:{}", entity.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
log.info("退款回调处理成功,订单号:{}", orderSn);
|
||||||
|
String responseXml = WxPayNotifyResponse.success("OK");
|
||||||
|
log.info("准备返回给微信的退款回调XML响应: {}", responseXml);
|
||||||
|
return responseXml;
|
||||||
} catch (WxPayException e) {
|
} catch (WxPayException e) {
|
||||||
log.error(e.getMessage());
|
log.error("退款回调处理异常:{}", e.getMessage(), e);
|
||||||
return WxPayNotifyResponse.fail(e.getMessage());
|
return WxPayNotifyResponse.fail(e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@ import lombok.Setter;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author ljw
|
||||||
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@ToString
|
@ToString
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import com.njzscloud.supervisory.wxPay.dto.RefundRequestDto;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退款服务接口
|
* 退款服务接口
|
||||||
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
public interface PaymentService {
|
public interface PaymentService {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ package com.njzscloud.supervisory.wxPay.service.impl;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import com.njzscloud.common.core.ex.Exceptions;
|
import com.njzscloud.common.core.ex.Exceptions;
|
||||||
import com.njzscloud.supervisory.money.contant.MoneyChangeCategory;
|
import com.njzscloud.supervisory.money.contant.MoneyChangeCategory;
|
||||||
|
import com.njzscloud.supervisory.money.contant.MoneyDetailType;
|
||||||
|
import com.njzscloud.supervisory.money.contant.PayStatus;
|
||||||
import com.njzscloud.supervisory.money.pojo.entity.MoneyAccountEntity;
|
import com.njzscloud.supervisory.money.pojo.entity.MoneyAccountEntity;
|
||||||
import com.njzscloud.supervisory.money.pojo.entity.MoneyChangeDetailEntity;
|
import com.njzscloud.supervisory.money.pojo.entity.MoneyChangeDetailEntity;
|
||||||
import com.njzscloud.supervisory.money.service.MoneyAccountService;
|
import com.njzscloud.supervisory.money.service.MoneyAccountService;
|
||||||
|
|
@ -21,6 +23,7 @@ import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退款服务实现类
|
* 退款服务实现类
|
||||||
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
|
@ -35,10 +38,14 @@ public class PaymentServiceImpl implements PaymentService {
|
||||||
/**
|
/**
|
||||||
* 申请退款
|
* 申请退款
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void refund(RefundRequestDto refundRequest, PaymentContextResult ctx, Boolean isChange) {
|
public void refund(RefundRequestDto refundRequest, PaymentContextResult ctx, Boolean isChange) {
|
||||||
try {
|
try {
|
||||||
|
log.info("开始处理退款申请,订单ID:{},支付方式:{},是否改价:{}",
|
||||||
|
refundRequest.getOrderId(), ctx.getOiPayWay(), isChange);
|
||||||
// 根据支付方式处理退款
|
// 根据支付方式处理退款
|
||||||
if (SettlementWay.CASH.getVal().equals(ctx.getOiPayWay())) {
|
if (SettlementWay.CASH.getVal().equals(ctx.getOiPayWay())) {
|
||||||
|
|
||||||
//微信退款 生成退款单号
|
//微信退款 生成退款单号
|
||||||
String orderSn = IdUtil.getSnowflake(0, 0).nextIdStr();
|
String orderSn = IdUtil.getSnowflake(0, 0).nextIdStr();
|
||||||
// 微信退全款
|
// 微信退全款
|
||||||
|
|
@ -48,7 +55,23 @@ public class PaymentServiceImpl implements PaymentService {
|
||||||
money = refundRequest.getRefundAmount().multiply(new BigDecimal("100")).intValue();
|
money = refundRequest.getRefundAmount().multiply(new BigDecimal("100")).intValue();
|
||||||
}
|
}
|
||||||
String notifyUrl = properties.getRefundNotifyUrl();
|
String notifyUrl = properties.getRefundNotifyUrl();
|
||||||
wechatPayService.refund(refundRequest.getOutTradeNo(), orderSn, money, money, notifyUrl);
|
log.info("发起微信退款,订单ID:{},商户订单号:{},退款单号:{},退款金额:{}分,退款回调地址:{}",
|
||||||
|
refundRequest.getOrderId(), refundRequest.getOutTradeNo(), orderSn, money, notifyUrl);
|
||||||
|
String refundId = wechatPayService.refund(refundRequest.getOutTradeNo(), orderSn, money, money, notifyUrl);
|
||||||
|
log.info("微信退款申请成功,退款ID:{}", refundId);
|
||||||
|
|
||||||
|
// 新建退款资金明细
|
||||||
|
MoneyChangeDetailEntity newRefundDetail = new MoneyChangeDetailEntity()
|
||||||
|
.setType(MoneyDetailType.WX)
|
||||||
|
.setStatus(PayStatus.REFUNDING)
|
||||||
|
.setOrderId(refundRequest.getOrderId())
|
||||||
|
.setUserId(ctx.getDriverUserId())
|
||||||
|
// 退款为正数
|
||||||
|
.setDelta(refundRequest.getRefundAmount())
|
||||||
|
.setMoneyChangeCategory(MoneyChangeCategory.DingDanTuiKuan)
|
||||||
|
.setMemo("微信退款订单:" + orderSn);
|
||||||
|
moneyChangeDetailService.save(newRefundDetail);
|
||||||
|
|
||||||
} else if (SettlementWay.MONTH.getVal().equals(ctx.getOiPayWay()) || SettlementWay.BALANCE.getVal().equals(ctx.getOiPayWay())) {
|
} else if (SettlementWay.MONTH.getVal().equals(ctx.getOiPayWay()) || SettlementWay.BALANCE.getVal().equals(ctx.getOiPayWay())) {
|
||||||
// 公司退款
|
// 公司退款
|
||||||
processCompanyRefund(refundRequest, ctx);
|
processCompanyRefund(refundRequest, ctx);
|
||||||
|
|
@ -91,7 +114,8 @@ public class PaymentServiceImpl implements PaymentService {
|
||||||
.setOrderId(orderId)
|
.setOrderId(orderId)
|
||||||
.setMoneyAccountId(companyAccount.getId())
|
.setMoneyAccountId(companyAccount.getId())
|
||||||
.setOldMoney(oldBalance)
|
.setOldMoney(oldBalance)
|
||||||
.setDelta(refundAmount) // 扣减为负数
|
// 扣减为负数
|
||||||
|
.setDelta(refundAmount)
|
||||||
.setNewMoney(newBalance)
|
.setNewMoney(newBalance)
|
||||||
.setMoneyChangeCategory(MoneyChangeCategory.DingDanTuiKuan)
|
.setMoneyChangeCategory(MoneyChangeCategory.DingDanTuiKuan)
|
||||||
.setMemo(reason);
|
.setMemo(reason);
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import java.util.UUID;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 微信消息推送服务实现类
|
* 微信消息推送服务实现类
|
||||||
|
* @author ljw
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
|
|
@ -36,6 +37,21 @@ public class WechatTemplateMessageServiceImpl implements WechatTemplateMessageSe
|
||||||
|
|
||||||
private final UserService userService;
|
private final UserService userService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 处理微信模板消息thing字段的字符长度限制(最多20个字符)
|
||||||
|
* @param content 原始内容
|
||||||
|
* @return 处理后的内容
|
||||||
|
*/
|
||||||
|
private String truncateForThingField(String content) {
|
||||||
|
if (Strings.isNullOrEmpty(content)) {
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
if (content.length() > 20) {
|
||||||
|
return content.substring(0, 17) + "...";
|
||||||
|
}
|
||||||
|
return content;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bind(String code) {
|
public void bind(String code) {
|
||||||
// 使用Code换取Access Token和OpenID
|
// 使用Code换取Access Token和OpenID
|
||||||
|
|
@ -116,17 +132,17 @@ public class WechatTemplateMessageServiceImpl implements WechatTemplateMessageSe
|
||||||
data = new HashMap<>();
|
data = new HashMap<>();
|
||||||
data.put("character_string2", new TemplateData(param.getSn()));
|
data.put("character_string2", new TemplateData(param.getSn()));
|
||||||
data.put("thing19", new TemplateData(param.getGoodsName()));
|
data.put("thing19", new TemplateData(param.getGoodsName()));
|
||||||
data.put("thing4", new TemplateData(param.getStartAddress()));
|
data.put("thing4", new TemplateData(truncateForThingField(param.getStartAddress())));
|
||||||
sendMessage(userEntity.getOpenid(), TemplateID.TRANS_COMPANY_TEMP_ID, data, null, null);
|
sendMessage(userEntity.getOpenid(), TemplateID.TRANS_COMPANY_TEMP_ID, data, null, "pages/basicPage/publicOrder");
|
||||||
} else if (TempType.DRIVER.getVal().equals(param.getTempType())) {
|
} else if (TempType.DRIVER.getVal().equals(param.getTempType())) {
|
||||||
// 通知司机
|
// 通知司机
|
||||||
// 构建模板数据
|
// 构建模板数据
|
||||||
data = new HashMap<>();
|
data = new HashMap<>();
|
||||||
data.put("character_string5", new TemplateData(param.getSn()));
|
data.put("character_string5", new TemplateData(param.getSn()));
|
||||||
data.put("thing7", new TemplateData(param.getDriverName()));
|
data.put("thing7", new TemplateData(param.getDriverName()));
|
||||||
data.put("thing2", new TemplateData(param.getStartAddress()));
|
data.put("thing2", new TemplateData(truncateForThingField(param.getStartAddress())));
|
||||||
data.put("thing3", new TemplateData(param.getEndAddress()));
|
data.put("thing3", new TemplateData(param.getEndAddress()));
|
||||||
sendMessage(userEntity.getOpenid(), TemplateID.DRIVER_TEMP_ID, data, null, null);
|
sendMessage(userEntity.getOpenid(), TemplateID.DRIVER_TEMP_ID, data, null, "pages/transportPage/jointOrder");
|
||||||
} else if (TempType.AUDIT_PENDING.getVal().equals(param.getTempType())) {
|
} else if (TempType.AUDIT_PENDING.getVal().equals(param.getTempType())) {
|
||||||
// 待审核
|
// 待审核
|
||||||
// 构建模板数据
|
// 构建模板数据
|
||||||
|
|
@ -135,7 +151,7 @@ public class WechatTemplateMessageServiceImpl implements WechatTemplateMessageSe
|
||||||
data.put("thing11", new TemplateData(param.getGoodsName()));
|
data.put("thing11", new TemplateData(param.getGoodsName()));
|
||||||
data.put("thing9", new TemplateData(param.getCfCompanyName()));
|
data.put("thing9", new TemplateData(param.getCfCompanyName()));
|
||||||
data.put("car_number13", new TemplateData(param.getLicensePlate()));
|
data.put("car_number13", new TemplateData(param.getLicensePlate()));
|
||||||
sendMessage(userEntity.getOpenid(), TemplateID.AUDIT_PENDING, data, null, null);
|
sendMessage(userEntity.getOpenid(), TemplateID.AUDIT_PENDING, data, null, "pages/adminPage/jianGuan");
|
||||||
} else if (TempType.AUDIT_OK.getVal().equals(param.getTempType())) {
|
} else if (TempType.AUDIT_OK.getVal().equals(param.getTempType())) {
|
||||||
// 审核通过
|
// 审核通过
|
||||||
// 构建模板数据
|
// 构建模板数据
|
||||||
|
|
@ -145,15 +161,15 @@ public class WechatTemplateMessageServiceImpl implements WechatTemplateMessageSe
|
||||||
data.put("thing8", new TemplateData(param.getDriverName()));
|
data.put("thing8", new TemplateData(param.getDriverName()));
|
||||||
data.put("car_number7", new TemplateData(param.getLicensePlate()));
|
data.put("car_number7", new TemplateData(param.getLicensePlate()));
|
||||||
data.put("thing3", new TemplateData(param.getEndAddress()));
|
data.put("thing3", new TemplateData(param.getEndAddress()));
|
||||||
sendMessage(userEntity.getOpenid(), TemplateID.AUDIT_OK, data, null, null);
|
sendMessage(userEntity.getOpenid(), TemplateID.AUDIT_OK, data, null, "pages/transportPage/jointOrder");
|
||||||
} else if (TempType.AUDIT_REJECT.getVal().equals(param.getTempType())) {
|
} else if (TempType.AUDIT_REJECT.getVal().equals(param.getTempType())) {
|
||||||
// 审核驳回
|
// 审核驳回
|
||||||
// 构建模板数据
|
// 构建模板数据
|
||||||
data = new HashMap<>();
|
data = new HashMap<>();
|
||||||
data.put("character_string8", new TemplateData(param.getSn()));
|
data.put("character_string8", new TemplateData(param.getSn()));
|
||||||
data.put("thing4", new TemplateData(param.getGoodsName()));
|
data.put("thing4", new TemplateData(param.getGoodsName()));
|
||||||
data.put("thing2", new TemplateData(param.getStartAddress()));
|
data.put("thing2", new TemplateData(truncateForThingField(param.getStartAddress())));
|
||||||
sendMessage(userEntity.getOpenid(), TemplateID.AUDIT_REJECT, data, null, null);
|
sendMessage(userEntity.getOpenid(), TemplateID.AUDIT_REJECT, data, null, "pages/transportPage/jointOrder");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
log.info("未查询到用户信息或不存在openid,无法通知");
|
log.info("未查询到用户信息或不存在openid,无法通知");
|
||||||
|
|
@ -180,13 +196,16 @@ public class WechatTemplateMessageServiceImpl implements WechatTemplateMessageSe
|
||||||
requestData.put("template_id", templateId);
|
requestData.put("template_id", templateId);
|
||||||
|
|
||||||
if (url != null) {
|
if (url != null) {
|
||||||
requestData.put("url", url); // 点击消息跳转的URL
|
// 点击消息跳转的URL
|
||||||
|
requestData.put("url", url);
|
||||||
|
} else {
|
||||||
|
requestData.put("url", "https://supervisory.njzscloud.com");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (miniProgram != null) {
|
if (miniProgram != null) {
|
||||||
JSONObject miniProgramObj = new JSONObject();
|
JSONObject miniProgramObj = new JSONObject();
|
||||||
miniProgramObj.put("appid", miniProgram);
|
miniProgramObj.put("appid", WxApiConfig.XCX_APP_ID);
|
||||||
miniProgramObj.put("pagepath", "pages/index/index");
|
miniProgramObj.put("pagepath", miniProgram);
|
||||||
requestData.put("miniprogram", miniProgramObj);
|
requestData.put("miniprogram", miniProgramObj);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -201,7 +220,7 @@ public class WechatTemplateMessageServiceImpl implements WechatTemplateMessageSe
|
||||||
dataObj.put(entry.getKey(), item);
|
dataObj.put(entry.getKey(), item);
|
||||||
}
|
}
|
||||||
requestData.put("data", dataObj);
|
requestData.put("data", dataObj);
|
||||||
log.info(JSONObject.toJSONString(requestData));
|
log.info("发送模板消息参数为:{}", JSONObject.toJSONString(requestData));
|
||||||
|
|
||||||
// 4. 发送请求
|
// 4. 发送请求
|
||||||
RestTemplate restTemplate = new RestTemplate();
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,8 @@
|
||||||
ma.user_id as userId,
|
ma.user_id as userId,
|
||||||
ma.station_id as stationId,
|
ma.station_id as stationId,
|
||||||
ma.money,
|
ma.money,
|
||||||
|
ma.revenue,
|
||||||
|
ma.file_url,
|
||||||
ma.modify_time as modifyTime,
|
ma.modify_time as modifyTime,
|
||||||
CASE
|
CASE
|
||||||
WHEN ma.user_id IS NOT NULL THEN u.nickname
|
WHEN ma.user_id IS NOT NULL THEN u.nickname
|
||||||
|
|
@ -51,6 +53,8 @@
|
||||||
ma.user_id as userId,
|
ma.user_id as userId,
|
||||||
ma.station_id as stationId,
|
ma.station_id as stationId,
|
||||||
ma.money,
|
ma.money,
|
||||||
|
ma.revenue,
|
||||||
|
ma.file_url,
|
||||||
ma.modify_time as modifyTime,
|
ma.modify_time as modifyTime,
|
||||||
CASE
|
CASE
|
||||||
WHEN ma.user_id IS NOT NULL THEN u.nickname
|
WHEN ma.user_id IS NOT NULL THEN u.nickname
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@
|
||||||
SELECT
|
SELECT
|
||||||
mcd.id,
|
mcd.id,
|
||||||
mcd.user_id,
|
mcd.user_id,
|
||||||
|
mcd.type,
|
||||||
|
mcd.status,
|
||||||
mcd.money_account_id,
|
mcd.money_account_id,
|
||||||
mcd.old_money,
|
mcd.old_money,
|
||||||
mcd.delta,
|
mcd.delta,
|
||||||
|
|
@ -21,6 +23,7 @@
|
||||||
mcd.modify_time,
|
mcd.modify_time,
|
||||||
mcd.deleted,
|
mcd.deleted,
|
||||||
oi.sn,
|
oi.sn,
|
||||||
|
bt.license_plate,
|
||||||
CASE
|
CASE
|
||||||
WHEN mcd.user_id IS NOT NULL THEN u.nickname
|
WHEN mcd.user_id IS NOT NULL THEN u.nickname
|
||||||
WHEN mcd.company_id IS NOT NULL THEN bc.company_name
|
WHEN mcd.company_id IS NOT NULL THEN bc.company_name
|
||||||
|
|
@ -30,6 +33,7 @@
|
||||||
LEFT JOIN sys_user u ON mcd.user_id = u.id
|
LEFT JOIN sys_user u ON mcd.user_id = u.id
|
||||||
LEFT JOIN biz_company bc ON mcd.company_id = bc.id
|
LEFT JOIN biz_company bc ON mcd.company_id = bc.id
|
||||||
LEFT JOIN order_info oi on oi.id = mcd.order_id
|
LEFT JOIN order_info oi on oi.id = mcd.order_id
|
||||||
|
LEFT JOIN biz_truck bt ON bt.id = oi.truck_id
|
||||||
<where>
|
<where>
|
||||||
<if test="entity.nickname != null and entity.nickname != ''">
|
<if test="entity.nickname != null and entity.nickname != ''">
|
||||||
AND (u.nickname LIKE CONCAT('%', #{entity.nickname}, '%') or
|
AND (u.nickname LIKE CONCAT('%', #{entity.nickname}, '%') or
|
||||||
|
|
@ -38,6 +42,12 @@
|
||||||
<if test="entity.moneyChangeCategory != null">
|
<if test="entity.moneyChangeCategory != null">
|
||||||
AND mcd.money_change_category = #{entity.moneyChangeCategory}
|
AND mcd.money_change_category = #{entity.moneyChangeCategory}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="entity.licensePlate != null">
|
||||||
|
AND bt.license_plate LIKE CONCAT('%', #{entity.licensePlate}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="entity.sn != null">
|
||||||
|
AND oi.sn LIKE CONCAT('%', #{entity.sn}, '%')
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
ORDER BY mcd.modify_time DESC
|
ORDER BY mcd.modify_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -88,6 +98,9 @@
|
||||||
<if test="entity.endTime != null">
|
<if test="entity.endTime != null">
|
||||||
AND mcd.create_time <= #{entity.endTime}
|
AND mcd.create_time <= #{entity.endTime}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="entity.type != null">
|
||||||
|
AND mcd.type <= #{entity.type}
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
ORDER BY
|
ORDER BY
|
||||||
mcd.create_time DESC
|
mcd.create_time DESC
|
||||||
|
|
|
||||||
|
|
@ -228,10 +228,12 @@
|
||||||
<result property="settleWeight" column="settle_weight"/>
|
<result property="settleWeight" column="settle_weight"/>
|
||||||
<result property="driverName" column="driver_name"/>
|
<result property="driverName" column="driver_name"/>
|
||||||
<result property="checkerMemo" column="checker_memo"/>
|
<result property="checkerMemo" column="checker_memo"/>
|
||||||
|
<result property="goodsName" column="goods_name"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<resultMap id="OrderExportDetailResultMap" type="com.njzscloud.supervisory.order.pojo.result.OrderExportDetailResult">
|
<resultMap id="OrderExportDetailResultMap" type="com.njzscloud.supervisory.order.pojo.result.OrderExportDetailResult">
|
||||||
<result property="orderId" column="order_id"/>
|
<result property="orderId" column="order_id"/>
|
||||||
|
<result property="expenseItemCategory" column="expense_item_category"/>
|
||||||
<result property="expenseItemName" column="expense_item_name"/>
|
<result property="expenseItemName" column="expense_item_name"/>
|
||||||
<result property="settleMoney" column="settle_money"/>
|
<result property="settleMoney" column="settle_money"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
@ -261,7 +263,8 @@
|
||||||
ROUND( ocio.tare_weight / 1000, 2 ) AS tare_weight,
|
ROUND( ocio.tare_weight / 1000, 2 ) AS tare_weight,
|
||||||
ROUND( ocio.settle_weight / 1000, 2 ) AS settle_weight,
|
ROUND( ocio.settle_weight / 1000, 2 ) AS settle_weight,
|
||||||
f.driver_name,
|
f.driver_name,
|
||||||
a.checker_memo
|
a.checker_memo,
|
||||||
|
og.goods_name
|
||||||
FROM
|
FROM
|
||||||
order_info a
|
order_info a
|
||||||
LEFT JOIN biz_company b ON b.id = a.station_id
|
LEFT JOIN biz_company b ON b.id = a.station_id
|
||||||
|
|
@ -273,6 +276,7 @@
|
||||||
LEFT JOIN sys_user su ON a.user_id = su.id
|
LEFT JOIN sys_user su ON a.user_id = su.id
|
||||||
LEFT JOIN order_cargo_place h ON h.id = a.cargo_place_id
|
LEFT JOIN order_cargo_place h ON h.id = a.cargo_place_id
|
||||||
LEFT JOIN biz_driver f ON f.id = a.driver_id
|
LEFT JOIN biz_driver f ON f.id = a.driver_id
|
||||||
|
LEFT JOIN order_goods og ON og.id = a.goods_id
|
||||||
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
|
||||||
${ew.customSqlSegment}
|
${ew.customSqlSegment}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -283,6 +287,7 @@
|
||||||
<select id="exportDetailList" resultMap="OrderExportDetailResultMap">
|
<select id="exportDetailList" resultMap="OrderExportDetailResultMap">
|
||||||
SELECT
|
SELECT
|
||||||
oei.order_id,
|
oei.order_id,
|
||||||
|
oei.expense_item_category,
|
||||||
oei.expense_item_name,
|
oei.expense_item_name,
|
||||||
oei.settle_money
|
oei.settle_money
|
||||||
FROM
|
FROM
|
||||||
|
|
@ -333,7 +338,8 @@
|
||||||
bc.settlement_way,
|
bc.settlement_way,
|
||||||
sua.wechat_openid,
|
sua.wechat_openid,
|
||||||
a.refund_money,
|
a.refund_money,
|
||||||
a.settle_money
|
a.settle_money,
|
||||||
|
bd.user_id AS driver_user_id
|
||||||
FROM order_info a
|
FROM order_info a
|
||||||
LEFT JOIN biz_company bc ON bc.id = a.trans_company_id
|
LEFT JOIN biz_company bc ON bc.id = a.trans_company_id
|
||||||
LEFT JOIN money_account ma1 ON ma1.station_id = a.trans_company_id
|
LEFT JOIN money_account ma1 ON ma1.station_id = a.trans_company_id
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue