站内信,公告

localizer
ljw 2025-09-27 18:49:07 +08:00
parent e8c1580de7
commit 5b01abe121
18 changed files with 670 additions and 7 deletions

View File

@ -11,10 +11,10 @@ import lombok.RequiredArgsConstructor;
@Getter
@RequiredArgsConstructor
public enum ProcessStatus implements DictStr {
DaiChuLi("DaiChuLi", "待处理"),
YiChuLi("YiChuLi", "待处理"),
HuLue("HuLue", "忽略");
PENDING("PENDING", "待处理"),
PROCESSING("PROCESSING", "处理中"),
PROCESSED("PROCESSED", "已处理"),
IGNORED("IGNORED", "已忽略");
private final String val;
private final String txt;
}

View File

@ -315,11 +315,11 @@ public class PaymentController {
*
*/
@PostMapping("/wechat/bind")
public R<?> bindWechatAccount(@RequestParam Long userId, @RequestParam String wxCode) {
public R<?> bindWechatAccount(@RequestBody BindParam param) {
// 通过userId查询用户账号信息
UserAccountEntity userAccount = userAccountService.getOne(
Wrappers.<UserAccountEntity>lambdaQuery()
.eq(UserAccountEntity::getUserId, userId)
.eq(UserAccountEntity::getUserId, param.getUserId())
);
if (userAccount == null) {
@ -327,7 +327,7 @@ public class PaymentController {
}
// 调用微信API获取openId和unionId
Code2SessionResult code2SessionResult = WechatUtil.code2Session(new Code2SessionParam().setJs_code(wxCode));
Code2SessionResult code2SessionResult = WechatUtil.code2Session(new Code2SessionParam().setJs_code(param.getWxCode()));
Integer errcode = code2SessionResult.getErrcode();
if (errcode != null && errcode != 0) {
log.error("微信登录失败, errcode: {}, errmsg: {}", errcode, code2SessionResult.getErrmsg());

View File

@ -0,0 +1,12 @@
package com.njzscloud.supervisory.order.pojo.dto;
import lombok.Data;
@Data
public class BindParam {
private Long userId;
private String wxCode;
}

View File

@ -0,0 +1,68 @@
package com.njzscloud.supervisory.sys.bulletin.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.sys.bulletin.pojo.BulletinEntity;
import com.njzscloud.supervisory.sys.bulletin.service.BulletinService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
*/
@Slf4j
@RestController
@RequestMapping("/bulletin")
@RequiredArgsConstructor
public class BulletinController {
private final BulletinService bulletinService;
/**
*
*/
@PostMapping("/add")
public R<?> add(@RequestBody BulletinEntity bulletinEntity) {
bulletinService.add(bulletinEntity);
return R.success();
}
/**
*
*/
@PostMapping("/modify")
public R<?> modify(@RequestBody BulletinEntity bulletinEntity) {
bulletinService.modify(bulletinEntity);
return R.success();
}
/**
*
*/
@PostMapping("/del")
public R<?> del(@RequestBody List<Long> ids) {
bulletinService.del(ids);
return R.success();
}
/**
*
*/
@GetMapping("/detail")
public R<BulletinEntity> detail(@RequestParam Long id) {
return R.success(bulletinService.detail(id));
}
/**
*
*/
@GetMapping("/paging")
public R<PageResult<BulletinEntity>> paging(PageParam pageParam, BulletinEntity bulletinEntity) {
return R.success(bulletinService.paging(pageParam, bulletinEntity));
}
}

View File

@ -0,0 +1,13 @@
package com.njzscloud.supervisory.sys.bulletin.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.njzscloud.supervisory.sys.bulletin.pojo.BulletinEntity;
import org.apache.ibatis.annotations.Mapper;
/**
*
*/
@Mapper
public interface BulletinMapper extends BaseMapper<BulletinEntity> {
}

View File

@ -0,0 +1,70 @@
package com.njzscloud.supervisory.sys.bulletin.pojo;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
/**
*
*/
@Getter
@Setter
@Accessors(chain = true)
@TableName("bulletin")
public class BulletinEntity {
/**
* Id
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
*
*/
private String title;
/**
*
*/
private String picture;
/**
* ; 0-->1-->
*/
private Boolean enabled;
/**
* 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;
}

View File

@ -0,0 +1,40 @@
package com.njzscloud.supervisory.sys.bulletin.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.njzscloud.common.mp.support.PageParam;
import com.njzscloud.common.mp.support.PageResult;
import com.njzscloud.supervisory.sys.bulletin.pojo.BulletinEntity;
import java.util.List;
/**
*
*/
public interface BulletinService extends IService<BulletinEntity> {
/**
*
*/
void add(BulletinEntity bulletinEntity);
/**
*
*/
void modify(BulletinEntity bulletinEntity);
/**
*
*/
void del(List<Long> ids);
/**
*
*/
BulletinEntity detail(Long id);
/**
*
*/
PageResult<BulletinEntity> paging(PageParam pageParam, BulletinEntity bulletinEntity);
}

View File

@ -0,0 +1,67 @@
package com.njzscloud.supervisory.sys.bulletin.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njzscloud.common.mp.support.PageParam;
import com.njzscloud.common.mp.support.PageResult;
import com.njzscloud.supervisory.sys.bulletin.mapper.BulletinMapper;
import com.njzscloud.supervisory.sys.bulletin.pojo.BulletinEntity;
import com.njzscloud.supervisory.sys.bulletin.service.BulletinService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
/**
*
*/
@Slf4j
@Service
public class BulletinServiceImpl extends ServiceImpl<BulletinMapper, BulletinEntity> implements BulletinService {
/**
*
*/
@Override
public void add(BulletinEntity bulletinEntity) {
this.save(bulletinEntity);
}
/**
*
*/
@Override
public void modify(BulletinEntity bulletinEntity) {
this.updateById(bulletinEntity);
}
/**
*
*/
@Override
public void del(List<Long> ids) {
this.removeBatchByIds(ids);
}
/**
*
*/
@Override
public BulletinEntity detail(Long id) {
return this.getById(id);
}
/**
*
*/
@Override
public PageResult<BulletinEntity> paging(PageParam pageParam, BulletinEntity bulletinEntity) {
return PageResult.of(this.page(pageParam.toPage(), Wrappers.<BulletinEntity>lambdaQuery()
.like(StrUtil.isNotBlank(bulletinEntity.getTitle()), BulletinEntity::getTitle, bulletinEntity.getTitle())
.eq(bulletinEntity.getDeleted() != null, BulletinEntity::getDeleted, Boolean.FALSE)
.eq(bulletinEntity.getEnabled() != null, BulletinEntity::getEnabled, bulletinEntity.getEnabled())
.orderByDesc(BulletinEntity::getCreateTime)));
}
}

View File

@ -0,0 +1,21 @@
package com.njzscloud.supervisory.sys.stationletter.constant;
import com.njzscloud.common.core.ienum.DictStr;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
/**
* warn_category
*
*/
@Getter
@RequiredArgsConstructor
public enum WarnCategory implements DictStr {
SAFETY("SAFETY", "订单超时预警"),
SPEED("SPEED", "车辆超速预警"),
ROUTE("ROUTE", "路线偏离预警"),
EQUIPMENT("EQUIPMENT", "GPS异常预警"),
;
private final String val;
private final String txt;
}

View File

@ -0,0 +1,32 @@
package com.njzscloud.supervisory.sys.stationletter.controller;
import com.njzscloud.common.core.utils.R;
import com.njzscloud.supervisory.sys.stationletter.pojo.StationLetterResult;
import com.njzscloud.supervisory.sys.stationletter.service.StationLetterService;
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;
/**
*
*/
@Slf4j
@RestController
@RequestMapping("/station")
@RequiredArgsConstructor
public class StationLetterController {
private final StationLetterService stationLetterService;
/**
*
*/
@GetMapping("/letter")
public R<StationLetterResult> letter() {
StationLetterResult result = stationLetterService.getPendingWarnList();
return R.success(result);
}
}

View File

@ -0,0 +1,44 @@
package com.njzscloud.supervisory.sys.stationletter.mapper;
import com.njzscloud.supervisory.sys.stationletter.pojo.StationLetterEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* Mapper
*/
@Mapper
public interface StationLetterMapper {
/**
*
*/
List<StationLetterEntity> selectPendingWarnList();
/**
*
*/
int selectPendingCompanyCount();
/**
*
*/
int selectPendingTruckCount();
/**
*
*/
int selectPendingProjectCount();
/**
*
*/
int selectPendingDriverCount();
/**
*
*/
int selectPendingOrderCount();
}

View File

@ -0,0 +1,33 @@
package com.njzscloud.supervisory.sys.stationletter.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
/**
*
*/
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class AuditResult {
/**
* : company/truck/project/driver/order
*/
private String moduleType;
/**
*
*/
private String auditName;
/**
*
*/
private Integer count;
}

View File

@ -0,0 +1,41 @@
package com.njzscloud.supervisory.sys.stationletter.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
/**
*
*/
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class StationLetterEntity {
/**
* ID
*/
private Long id;
private String warnCategory;
/**
*
*/
private String warnCategoryName;
/**
*
*/
private String licensePlate;
/**
*
*/
private LocalDateTime createTime;
}

View File

@ -0,0 +1,23 @@
package com.njzscloud.supervisory.sys.stationletter.pojo;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.util.List;
/**
*
*/
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class StationLetterResult {
private List<StationLetterEntity> warnList;
private List<AuditResult> auditResultList;
}

View File

@ -0,0 +1,15 @@
package com.njzscloud.supervisory.sys.stationletter.service;
import com.njzscloud.supervisory.sys.stationletter.pojo.StationLetterResult;
/**
*
*/
public interface StationLetterService {
/**
*
*/
StationLetterResult getPendingWarnList();
}

View File

@ -0,0 +1,98 @@
package com.njzscloud.supervisory.sys.stationletter.service.impl;
import com.njzscloud.supervisory.sys.stationletter.constant.WarnCategory;
import com.njzscloud.supervisory.sys.stationletter.mapper.StationLetterMapper;
import com.njzscloud.supervisory.sys.stationletter.pojo.AuditResult;
import com.njzscloud.supervisory.sys.stationletter.pojo.StationLetterEntity;
import com.njzscloud.supervisory.sys.stationletter.pojo.StationLetterResult;
import com.njzscloud.supervisory.sys.stationletter.service.StationLetterService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.compress.utils.Lists;
import org.springframework.stereotype.Service;
import java.util.List;
/**
*
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class StationLetterServiceImpl implements StationLetterService {
private final StationLetterMapper stationLetterMapper;
@Override
public StationLetterResult getPendingWarnList() {
StationLetterResult result = new StationLetterResult();
List<StationLetterEntity> entities = stationLetterMapper.selectPendingWarnList();
for (StationLetterEntity entity : entities) {
// 通过枚举类设置预警类型中文名称
String warnCategoryName = getWarnCategoryName(entity.getWarnCategory());
entity.setWarnCategoryName(warnCategoryName);
}
result.setWarnList(entities);
List<AuditResult> auditResults = Lists.newArrayList();
// 1.查询未删除并且待审核的公司数量表为biz_company
int companyCount = stationLetterMapper.selectPendingCompanyCount();
AuditResult companyAudit = new AuditResult();
companyAudit.setModuleType("company");
companyAudit.setAuditName("待审核公司");
companyAudit.setCount(companyCount);
auditResults.add(companyAudit);
// 2.查询未删除并且待审核的车辆数量表为biz_truck
int truckCount = stationLetterMapper.selectPendingTruckCount();
AuditResult truckAudit = new AuditResult();
truckAudit.setModuleType("truck");
truckAudit.setAuditName("待审核车辆");
truckAudit.setCount(truckCount);
auditResults.add(truckAudit);
// 3.查询未删除并且待审核的项目数量表为biz_project
int projectCount = stationLetterMapper.selectPendingProjectCount();
AuditResult projectAudit = new AuditResult();
projectAudit.setModuleType("project");
projectAudit.setAuditName("待审核项目");
projectAudit.setCount(projectCount);
auditResults.add(projectAudit);
// 4.查询未删除并且待审核的司机数量表为biz_driver
int driverCount = stationLetterMapper.selectPendingDriverCount();
AuditResult driverAudit = new AuditResult();
driverAudit.setModuleType("driver");
driverAudit.setAuditName("待审核司机");
driverAudit.setCount(driverCount);
auditResults.add(driverAudit);
// 5.查询未删除并且待审核的订单数量表为order_info
int orderCount = stationLetterMapper.selectPendingOrderCount();
AuditResult orderAudit = new AuditResult();
orderAudit.setModuleType("order");
orderAudit.setAuditName("待审核订单");
orderAudit.setCount(orderCount);
auditResults.add(orderAudit);
result.setAuditResultList(auditResults);
return result;
}
/**
*
*/
private String getWarnCategoryName(String warnCategory) {
if (warnCategory == null) {
return "未知类型";
}
for (WarnCategory category : WarnCategory.values()) {
if (category.getVal().equals(warnCategory)) {
return category.getTxt();
}
}
return "未知类型";
}
}

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njzscloud.supervisory.sys.bulletin.mapper.BulletinMapper">
<!-- 通用查询映射结果 -->
<resultMap id="BaseResultMap" type="com.njzscloud.supervisory.sys.bulletin.pojo.BulletinEntity">
<id column="id" property="id" />
<result column="title" property="title" />
<result column="picture" property="picture" />
<result column="enabled" property="enabled" />
<result column="creator_id" property="creatorId" />
<result column="modifier_id" property="modifierId" />
<result column="create_time" property="createTime" />
<result column="modify_time" property="modifyTime" />
<result column="deleted" property="deleted" />
</resultMap>
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, title, picture, enabled, creator_id, modifier_id, create_time, modify_time, deleted
</sql>
</mapper>

View File

@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.njzscloud.supervisory.sys.stationletter.mapper.StationLetterMapper">
<resultMap id="StationLetterResultMap" type="com.njzscloud.supervisory.sys.stationletter.pojo.StationLetterEntity">
<id property="id" column="id"/>
<result property="warnCategoryName" column="warn_category_name"/>
<result property="warnCategory" column="warn_category"/>
<result property="licensePlate" column="license_plate"/>
<result property="createTime" column="create_time"/>
</resultMap>
<select id="selectPendingWarnList" resultMap="StationLetterResultMap">
SELECT
bw.id,
bw.warn_category,
bt.license_plate,
bw.create_time
FROM biz_warn bw
LEFT JOIN order_info oi ON bw.order_id = oi.id AND oi.deleted = 0
LEFT JOIN biz_truck bt ON oi.truck_id = bt.id AND bt.deleted = 0
WHERE bw.process_status = 'PENDING'
AND bw.deleted = 0
ORDER BY bw.create_time DESC
</select>
<!-- 查询待审核的公司数量 -->
<select id="selectPendingCompanyCount" resultType="int">
SELECT COUNT(*)
FROM biz_company
WHERE deleted = 0 AND audit_status = 'DaiShenHe'
</select>
<!-- 查询待审核的车辆数量 -->
<select id="selectPendingTruckCount" resultType="int">
SELECT COUNT(*)
FROM biz_truck
WHERE deleted = 0 AND audit_status = 'DaiShenHe'
</select>
<!-- 查询待审核的项目数量 -->
<select id="selectPendingProjectCount" resultType="int">
SELECT COUNT(*)
FROM biz_project
WHERE deleted = 0 AND audit_status = 'DaiShenHe'
</select>
<!-- 查询待审核的司机数量 -->
<select id="selectPendingDriverCount" resultType="int">
SELECT COUNT(*)
FROM biz_driver
WHERE deleted = 0 AND audit_status = 'DaiShenHe'
</select>
<!-- 查询待审核的订单数量 -->
<select id="selectPendingOrderCount" resultType="int">
SELECT COUNT(*)
FROM order_info
WHERE deleted = 0 AND audit_status = 'DaiShenHe'
</select>
</mapper>