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