localizer
lzq 2025-09-21 20:14:09 +08:00
parent 5e8511014f
commit 4488a83cbd
49 changed files with 1552 additions and 106 deletions

View File

@ -35,7 +35,7 @@ public class Fastjson {
JSONWriter.Feature.WriteNulls, // 序列化输出空值字段
JSONWriter.Feature.BrowserCompatible, // 在大范围超过JavaScript支持的整数输出为字符串格式
JSONWriter.Feature.WriteClassName, // 序列化时输出类型信息
JSONWriter.Feature.PrettyFormat, // 格式化输出
// JSONWriter.Feature.PrettyFormat, // 格式化输出
JSONWriter.Feature.SortMapEntriesByKeys, // 对Map中的KeyValue按照Key做排序后再输出。在有些验签的场景需要使用这个Feature
JSONWriter.Feature.WriteBigDecimalAsPlain, // 序列化BigDecimal使用toPlainString避免科学计数法
JSONWriter.Feature.WriteNullListAsEmpty, // 将List类型字段的空值序列化输出为空数组"[]"

View File

@ -186,7 +186,7 @@ public class Jackson {
.setTimeZone(TimeZone.getTimeZone("GMT+8"))
.setDateFormat(new SimpleDateFormat(DatePattern.NORM_DATETIME_PATTERN))
.setSerializationInclusion(JsonInclude.Include.ALWAYS)
.configure(SerializationFeature.INDENT_OUTPUT, true) // 格式化输出
// .configure(SerializationFeature.INDENT_OUTPUT, true) // 格式化输出
.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false)
.configure(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true) // 对Map中的KeyValue按照Key做排序后再输出。在有些验签的场景需要使用这个Feature
.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false)

View File

@ -62,7 +62,7 @@ public class ReusableHttpServletRequest extends HttpServletRequestWrapper {
body = StrUtil.isBlank(body) ? "无" : body;
}
}
log.info("接口:【{}】【{}】\n请求头【{}】\n请求参数【{}】\n请求体【{}】",
log.info("接口:{} {}\n请求头{}\n请求参数{}\n请求体{}",
method, requestURI, headerMap.isEmpty() ? "无" : Jackson.toJsonStr(headerMap), parameterMap.isEmpty() ? "无" : Jackson.toJsonStr(parameterMap), body);
} catch (Throwable e) {
log.error("接口请求信息打印失败", e);

View File

@ -23,6 +23,7 @@ public final class Constants {
public static final String TOKEN_STR_SEPARATOR = ",";
public static final String LOGIN_URL = "/auth/login";
public static final String LOGIN_CODE_URL = "/auth/login_code";
public static final String LOGIN_WECHAT_URL = "/auth/login_wechat";
public static final String LOGOUT_URL = "/auth/logout";
/**

View File

@ -0,0 +1,55 @@
package com.njzscloud.common.security.module.wechat;
import com.njzscloud.common.core.ex.ExceptionMsg;
import com.njzscloud.common.security.contant.AuthWay;
import com.njzscloud.common.security.ex.UserLoginException;
import com.njzscloud.common.security.module.code.CodeLoginForm;
import com.njzscloud.common.security.module.password.PasswordLoginForm;
import com.njzscloud.common.security.support.*;
import lombok.RequiredArgsConstructor;
import java.util.Set;
/**
*
*/
@RequiredArgsConstructor
public class WechatAuthenticationProvider extends AbstractAuthenticationProvider {
private final IUserService iUserService;
private final IRoleService iRoleService;
private final IResourceService iResourceService;
/**
*
*
* @param loginForm
* @return
*/
@Override
protected UserDetail retrieveUser(LoginForm loginForm) throws UserLoginException {
WechatLoginForm wechatLoginForm = (WechatLoginForm) loginForm;
String code = wechatLoginForm.getCode();
AuthWay authWay = wechatLoginForm.getAuthWay();
UserDetail userDetail = iUserService.selectUser(code, authWay);
if (userDetail == null) throw new UserLoginException(ExceptionMsg.CLI_ERR_MSG, "账号不存在");
Long userId = userDetail.getUserId();
Set<String> roles = iRoleService.selectRoleByUserId(userId);
Resource resource = iResourceService.selectResourceByUserId(userId);
return userDetail
.setAuthWay(authWay)
.setRoles(roles)
.setResource(resource)
;
}
/**
*
*
* @return
* @see PasswordLoginForm
*/
@Override
protected Class<?> getLoginFormClazz() {
return CodeLoginForm.class;
}
}

View File

@ -0,0 +1,27 @@
package com.njzscloud.common.security.module.wechat;
import com.njzscloud.common.security.contant.AuthWay;
import com.njzscloud.common.security.support.LoginForm;
import lombok.Getter;
import lombok.Setter;
/**
*
*/
@Getter
@Setter
public class WechatLoginForm extends LoginForm {
/**
*
*/
private String code;
public WechatLoginForm() {
super(AuthWay.WECHAT_MINI);
}
@Override
public String getName() {
return code;
}
}

View File

@ -0,0 +1,48 @@
package com.njzscloud.common.security.module.wechat;
import com.njzscloud.common.core.ex.ExceptionMsg;
import com.njzscloud.common.core.jackson.Jackson;
import com.njzscloud.common.security.ex.UserLoginException;
import com.njzscloud.common.security.module.password.PasswordLoginForm;
import com.njzscloud.common.security.support.LoginForm;
import com.njzscloud.common.security.support.LoginPreparer;
import org.springframework.security.web.util.matcher.AntPathRequestMatcher;
import javax.servlet.ServletInputStream;
import javax.servlet.http.HttpServletRequest;
import static com.njzscloud.common.security.contant.Constants.LOGIN_WECHAT_URL;
/**
*
*/
public class WechatLoginPreparer implements LoginPreparer {
private static final AntPathRequestMatcher matcher = new AntPathRequestMatcher(LOGIN_WECHAT_URL, "POST");
/**
*
*
* @param request
* @return {@link PasswordLoginForm}
*/
@Override
public LoginForm createLoginForm(HttpServletRequest request) {
try (ServletInputStream inputStream = request.getInputStream()) {
return Jackson.toBean(inputStream, WechatLoginForm.class);
} catch (Exception e) {
throw new UserLoginException(e, ExceptionMsg.SYS_ERR_MSG, "登录表单解析失败");
}
}
/**
*
*
* @param request
* @return POST /auth/login true
*/
@Override
public boolean support(HttpServletRequest request) {
return matcher.matches(request);
}
}

View File

@ -15,8 +15,9 @@ public enum AuditStatus implements DictStr {
QuDaiShenHe("QuDaiShenHe", "待区级审核"),
ShiDaiShenHe("ShiDaiShenHe", "待市级审核"),
TongGuo("TongGuo", "通过"),
BoHui("BoHui", "驳回"),
BoHui("BoHui", "驳回"), // 数据可改
YiCheXiao("YiCheXiao", "已撤销"),
JuShen("JuShen", "拒审"),// 数据不可改
;
private final String val;
private final String txt;

View File

@ -1,5 +1,6 @@
package com.njzscloud.supervisory.biz.constant;
import com.njzscloud.common.core.ienum.Dict;
import com.njzscloud.common.core.ienum.DictStr;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
@ -31,6 +32,54 @@ public enum BizObj implements DictStr {
private final String val;
private final String txt;
/**
*
*/
public static boolean isTrans(String bizObjStr) {
BizObj bizObj = Dict.parse(bizObjStr, BizObj.values());
return bizObj != null && bizObj.isTrans();
}
/**
*
*/
public static boolean isDriver(String bizObjStr) {
BizObj bizObj = Dict.parse(bizObjStr, BizObj.values());
return bizObj != null && bizObj.isDriver();
}
/**
*
*/
public static boolean isWaste(String bizObjStr) {
BizObj bizObj = Dict.parse(bizObjStr, BizObj.values());
return bizObj != null && (bizObj.isWastePersonal() || bizObj.isWasteCompany());
}
/**
*
*/
public static boolean isWastePersonal(String bizObjStr) {
BizObj bizObj = Dict.parse(bizObjStr, BizObj.values());
return bizObj != null && bizObj.isWastePersonal();
}
/**
*
*/
public static boolean isWasteCompany(String bizObjStr) {
BizObj bizObj = Dict.parse(bizObjStr, BizObj.values());
return bizObj != null && bizObj.isWasteCompany();
}
/**
*
*/
public static boolean isSiBang(String bizObjStr) {
BizObj bizObj = Dict.parse(bizObjStr, BizObj.values());
return bizObj != null && bizObj.isSiBang();
}
/**
*
*/
@ -38,6 +87,13 @@ public enum BizObj implements DictStr {
return this == QiYe || this == GeTi;
}
/**
*
*/
public boolean isDriver() {
return this == SiJi;
}
/**
*
*/
@ -55,6 +111,13 @@ public enum BizObj implements DictStr {
|| this == SheQu;
}
/**
*
*/
public boolean isSiBang() {
return this == SiBang;
}
/**
*
*/

View File

@ -0,0 +1,17 @@
package com.njzscloud.supervisory.config;
import com.njzscloud.common.core.http.HttpClientDecorator;
import com.njzscloud.supervisory.wechat.WechatApi;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableConfigurationProperties(WechatProperties.class)
public class WechatAutoConfiguration {
@Bean
public WechatApi wechatApi(HttpClientDecorator httpClientDecorator) {
return httpClientDecorator.decorate(WechatApi.class);
}
}

View File

@ -0,0 +1,17 @@
package com.njzscloud.supervisory.config;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.springframework.boot.context.properties.ConfigurationProperties;
@Getter
@Setter
@ToString
@Accessors(chain = true)
@ConfigurationProperties(prefix = "wechat")
public class WechatProperties {
private String appId;
private String appSecret;
}

View File

@ -1,5 +1,18 @@
package com.njzscloud.supervisory.constant;
public interface Constant {
/**
*
*/
String ROLE_SHORT_BARGE = "ROLE_SHORT_BARGE";
/**
*
*/
String ROLE_STATION_MANAGE = "ROLE_STATION_MANAGE";
/**
*
*/
String ROLE_JG = "ROLE_JG";
}

View File

@ -110,7 +110,7 @@ public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoE
}
// 播语音
// 开门
orderInfoService.updateById(new OrderInfoEntity().setId(orderInfoByLicensePlate.getId()).setOrderStatus(OrderStatus.DaiJinChang));
// orderInfoService.updateById(new OrderInfoEntity().setId(orderInfoByLicensePlate.getId()).setOrderStatus(OrderStatus.DaiJinChang));
}
break;
case Jin: {
@ -217,6 +217,15 @@ public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoE
.build())
.build();
}
CheckStatus checkStatus = orderPagingResult.getCheckStatus();
if (deviceCode == DeviceCode.ChuQianZhi && checkStatus == CheckStatus.WeiKanLiao) {
// 播语音
playVoice(sn, "{}未看料", licensePlate);
return resBuilder
.put("data", dataBuilder.put("type", 0).build())
.build();
}
if (deviceCode == DeviceCode.ChuQianZhi && orderStatus == OrderStatus.YiJinChang) {
// 开门
@ -291,16 +300,20 @@ public class DeviceInfoService extends ServiceImpl<DeviceInfoMapper, DeviceInfoE
}
if (deviceCode == DeviceCode.Chu) {
// 播语音
playVoice(sn, "{}称重完成,磅重{}吨", licensePlate, weight / 1000);
// 开门
open(sn);
orderInfoService.truckLeaving(new TruckLeavingOrderParam()
.setOrderId(orderId)
.setWeight(weight)
.setFrontPhoto(frontPhoto)
.setBodyPhoto(bodyPhoto)
);
try {
orderInfoService.truckLeaving(new TruckLeavingOrderParam()
.setOrderId(orderId)
.setWeight(weight)
.setFrontPhoto(frontPhoto)
.setBodyPhoto(bodyPhoto)
);
// 播语音
playVoice(sn, "{}称重完成,磅重{}吨", licensePlate, weight / 1000);
// 开门
open(sn);
} catch (Exception e) {
playVoice(sn, "{}称重异常,磅重{}吨", licensePlate, weight / 1000);
}
}
return resBuilder

View File

@ -11,14 +11,14 @@ import lombok.RequiredArgsConstructor;
@Getter
@RequiredArgsConstructor
public enum OrderStatus implements DictStr {
YiYuYue("YiYuYue", "已预约"),
DaiPaiDan("DaiPaiDan", "待派单"),
DaiJieDan("DaiJieDan", "待接单"),
YiJieDan("YiJieDan", "已接单"),// 接单后要审核
YiYuYue("YiYuYue", "已预约"),// 未指派清运公司
DaiPaiDan("DaiPaiDan", "待派单"), // 未指派司机
DaiJieDan("DaiJieDan", "待接单"),// 未指定车辆
YiJieDan("YiJieDan", "已接单"),// 接单后要审核,审核通过后才能开始清运
QingYunZhong("QingYunZhong", "清运中"),
DaiJinChang("DaiJinChang", "待进场"),
// DaiJinChang("DaiJinChang", "待进场"),
YiJinChang("YiJinChang", "已进场"),// 出场前要看料
DaiChuChang("DaiChuChang", "待出场"),
// DaiChuChang("DaiChuChang", "待出场"),
YiChuChang("YiChuChang", "已出场"),
YiWanCheng("YiWanCheng", "已完成"),// 最终态,完成前要支付
YiQuXiao("YiQuXiao", "已取消"),// 最终态,取消前要退款

View File

@ -0,0 +1,33 @@
package com.njzscloud.supervisory.order.contant;
public enum OrderViewType {
/**
*
*/
DaiPaiDan,
/**
*
*/
YuYue,
/**
*
*/
LiShi,
/**
*
*/
QuXiao,
/**
*
*/
ShouGong,
/**
*
*/
ShiShi,
/**
*
*/
KanLiao,
}

View File

@ -4,11 +4,8 @@ import cn.hutool.core.lang.Assert;
import com.njzscloud.common.core.utils.R;
import com.njzscloud.common.mp.support.PageParam;
import com.njzscloud.common.mp.support.PageResult;
import com.njzscloud.common.security.support.UserDetail;
import com.njzscloud.common.security.util.SecurityUtil;
import com.njzscloud.supervisory.order.contant.OrderCategory;
import com.njzscloud.supervisory.order.pojo.param.*;
import com.njzscloud.supervisory.order.pojo.result.ObtainWeighBillResult;
import com.njzscloud.supervisory.order.pojo.result.OrderCertificateResult;
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
import com.njzscloud.supervisory.order.pojo.result.TrainBillResult;
@ -18,7 +15,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import java.util.List;
import java.util.Set;
/**
*
@ -117,9 +113,7 @@ public class OrderInfoController {
*/
@GetMapping("/audit_paging")
public R<PageResult<OrderPagingResult>> auditPaging(PageParam pageParam, OrderPagingSearchParam orderPagingSearchParam) {
UserDetail userDetail = SecurityUtil.loginUser();
Set<String> roles = userDetail.getRoles();
return R.success(orderInfoService.auditPaging(pageParam, orderPagingSearchParam.setRoles(roles)));
return R.success(orderInfoService.auditPaging(pageParam, orderPagingSearchParam));
}
/**
@ -188,7 +182,7 @@ public class OrderInfoController {
*/
@GetMapping("/obtain_weigh_bill")
public R<?> obtainWeighBill(@RequestParam("orderId") Long orderId) {
ObtainWeighBillResult obtainWeighBill = orderInfoService.obtainWeighBill(orderId);
OrderPagingResult obtainWeighBill = orderInfoService.obtainWeighBill(orderId);
return R.success(obtainWeighBill);
}

View File

@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
import com.njzscloud.supervisory.order.pojo.result.ObtainWeighBillResult;
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -21,5 +20,5 @@ public interface OrderInfoMapper extends BaseMapper<OrderInfoEntity> {
OrderPagingResult pendingOrder(@Param("ew") QueryWrapper<Object> ew);
ObtainWeighBillResult obtainWeighBill(@Param("orderId") Long orderId);
OrderPagingResult obtainWeighBill(@Param("orderId") Long orderId);
}

View File

@ -32,7 +32,10 @@ public class OrderInfoEntity {
*
*/
private String contacts;
/**
* ; 0-->1-->2-->3-->
*/
private Integer autoOrder;
/**
*
*/

View File

@ -33,6 +33,7 @@ public class AddOrderInfoParam implements Constrained {
* Id; order_goods.id
*/
private Long goodsId;
private Long projectId;
/**
* Id
*/
@ -47,6 +48,15 @@ public class AddOrderInfoParam implements Constrained {
*/
private String phone;
/**
*
*/
private String expectTime;
/**
*
*/
private String estimatedQuantity;
/**
* Id
*/

View File

@ -2,21 +2,19 @@ package com.njzscloud.supervisory.order.pojo.param;
import com.njzscloud.supervisory.biz.constant.AuditStatus;
import com.njzscloud.supervisory.order.contant.CheckStatus;
import com.njzscloud.supervisory.order.contant.OrderViewType;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.time.LocalDateTime;
import java.util.Set;
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class OrderPagingSearchParam {
private Set<String> roles;
/**
* ; audit_status
*/
@ -26,6 +24,7 @@ public class OrderPagingSearchParam {
* ; order_status
*/
private String orderStatus;
private Long stationId;
private CheckStatus checkStatus;
/**
@ -49,4 +48,6 @@ public class OrderPagingSearchParam {
private String phone;
private LocalDateTime startTime;
private LocalDateTime endTime;
private OrderViewType type;
}

View File

@ -10,6 +10,15 @@ import lombok.experimental.Accessors;
@ToString
@Accessors(chain = true)
public class ObtainWeighBillResult {
/**
*
*/
private String contacts;
/**
*
*/
private String phone;
/**
*
*/

View File

@ -2,6 +2,7 @@ package com.njzscloud.supervisory.order.pojo.result;
import com.njzscloud.supervisory.biz.constant.AuditStatus;
import com.njzscloud.supervisory.biz.constant.BizObj;
import com.njzscloud.supervisory.biz.constant.TruckCategory;
import com.njzscloud.supervisory.goods.contant.MoneyStrategy;
import com.njzscloud.supervisory.order.contant.*;
import lombok.Getter;
@ -27,7 +28,7 @@ public class OrderPagingResult {
/**
*
*/
private String truckCategory;
private TruckCategory truckCategory;
/**
*
*/
@ -404,6 +405,7 @@ public class OrderPagingResult {
*
*/
private String truckLicense;
private String truckPicture;
/**
*
@ -432,7 +434,10 @@ public class OrderPagingResult {
*
*/
private String driverName;
/**
*
*/
private String drivingLicenceNo;
/**
*
*/

View File

@ -1,8 +1,10 @@
package com.njzscloud.supervisory.order.service;
import cn.hutool.core.lang.Assert;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.IService;
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.pojo.entity.BizTruckEntity;
@ -103,7 +105,9 @@ public class OrderCarInOutService extends ServiceImpl<OrderCarInOutMapper, Order
tareWeight = truckLeavingOrderParam.getWeight();
settleWeight = orderCarInOutEntity.getRoughWeight() - tareWeight;
}
Integer roughWeight_ = roughWeight;
Integer tareWeight_ = tareWeight;
Assert.isTrue(settleWeight >= 0, () -> Exceptions.exception("磅重错误,毛重:{}、皮重:{}", roughWeight_, tareWeight_));
bizTruckService.updateById(new BizTruckEntity()
.setId(truckId)
.setTareWeight(settleWeight));

View File

@ -24,6 +24,7 @@ import com.njzscloud.supervisory.biz.constant.AuditStatus;
import com.njzscloud.supervisory.biz.constant.BizObj;
import com.njzscloud.supervisory.biz.pojo.entity.BizAuditConfigEntity;
import com.njzscloud.supervisory.biz.service.BizAuditConfigService;
import com.njzscloud.supervisory.constant.Constant;
import com.njzscloud.supervisory.order.contant.CheckStatus;
import com.njzscloud.supervisory.order.contant.OrderCategory;
import com.njzscloud.supervisory.order.contant.OrderStatus;
@ -31,7 +32,6 @@ import com.njzscloud.supervisory.order.mapper.OrderInfoMapper;
import com.njzscloud.supervisory.order.pojo.entity.OrderGoodsEntity;
import com.njzscloud.supervisory.order.pojo.entity.OrderInfoEntity;
import com.njzscloud.supervisory.order.pojo.param.*;
import com.njzscloud.supervisory.order.pojo.result.ObtainWeighBillResult;
import com.njzscloud.supervisory.order.pojo.result.OrderCertificateResult;
import com.njzscloud.supervisory.order.pojo.result.OrderPagingResult;
import com.njzscloud.supervisory.order.pojo.result.TrainBillResult;
@ -47,6 +47,8 @@ import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import static com.njzscloud.supervisory.constant.Constant.ROLE_JG;
/**
*
*/
@ -140,13 +142,6 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
*
*/
public PageResult<OrderPagingResult> paging(PageParam pageParam, OrderPagingSearchParam orderPagingSearchParam) {
AuditStatus auditStatus = orderPagingSearchParam.getAuditStatus();
String orderStatus = orderPagingSearchParam.getOrderStatus();
List<String> orderStatusList = null;
if (StrUtil.isNotBlank(orderStatus)) {
orderStatusList = Arrays.stream(orderStatus.split(",")).collect(Collectors.toList());
}
CheckStatus checkStatus = orderPagingSearchParam.getCheckStatus();
String sn = orderPagingSearchParam.getSn();
String licensePlate = orderPagingSearchParam.getLicensePlate();
String nickname = orderPagingSearchParam.getNickname();
@ -154,39 +149,221 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
LocalDateTime startTime = orderPagingSearchParam.getStartTime();
LocalDateTime endTime = orderPagingSearchParam.getEndTime();
Page<OrderPagingResult> page = pageParam.toPage();
OrderItem orderItem = new OrderItem();
orderItem.setColumn("a.create_time");
orderItem.setAsc(false);
page.addOrder(orderItem);
page.addOrder(OrderItem.asc("a.create_time"));
QueryWrapper<OrderPagingResult> ew = Wrappers.<OrderPagingResult>query()
.like(StrUtil.isNotBlank(sn), "a.sn", sn)
.like(StrUtil.isNotBlank(licensePlate), "a.license_plate", licensePlate)
.like(StrUtil.isNotBlank(nickname), "h.nickname", nickname)
.like(StrUtil.isNotBlank(phone), "h.phone", phone)
.eq(auditStatus != null, "a.audit_status", auditStatus)
.in(CollUtil.isNotEmpty(orderStatusList), "a.order_status", orderStatusList)
.eq(checkStatus != null, "a.check_status", checkStatus)
.ge(startTime != null, "a.create_time", startTime)
.le(endTime != null, "a.create_time", endTime);
UserDetail userDetail = SecurityUtil.loginUser();
BizObj parse = Dict.parse(userDetail.getBizObj(), BizObj.values());
if (parse == BizObj.GeRen
|| parse == BizObj.WuYe
|| parse == BizObj.ShiGongDanWei
|| parse == BizObj.ChaiQian
|| parse == BizObj.SheQu
) {
ew.eq("a.user_id", userDetail.getUserId());
} else if (parse == BizObj.QiYe
|| parse == BizObj.GeTi
) {
ew.eq("g.user_id", userDetail.getUserId());
switch (orderPagingSearchParam.getType()) {
case DaiPaiDan:
dispatchEW(orderPagingSearchParam, ew);
break;
case YuYue:
bookingEW(orderPagingSearchParam, ew);
break;
case LiShi:
historyEW(orderPagingSearchParam, ew);
break;
case QuXiao:
cancelEW(orderPagingSearchParam, ew);
break;
case ShouGong:
autoEW(orderPagingSearchParam, ew);
break;
case ShiShi:
realtimeEW(orderPagingSearchParam, ew);
break;
case KanLiao:
checkEW(orderPagingSearchParam, ew);
break;
}
return PageResult.of(baseMapper.paging(page, ew));
}
private void dispatchEW(OrderPagingSearchParam orderPagingSearchParam, QueryWrapper<OrderPagingResult> ew) {
UserDetail userDetail = SecurityUtil.loginUser();
Long userId = SecurityUtil.currentUserId();
String bizObjStr = userDetail.getBizObj();
if (BizObj.isTrans(bizObjStr)) {
ew
.in("a.order_status", OrderStatus.DaiPaiDan, OrderStatus.DaiJieDan)
.eq("g.user_id", userId);
return;
}
if (BizObj.isDriver(bizObjStr)) {
ew
.eq("a.order_status", OrderStatus.DaiJieDan)
.eq("a.driver_id", userId);
return;
}
Set<String> roles = userDetail.getRoles();
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
ew
.eq("a.station_id", orderPagingSearchParam.getStationId())
.eq("a.order_status", OrderStatus.YiYuYue)
.isNull("a.trans_company_id ")
;
return;
}
}
private void bookingEW(OrderPagingSearchParam orderPagingSearchParam, QueryWrapper<OrderPagingResult> ew) {
UserDetail userDetail = SecurityUtil.loginUser();
Long userId = SecurityUtil.currentUserId();
String bizObjStr = userDetail.getBizObj();
if (BizObj.isWaste(bizObjStr)) {
ew
.in("a.order_status", OrderStatus.YiYuYue, OrderStatus.DaiPaiDan, OrderStatus.DaiJieDan, OrderStatus.YiJieDan)
.eq("a.user_id", userId)
;
return;
}
Set<String> roles = userDetail.getRoles();
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
ew
.eq("a.station_id", orderPagingSearchParam.getStationId())
.in("a.order_status", OrderStatus.DaiPaiDan, OrderStatus.DaiJieDan, OrderStatus.YiJieDan)
;
return;
}
}
private void realtimeEW(OrderPagingSearchParam orderPagingSearchParam, QueryWrapper<OrderPagingResult> ew) {
UserDetail userDetail = SecurityUtil.loginUser();
Long userId = SecurityUtil.currentUserId();
String bizObjStr = userDetail.getBizObj();
if (BizObj.isWaste(bizObjStr)) {
ew
.in("a.order_status", OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang)
.eq("a.user_id", userId)
;
return;
}
if (BizObj.isTrans(bizObjStr)) {
ew
.in("a.order_status", OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang)
.eq("g.user_id", userId)
;
return;
}
if (BizObj.isDriver(bizObjStr)) {
ew
.in("a.order_status", OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang)
.eq("a.driver_id", userId)
;
return;
}
Set<String> roles = userDetail.getRoles();
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
ew
.eq("a.station_id", orderPagingSearchParam.getStationId())
.in("a.order_status", OrderStatus.QingYunZhong, OrderStatus.YiJinChang, OrderStatus.YiChuChang)
;
return;
}
}
private void historyEW(OrderPagingSearchParam orderPagingSearchParam, QueryWrapper<OrderPagingResult> ew) {
UserDetail userDetail = SecurityUtil.loginUser();
Long userId = SecurityUtil.currentUserId();
String bizObjStr = userDetail.getBizObj();
if (BizObj.isWaste(bizObjStr)) {
ew
.eq("a.order_status", OrderStatus.YiWanCheng)
.eq("a.user_id", userId)
;
return;
}
if (BizObj.isTrans(bizObjStr)) {
ew
.eq("a.order_status", OrderStatus.YiWanCheng)
.eq("g.user_id", userId)
;
return;
}
if (BizObj.isDriver(bizObjStr)) {
ew
.eq("a.order_status", OrderStatus.YiWanCheng)
.eq("a.driver_id", userId)
;
return;
}
Set<String> roles = userDetail.getRoles();
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
ew
.eq("a.station_id", orderPagingSearchParam.getStationId())
.eq("a.order_status", OrderStatus.YiWanCheng)
;
return;
}
}
private void cancelEW(OrderPagingSearchParam orderPagingSearchParam, QueryWrapper<OrderPagingResult> ew) {
UserDetail userDetail = SecurityUtil.loginUser();
Long userId = SecurityUtil.currentUserId();
String bizObjStr = userDetail.getBizObj();
if (BizObj.isWaste(bizObjStr)) {
ew
.eq("a.order_status", OrderStatus.YiQuXiao)
.eq("a.user_id", userId)
;
return;
}
Set<String> roles = userDetail.getRoles();
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
ew
.eq("a.station_id", orderPagingSearchParam.getStationId())
.eq("a.order_status", OrderStatus.YiQuXiao)
;
return;
}
}
private void autoEW(OrderPagingSearchParam orderPagingSearchParam, QueryWrapper<OrderPagingResult> ew) {
UserDetail userDetail = SecurityUtil.loginUser();
Set<String> roles = userDetail.getRoles();
if (SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE)) {
ew
.eq("a.station_id", orderPagingSearchParam.getStationId())
.ne("a.auto_order", 3)
;
return;
}
}
private void checkEW(OrderPagingSearchParam orderPagingSearchParam, QueryWrapper<OrderPagingResult> ew) {
UserDetail userDetail = SecurityUtil.loginUser();
String bizObjStr = userDetail.getBizObj();
if (BizObj.isSiBang(bizObjStr)) {
CheckStatus checkStatus = orderPagingSearchParam.getCheckStatus();
String orderStatus = orderPagingSearchParam.getOrderStatus();
Assert.isTrue(checkStatus != null || orderStatus != null, () -> Exceptions.clierr("未指定订单状态或勘料状态"));
ew
.eq("a.station_id", orderPagingSearchParam.getStationId())
.eq(checkStatus != null, "a.check_status", checkStatus)
.ne(orderStatus != null, "a.order_status", orderStatus)
;
return;
}
}
public PageResult<OrderPagingResult> auditPaging(PageParam pageParam, OrderPagingSearchParam orderPagingSearchParam) {
Set<String> roles = orderPagingSearchParam.getRoles();
UserDetail userDetail = SecurityUtil.loginUser();
Set<String> roles = userDetail.getRoles();
Assert.isTrue(CollUtil.isNotEmpty(roles) && roles.contains(ROLE_JG), () -> Exceptions.clierr("非监管角色,不能查看"));
List<String> areas = bizAuditConfigService.list(Wrappers.<BizAuditConfigEntity>query()
.select("DISTINCT area")
.in("area_role", roles)
@ -194,8 +371,10 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
.or(it -> it.isNull("area_role")
.isNull("city_role"))
).stream().map(BizAuditConfigEntity::getArea).collect(Collectors.toList());
Page<OrderPagingResult> page = pageParam.toPage();
page.addOrder(OrderItem.desc("a.create_time"));
if (CollUtil.isEmpty(areas)) {
return PageResult.of(pageParam.toPage());
return PageResult.of(page);
}
QueryWrapper<OrderPagingResult> ew = Wrappers.<OrderPagingResult>query()
.in("b.area", areas);
@ -210,7 +389,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
}
}
return PageResult.of(baseMapper.paging(pageParam.toPage(), ew));
return PageResult.of(baseMapper.paging(page, ew));
}
public void audit(AuditOrderParam auditOrderParam) {
@ -218,7 +397,8 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
Assert.notNull(detail, () -> Exceptions.clierr("订单不存在"));
AuditStatus auditStatus = detail.getAuditStatus();
Assert.isTrue(auditStatus == AuditStatus.QuDaiShenHe
|| auditStatus == AuditStatus.ShiDaiShenHe,
|| auditStatus == AuditStatus.ShiDaiShenHe
|| auditStatus == AuditStatus.DaiShenHe,
() -> Exceptions.clierr("订单已审核"));
AuditStatus newAuditStatus = auditOrderParam.getAuditStatus();
@ -234,18 +414,27 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
throw Exceptions.clierr("您没有权限审核该订单");
}
Long quAuditUserId = null;
Long shiAuditUserId = null;
if (auditStatus == AuditStatus.QuDaiShenHe) {
if (StrUtil.isNotBlank(areaRole) && roles.contains(areaRole)) {
quAuditUserId = SecurityUtil.currentUserId();
auditStatus = newAuditStatus == AuditStatus.TongGuo ? AuditStatus.ShiDaiShenHe : newAuditStatus;
} else {
throw Exceptions.clierr("您没有权限审核该订单");
}
} else {
} else if (auditStatus == AuditStatus.ShiDaiShenHe) {
if (StrUtil.isNotBlank(cityRole) && roles.contains(cityRole)) {
shiAuditUserId = SecurityUtil.currentUserId();
auditStatus = newAuditStatus;
} else {
throw Exceptions.clierr("您没有权限审核该订单");
}
} else if (auditStatus == AuditStatus.DaiShenHe) {
quAuditUserId = SecurityUtil.currentUserId();
shiAuditUserId = SecurityUtil.currentUserId();
auditStatus = newAuditStatus;
}
detail.setAuditStatus(newAuditStatus);
@ -253,6 +442,9 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
this.updateById(new OrderInfoEntity()
.setId(detail.getId())
.setAuditStatus(auditStatus)
.setQuAuditUserId(quAuditUserId)
.setShiAuditUserId(shiAuditUserId)
.setAuditTime(LocalDateTime.now())
.setAuditMemo(auditOrderParam.getAuditMemo())
);
}
@ -315,6 +507,9 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
OrderInfoEntity orderInfo = this.getById(orderId);
Assert.notNull(orderInfo, () -> Exceptions.clierr("订单不存在"));
Assert.isTrue(orderInfo.getOrderStatus() == OrderStatus.DaiJieDan, () -> Exceptions.clierr("当前订单状态,无法确认接单"));
long driverId = orderInfo.getDriverId();
long userId = SecurityUtil.currentUserId();
Assert.isTrue(driverId == userId, () -> Exceptions.clierr("您没有权限确认此单"));
this.updateById(new OrderInfoEntity()
.setId(orderInfo.getId())
.setTruckId(truckId)
@ -361,6 +556,17 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
&& orderStatus != OrderStatus.YiWanCheng
&& orderStatus != OrderStatus.YiQuXiao
, () -> Exceptions.clierr("当前订单状态,无法修改商品"));
Long targetOrderId = orderInfoEntity.getTargetOrderId();
if (targetOrderId != null) {
OrderInfoEntity targetOrderInfo = this.getById(targetOrderId);
Assert.notNull(targetOrderInfo, () -> Exceptions.clierr("关联订单不存在"));
orderGoodsService.modify(new OrderGoodsEntity()
.setId(targetOrderInfo.getGoodsId())
.setGoodsCategoryId(modifyOrderGoodsParam.getGoodsCategoryId())
.setOriginGoodsId(modifyOrderGoodsParam.getOriginGoodsId())
);
}
orderGoodsService.modify(new OrderGoodsEntity()
.setId(orderInfoEntity.getGoodsId())
.setGoodsCategoryId(modifyOrderGoodsParam.getGoodsCategoryId())
@ -434,11 +640,10 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
LocalDateTime startTime = orderPagingSearchParam.getStartTime();
LocalDateTime endTime = orderPagingSearchParam.getEndTime();
Page<OrderPagingResult> page = pageParam.toPage();
OrderItem orderItem = new OrderItem();
orderItem.setColumn("a.create_time");
orderItem.setAsc(false);
page.addOrder(orderItem);
page.addOrder(OrderItem.desc("a.create_time"));
Long stationId = orderPagingSearchParam.getStationId();
QueryWrapper<OrderPagingResult> ew = Wrappers.<OrderPagingResult>query()
.eq(stationId != null, " a.station_id", stationId)
.like(StrUtil.isNotBlank(sn), "a.sn", sn)
.like(StrUtil.isNotBlank(licensePlate), "a.license_plate", licensePlate)
.like(StrUtil.isNotBlank(nickname), "h.nickname", nickname)
@ -451,14 +656,14 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
UserDetail userDetail = SecurityUtil.loginUser();
BizObj bizObj = Dict.parse(userDetail.getBizObj(), BizObj.values());
if (bizObj != null) {
switch (bizObj) {
case QiYe:
case GeTi:
ew.eq("a.order_status", OrderStatus.DaiPaiDan)
.isNotNull("a.trans_company_id");
break;
default:
ew.isNull("a.trans_company_id");
if (bizObj.isTrans()) {
ew.eq("a.order_status", OrderStatus.DaiPaiDan)
.isNotNull("a.trans_company_id");
} else if (bizObj.isWaste()) {
ew.eq("a.order_status", OrderStatus.DaiPaiDan)
.isNull("a.user_id");
} else {
ew.isNull("a.trans_company_id");
}
} else {
ew.isNull("a.trans_company_id");
@ -487,7 +692,7 @@ public class OrderInfoService extends ServiceImpl<OrderInfoMapper, OrderInfoEnti
.setCertificateQrcode(qrcode);
}
public ObtainWeighBillResult obtainWeighBill(Long orderId) {
public OrderPagingResult obtainWeighBill(Long orderId) {
return baseMapper.obtainWeighBill(orderId);
}

View File

@ -0,0 +1,89 @@
package com.njzscloud.supervisory.station.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.station.pojo.entity.StationManageEntity;
import com.njzscloud.supervisory.station.pojo.param.AddStationManageParam;
import com.njzscloud.supervisory.station.pojo.param.SearchStationManageParam;
import com.njzscloud.supervisory.station.pojo.result.ListManagerResult;
import com.njzscloud.supervisory.station.pojo.result.SearchStationManageResult;
import com.njzscloud.supervisory.station.service.StationManageService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
*
*/
@Slf4j
@RestController
@RequestMapping("/station_manage")
@RequiredArgsConstructor
public class StationManageController {
private final StationManageService stationManageService;
/**
*
*/
@PostMapping("/add")
public R<?> add(@RequestBody AddStationManageParam addStationManageParam) {
stationManageService.add(addStationManageParam);
return R.success();
}
/**
*
*/
@PostMapping("/modify")
public R<?> modify(@RequestBody StationManageEntity stationManageEntity) {
stationManageService.modify(stationManageEntity);
return R.success();
}
/**
*
*/
@PostMapping("/del")
public R<?> del(@RequestBody List<Long> ids) {
stationManageService.del(ids);
return R.success();
}
/**
*
*/
@GetMapping("/detail")
public R<StationManageEntity> detail(@RequestParam Long id) {
return R.success(stationManageService.detail(id));
}
/**
*
*/
@GetMapping("/list_manager")
public R<ListManagerResult> listManager(SearchStationManageParam searchStationManageParam) {
return R.success(stationManageService.listManager(searchStationManageParam));
}
/**
*
*/
@GetMapping("/my_station")
public R<List<SearchStationManageResult>> myStation() {
return R.success(stationManageService.myStation());
}
/**
*
*/
@GetMapping("/paging")
public R<PageResult<SearchStationManageResult>> paging(PageParam pageParam, SearchStationManageParam searchStationManageParam) {
return R.success(stationManageService.paging(pageParam, searchStationManageParam));
}
}

View File

@ -0,0 +1,28 @@
package com.njzscloud.supervisory.station.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.njzscloud.supervisory.station.pojo.entity.StationManageEntity;
import com.njzscloud.supervisory.station.pojo.param.SearchStationManageParam;
import com.njzscloud.supervisory.station.pojo.result.SearchStationManageResult;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
*/
@Mapper
public interface StationManageMapper extends BaseMapper<StationManageEntity> {
IPage<SearchStationManageResult> paging(Page<Object> page, @Param("ew") QueryWrapper<SearchStationManageParam> ew);
List<SearchStationManageResult> myStation(@Param("ew") QueryWrapper<Object> ew);
List<SearchStationManageResult> listManager(@Param("ew") QueryWrapper<Object> ew);
List<Long> myManage(@Param("ew") QueryWrapper<Object> ew);
}

View File

@ -0,0 +1,42 @@
package com.njzscloud.supervisory.station.pojo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
/**
*
*/
@Getter
@Setter
@ToString
@Accessors(chain = true)
@TableName("station_manage")
public class StationManageEntity {
/**
* Id
*/
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* Id
*/
private Long stationId;
/**
* Id
*/
private Long userId;
/**
* ; 0-->1-->
*/
private Boolean canuse;
}

View File

@ -0,0 +1,29 @@
package com.njzscloud.supervisory.station.pojo.param;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import java.util.Set;
/**
*
*/
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class AddStationManageParam {
/**
* Id
*/
private Long stationId;
/**
* Ids
*/
private Set<Long> userIds;
}

View File

@ -0,0 +1,33 @@
package com.njzscloud.supervisory.station.pojo.param;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
/**
*
*/
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class SearchStationManageParam {
/**
* Id
*/
private Long stationId;
/**
* Id
*/
private Long userId;
/**
*
*/
private String nickname;
/**
*
*/
private String stationName;
}

View File

@ -0,0 +1,17 @@
package com.njzscloud.supervisory.station.pojo.result;
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 ListManagerResult {
private List<SearchStationManageResult> recodes;
private List<Long> managerIds;
}

View File

@ -0,0 +1,54 @@
package com.njzscloud.supervisory.station.pojo.result;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
/**
*
*/
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class SearchStationManageResult {
/**
* Id
*/
private Long stationId;
/**
* Id
*/
private Long userId;
/**
*
*/
private String nickname;
/**
*
*/
private String stationName;
private String userPhone;
private String uscc;
private String companyName;
private String businessLicense;
private String licenseStartTime;
private String licenseEndTime;
private String legalRepresentative;
private String province;
private String city;
private String area;
private String town;
private String provinceName;
private String cityName;
private String areaName;
private String townName;
private String address;
private String lng;
private String lat;
private String contacts;
private String phone;
}

View File

@ -0,0 +1,124 @@
package com.njzscloud.supervisory.station.service;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.IService;
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.common.security.support.UserDetail;
import com.njzscloud.common.security.util.SecurityUtil;
import com.njzscloud.supervisory.biz.pojo.entity.BizCompanyEntity;
import com.njzscloud.supervisory.biz.service.BizCompanyService;
import com.njzscloud.supervisory.constant.Constant;
import com.njzscloud.supervisory.station.mapper.StationManageMapper;
import com.njzscloud.supervisory.station.pojo.entity.StationManageEntity;
import com.njzscloud.supervisory.station.pojo.param.AddStationManageParam;
import com.njzscloud.supervisory.station.pojo.param.SearchStationManageParam;
import com.njzscloud.supervisory.station.pojo.result.ListManagerResult;
import com.njzscloud.supervisory.station.pojo.result.SearchStationManageResult;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
*
*/
@Slf4j
@Service
@RequiredArgsConstructor
public class StationManageService extends ServiceImpl<StationManageMapper, StationManageEntity> implements IService<StationManageEntity> {
private final BizCompanyService bizCompanyService;
/**
*
*/
@Transactional(rollbackFor = Exception.class)
public void add(AddStationManageParam addStationManageParam) {
Long stationId = addStationManageParam.getStationId();
boolean exists = bizCompanyService.exists(Wrappers.lambdaQuery(BizCompanyEntity.class).eq(BizCompanyEntity::getId, stationId).eq(BizCompanyEntity::getStation, Boolean.TRUE));
Assert.isTrue(exists, () -> Exceptions.clierr("站点不存在"));
Set<Long> userIds = addStationManageParam.getUserIds();
Assert.notEmpty(userIds, () -> Exceptions.clierr("未指定用户"));
List<StationManageEntity> collect = userIds.stream().map(it -> new StationManageEntity().setStationId(stationId).setUserId(it)
.setCanuse(Boolean.TRUE)).collect(Collectors.toList());
this.remove(Wrappers.lambdaQuery(StationManageEntity.class).eq(StationManageEntity::getStationId, stationId));
this.saveBatch(collect);
}
/**
*
*/
public void modify(StationManageEntity stationManageEntity) {
this.updateById(stationManageEntity);
}
/**
*
*/
@Transactional(rollbackFor = Exception.class)
public void del(List<Long> ids) {
this.removeBatchByIds(ids);
}
/**
*
*/
public StationManageEntity detail(Long id) {
return this.getById(id);
}
/**
*
*/
public PageResult<SearchStationManageResult> paging(PageParam pageParam, SearchStationManageParam searchStationManageParam) {
Long userId = searchStationManageParam.getUserId();
String nickname = searchStationManageParam.getNickname();
Long stationId = searchStationManageParam.getStationId();
String stationName = searchStationManageParam.getStationName();
return PageResult.of(baseMapper.paging(pageParam.toPage(), Wrappers.<SearchStationManageParam>query()
.eq(userId != null, "a.user_id", userId)
.eq(stationId != null, "a.station_id", stationId)
.like(StrUtil.isNotBlank(stationName), "b.company_name", stationName)
.like(StrUtil.isNotBlank(nickname), "c.nickname", nickname)
));
}
public List<SearchStationManageResult> myStation() {
UserDetail userDetail = SecurityUtil.loginUser();
Set<String> roles = userDetail.getRoles();
Assert.isTrue(SecurityUtil.isAdmin() || roles.contains(Constant.ROLE_STATION_MANAGE), () -> Exceptions.clierr("当前用户无权限查询站点"));
Long userId = null;
if (!SecurityUtil.isAdmin()) {
userId = userDetail.getUserId();
}
return baseMapper.myStation(Wrappers.query().eq(userId != null, "a.user_id", userId));
}
public ListManagerResult listManager(SearchStationManageParam searchStationManageParam) {
String nickname = searchStationManageParam.getNickname();
Long stationId = searchStationManageParam.getStationId();
List<SearchStationManageResult> records = baseMapper.listManager(Wrappers.query()
.like(StrUtil.isNotBlank(nickname), "b.nickname", nickname)
.eq("c.role_code", Constant.ROLE_STATION_MANAGE)
);
List<Long> myManage;
if (CollUtil.isNotEmpty(records)) {
Set<Long> userIds = records.stream().map(SearchStationManageResult::getUserId).collect(Collectors.toSet());
myManage = baseMapper.myManage(Wrappers.query().in("a.user_id", userIds).eq("a.station_id", stationId));
} else {
myManage = Collections.emptyList();
}
return new ListManagerResult().setRecodes(records).setManagerIds(myManage);
}
}

View File

@ -12,6 +12,7 @@ import lombok.experimental.Accessors;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Getter
@Setter
@ -19,6 +20,7 @@ import java.util.Map;
@Accessors(chain = true)
public class MyResult {
private List<MenuResource> menus;
private Set<String> roles;
private List<EndpointResource> endpoints;

View File

@ -31,8 +31,9 @@ public class AuthService implements IUserService, IResourceService, IRoleService
return authMapper.selectUser(Wrappers.query().eq("a.username", account).eq("a.deleted", 0));
case PHONE:
return authMapper.selectUser(Wrappers.query().eq("a.phone", account).eq("a.deleted", 0));
case WECHAT:
case WECHAT_MINI:
return authMapper.selectUser(Wrappers.query().eq("a.wechat_openid", account).eq("a.deleted", 0));
case WECHAT:
default:
return null;
}
@ -61,8 +62,12 @@ public class AuthService implements IUserService, IResourceService, IRoleService
List<MenuResource> menuResources = authMapper.selectUserMenu(userId);
List<EndpointResource> endpointResources = authMapper.selectUserEndpoint(userId);
SearchCompanyResult company = authMapper.selectCompanyInfo(userId);
return BeanUtil.copyProperties(userEntity, MyResult.class).setMenus(menuResources).setEndpoints(endpointResources).setCompany(company);
Set<String> strings = authMapper.selectRoleByUserId(userId);
return BeanUtil.copyProperties(userEntity, MyResult.class)
.setRoles(strings)
.setMenus(menuResources)
.setEndpoints(endpointResources)
.setCompany(company);
}
}

View File

@ -10,6 +10,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njzscloud.common.core.ex.Exceptions;
import com.njzscloud.common.mp.support.PageResult;
import com.njzscloud.supervisory.constant.Constant;
import com.njzscloud.supervisory.sys.role.mapper.RoleMapper;
import com.njzscloud.supervisory.sys.role.pojo.entity.RoleEntity;
import com.njzscloud.supervisory.sys.role.pojo.entity.RoleResourceEntity;
@ -79,7 +80,15 @@ public class RoleService extends ServiceImpl<RoleMapper, RoleEntity> implements
public void del(List<Long> ids) {
Assert.notEmpty(ids, () -> Exceptions.clierr("未指定要删除的数据"));
List<RoleEntity> list = this.listByIds(ids);
Assert.isFalse(list.stream().anyMatch(it -> it.getRoleCode().equals(ROLE_ADMIN)), () -> Exceptions.exception("管理员角色不允许删除"));
Assert.isFalse(list.stream().anyMatch(it -> {
String roleCode = it.getRoleCode();
return roleCode.equals(ROLE_ADMIN)
|| roleCode.equals(Constant.ROLE_SHORT_BARGE)
|| roleCode.equals(Constant.ROLE_STATION_MANAGE)
|| roleCode.equals(Constant.ROLE_JG)
;
}
), () -> Exceptions.exception("管理员角色不允许删除"));
this.removeBatchByIds(ids);
roleResService.remove(Wrappers.<RoleResourceEntity>lambdaQuery().in(RoleResourceEntity::getRoleId, ids));
}

View File

@ -34,17 +34,17 @@ public class UserAccountService extends ServiceImpl<UserAccountMapper, UserAccou
String email = addUserAccountParam.getEmail();
String phone = addUserAccountParam.getPhone();
String wechatOpenid = addUserAccountParam.getWechatOpenid();
String wechatUnionid = addUserAccountParam.getWechatUnionid();
// String wechatUnionid = addUserAccountParam.getWechatUnionid();
List<UserAccountEntity> oldSysUserList = this.list(Wrappers.<UserAccountEntity>lambdaQuery()
.eq(StrUtil.isNotBlank(username), UserAccountEntity::getUsername, username)
.or().eq(StrUtil.isNotBlank(email), UserAccountEntity::getEmail, email)
.or().eq(StrUtil.isNotBlank(phone), UserAccountEntity::getPhone, phone)
.or(StrUtil.isNotBlank(wechatOpenid) && StrUtil.isNotBlank(wechatUnionid), it -> it.eq(UserAccountEntity::getWechatOpenid, wechatOpenid).eq(UserAccountEntity::getWechatUnionid, wechatUnionid))
// .or().eq(StrUtil.isNotBlank(email), UserAccountEntity::getEmail, email)
// .or().eq(StrUtil.isNotBlank(phone), UserAccountEntity::getPhone, phone)
.or(StrUtil.isNotBlank(wechatOpenid) /* && StrUtil.isNotBlank(wechatUnionid) */, it -> it.eq(UserAccountEntity::getWechatOpenid, wechatOpenid))
);
Assert.isTrue(oldSysUserList.stream().noneMatch(it -> username.equals(it.getUsername())), () -> Exceptions.exception("用户名【{}】已被使用", username));
Assert.isTrue(StrUtil.isBlank(email) || oldSysUserList.stream().noneMatch(it -> email.equals(it.getEmail())), () -> Exceptions.exception("邮箱【{}】已被使用", email));
Assert.isTrue(StrUtil.isBlank(phone) || oldSysUserList.stream().noneMatch(it -> phone.equals(it.getPhone())), () -> Exceptions.exception("手机号【{}】已被使用", phone));
Assert.isTrue(StrUtil.isBlank(wechatOpenid) || StrUtil.isBlank(wechatUnionid) || oldSysUserList.stream().noneMatch(it -> wechatOpenid.equals(it.getWechatOpenid()) && wechatUnionid.equals(it.getWechatUnionid())), () -> Exceptions.exception("该微信账号已被使用"));
Assert.isTrue(StrUtil.isBlank(wechatOpenid) /* || StrUtil.isBlank(wechatUnionid) */ || oldSysUserList.stream().noneMatch(it -> wechatOpenid.equals(it.getWechatOpenid())), () -> Exceptions.exception("该微信账号已被使用"));
UserAccountEntity userAccountEntity = BeanUtil.copyProperties(addUserAccountParam, UserAccountEntity.class)
.setSecret(EncryptUtil.encrypt(addUserAccountParam.getSecret()))

View File

@ -11,7 +11,6 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njzscloud.common.core.ex.Exceptions;
import com.njzscloud.common.mp.support.PageResult;
import com.njzscloud.common.security.contant.AuthWay;
import com.njzscloud.common.security.util.EncryptUtil;
import com.njzscloud.common.security.util.SecurityUtil;
import com.njzscloud.supervisory.biz.constant.BizObj;
import com.njzscloud.supervisory.biz.pojo.param.AddBizCompanyParam;
@ -25,6 +24,9 @@ import com.njzscloud.supervisory.sys.user.pojo.entity.UserEntity;
import com.njzscloud.supervisory.sys.user.pojo.param.*;
import com.njzscloud.supervisory.sys.user.pojo.result.UserAccountDetailResult;
import com.njzscloud.supervisory.sys.user.pojo.result.UserDetailResult;
import com.njzscloud.supervisory.wechat.WechatUtil;
import com.njzscloud.supervisory.wechat.param.Code2SessionParam;
import com.njzscloud.supervisory.wechat.result.Code2SessionResult;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -145,18 +147,32 @@ public class UserService extends ServiceImpl<UserMapper, UserEntity> implements
BizObj bizObj = userRegisterParam.getBizObj();
if (bizObj == BizObj.GeRen) {
String codeId = userRegisterParam.getAccount().getCodeId();
String code = userRegisterParam.getAccount().getCode();
Assert.isTrue(EncryptUtil.checkCode(codeId, code), () -> Exceptions.clierr("验证码错误"));
String phone = userRegisterParam.getAccount().getPhone();
UserAccountEntity one = userAccountService.getOne(Wrappers.<UserAccountEntity>lambdaQuery().eq(UserAccountEntity::getPhone, phone));
Code2SessionResult code2SessionResult = WechatUtil.code2Session(new Code2SessionParam().setJs_code(code));
String openid = code2SessionResult.getOpenid();
Assert.notBlank(openid, () -> Exceptions.error("微信登录失败"));
// String unionid = code2SessionResult.getUnionid();
UserAccountEntity one = userAccountService.getOne(Wrappers.<UserAccountEntity>lambdaQuery()
// .eq(UserAccountEntity::getPhone, phone)
// .eq(UserAccountEntity::getWechatUnionid, unionid)
.eq(UserAccountEntity::getWechatOpenid, openid)
);
if (one != null) {
return SecurityUtil.registrationToken(phone, AuthWay.PHONE);
String phone1 = one.getPhone();
if (phone.equals(phone1)) {
return SecurityUtil.registrationToken(openid, AuthWay.WECHAT_MINI);
} else {
throw Exceptions.clierr("手机号错误");
}
} else {
AddUserParam addUserParam = BeanUtil.copyProperties(userRegisterParam, AddUserParam.class);
addUserParam.setAccount(BeanUtil.copyProperties(userRegisterParam.getAccount(), AddUserAccountParam.class));
addUserParam.setAccount(BeanUtil.copyProperties(userRegisterParam.getAccount(), AddUserAccountParam.class)
.setWechatOpenid(openid)
// .setWechatUnionid(unionid)
);
this.add(addUserParam);
return SecurityUtil.registrationToken(phone, AuthWay.PHONE);
return SecurityUtil.registrationToken(openid, AuthWay.WECHAT_MINI);
}
}

View File

@ -0,0 +1,25 @@
package com.njzscloud.supervisory.wechat;
import com.njzscloud.common.core.http.annotation.GetEndpoint;
import com.njzscloud.common.core.http.annotation.QueryParam;
import com.njzscloud.common.core.http.annotation.RemoteServer;
import com.njzscloud.supervisory.wechat.param.Code2SessionParam;
import com.njzscloud.supervisory.wechat.param.GetAccessTokenParam;
import com.njzscloud.supervisory.wechat.result.Code2SessionResult;
import com.njzscloud.supervisory.wechat.result.GetAccessTokenResult;
@RemoteServer(value = "https://api.weixin.qq.com")
public interface WechatApi {
/**
* access_token
*/
@GetEndpoint("/cgi-bin/token")
GetAccessTokenResult getAccessToken(@QueryParam GetAccessTokenParam getAccessTokenParam);
/**
*
*/
@GetEndpoint("/sns/jscode2session")
Code2SessionResult code2Session(@QueryParam Code2SessionParam code2SessionParam);
}

View File

@ -0,0 +1,34 @@
package com.njzscloud.supervisory.wechat;
import cn.hutool.core.lang.Assert;
import cn.hutool.extra.spring.SpringUtil;
import com.njzscloud.common.core.ex.Exceptions;
import com.njzscloud.supervisory.wechat.param.Code2SessionParam;
import com.njzscloud.supervisory.wechat.param.GetAccessTokenParam;
import com.njzscloud.supervisory.wechat.result.Code2SessionResult;
import com.njzscloud.supervisory.wechat.result.GetAccessTokenResult;
import java.util.Date;
public class WechatUtil {
private static final WechatApi API = SpringUtil.getBean(WechatApi.class);
private static String accessToken = "";
private static long tokenExpTime = 0;
public static Code2SessionResult code2Session(Code2SessionParam param) {
auth();
return API.code2Session(param.setAccess_token(accessToken));
}
private static void auth() {
if (tokenExpTime <= new Date().getTime() / 1000 + 60) {
GetAccessTokenResult getAccessTokenResult = API.getAccessToken(new GetAccessTokenParam());
accessToken = getAccessTokenResult.getAccess_token();
Integer expiresIn = getAccessTokenResult.getExpires_in();
Assert.notBlank(accessToken, () -> Exceptions.error("微信登录失败"));
Assert.notNull(expiresIn, () -> Exceptions.error("微信登录失败"));
tokenExpTime = new Date().getTime() / 1000 + expiresIn;
}
}
}

View File

@ -0,0 +1,26 @@
package com.njzscloud.supervisory.wechat.param;
import cn.hutool.extra.spring.SpringUtil;
import com.njzscloud.supervisory.config.WechatProperties;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class Code2SessionParam {
private String appid;
private String secret;
private String js_code;
private String access_token;
private String grant_type = "authorization_code";
public Code2SessionParam() {
WechatProperties wechatProperties = SpringUtil.getBean(WechatProperties.class);
this.appid = wechatProperties.getAppId();
this.secret = wechatProperties.getAppSecret();
}
}

View File

@ -0,0 +1,24 @@
package com.njzscloud.supervisory.wechat.param;
import cn.hutool.extra.spring.SpringUtil;
import com.njzscloud.supervisory.config.WechatProperties;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class GetAccessTokenParam {
private String grant_type = "client_credential";
private String appid;
private String secret;
public GetAccessTokenParam() {
WechatProperties wechatProperties = SpringUtil.getBean(WechatProperties.class);
this.appid = wechatProperties.getAppId();
this.secret = wechatProperties.getAppSecret();
}
}

View File

@ -0,0 +1,22 @@
package com.njzscloud.supervisory.wechat.result;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class Code2SessionResult {
private String session_key;
private String unionid;
private String openid;
private String errmsg;
private Integer errcode;
public boolean isSucc() {
return errcode != null && errcode == 0;
}
}

View File

@ -0,0 +1,15 @@
package com.njzscloud.supervisory.wechat.result;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
@Getter
@Setter
@ToString
@Accessors(chain = true)
public class GetAccessTokenResult {
private String access_token;
private Integer expires_in;
}

View File

@ -42,6 +42,16 @@ oss:
mybatis-plus:
tunnel:
enable: false
# ssh:
# host: 139.224.54.144
# port: 22
# user: root
# credentials: D:/我的/再昇云/服务器秘钥/139.224.54.144_YZS_S1.pem
# localPort: 33061
# db:
# host: localhost
# port: 33061
AppID: wx3c06d9dd4e56c58d
AppSecret: ff280a71a4c06fc2956178f8c472ef96
wechat:
app-id: wx3c06d9dd4e56c58d
app-secret: ff280a71a4c06fc2956178f8c472ef96

View File

@ -33,7 +33,7 @@ spring:
# 是否将字符数组输出为数组
write-char-arrays-as-json-arrays: true
# 格式化输出(加入空格/回车)
indent-output: true
indent-output: false
# 对 Map 类型按键排序
order-map-entries-by-keys: true
# 是否将日期/时间序列化为时间错

View File

@ -85,11 +85,13 @@
e.carrying_capacity,
e.tare_weight history_tare_weight,
e.truck_category,
e.picture truck_picture,
f.driver_name,
f.phone driver_phone,
f.driving_licence,
f.licence_start_time,
f.licence_end_time,
f.driving_licence_no,
g.uscc trans_uscc,
g.company_name trans_company_name,
g.business_license trans_business_license,
@ -151,6 +153,7 @@
<result property="payerCategory" column="payer_category" typeHandler="com.njzscloud.common.mp.support.handler.e.EnumTypeHandlerDealer"/>
<result property="paymentStatus" column="payment_status" typeHandler="com.njzscloud.common.mp.support.handler.e.EnumTypeHandlerDealer"/>
<result property="moneyStrategy" column="money_strategy" typeHandler="com.njzscloud.common.mp.support.handler.e.EnumTypeHandlerDealer"/>
<result property="truckCategory" column="truck_category" typeHandler="com.njzscloud.common.mp.support.handler.e.EnumTypeHandlerDealer"/>
</resultMap>
<select id="paging" resultMap="OrderPagingResultMap">
@ -172,8 +175,7 @@
</if>
LIMIT 1
</select>
<select id="obtainWeighBill"
resultType="com.njzscloud.supervisory.order.pojo.result.ObtainWeighBillResult">
<select id="obtainWeighBill" resultMap="OrderPagingResultMap">
<include refid="base_select"/>
WHERE a.id = #{orderId}
</select>

View File

@ -0,0 +1,88 @@
<?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.station.mapper.StationManageMapper">
<select id="paging" resultType="com.njzscloud.supervisory.station.pojo.result.SearchStationManageResult">
SELECT c.nickname,
c.phone user_phone,
b.uscc,
b.company_name,
b.business_license,
b.license_start_time,
b.license_end_time,
b.legal_representative,
b.province,
b.city,
b.area,
b.town,
b.province_name,
b.city_name,
b.area_name,
b.town_name,
b.address,
b.lng,
b.lat,
b.contacts,
b.phone
FROM station_manage a
INNER JOIN biz_company b ON b.id = a.station_id AND b.station = 1 AND b.deleted = 0
INNER JOIN sys_user c ON c.id = a.user_id AND c.deleted = 0
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
${ew.customSqlSegment}
</if>
</select>
<select id="myStation"
resultType="com.njzscloud.supervisory.station.pojo.result.SearchStationManageResult">
SELECT c.nickname,
c.phone user_phone,
b.uscc,
b.company_name,
b.business_license,
b.license_start_time,
b.license_end_time,
b.legal_representative,
b.province,
b.city,
b.area,
b.town,
b.province_name,
b.city_name,
b.area_name,
b.town_name,
b.address,
b.lng,
b.lat,
b.contacts,
b.phone,
a.station_id,
b.company_name station_name
FROM station_manage a
INNER JOIN biz_company b ON b.id = a.station_id AND b.station = 1 AND b.deleted = 0
INNER JOIN sys_user c ON c.id = a.user_id AND c.deleted = 0
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
${ew.customSqlSegment}
</if>
</select>
<select id="listManager"
resultType="com.njzscloud.supervisory.station.pojo.result.SearchStationManageResult">
SELECT b.nickname,
b.phone user_phone,
a.user_id
FROM sys_user_role a
INNER JOIN sys_user b ON b.id = a.user_id AND b.deleted = 0
INNER JOIN sys_role c ON c.id = a.role_id AND c.deleted = 0
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
${ew.customSqlSegment}
</if>
</select>
<select id="myManage" resultType="java.lang.Long">
SELECT a.user_id
FROM station_manage a
INNER JOIN biz_company b ON b.id = a.station_id AND b.station = 1 AND b.deleted = 0
INNER JOIN sys_user c ON c.id = a.user_id AND c.deleted = 0
<if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
${ew.customSqlSegment}
</if>
</select>
</mapper>

View File

@ -4,7 +4,7 @@
"avatar": "data:image/png;base64,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",
"version": "4.9.4",
"createdTime": "2023-4-13 11:53:52",
"updatedTime": "2025-9-20 14:03:24",
"updatedTime": "2025-9-21 16:36:57",
"dbConns": [],
"profile": {
"default": {
@ -10008,6 +10008,23 @@
"extProps": {},
"id": "C491D9AB-15DC-4EC1-BBEE-FB45175E3A56"
},
{
"defKey": "auto_order",
"defName": "自动标识",
"comment": "0-->全手动、1-->进自动、2-->出自动、3-->全自动",
"type": "TINYINT",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": false,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"baseType": "9C056E28-859C-4498-9E07-63480343AFEB",
"extProps": {},
"id": "551C5101-DF64-4DA3-A7B5-7E07B79E3A7E"
},
{
"defKey": "station_id",
"defName": "站点 Id",
@ -16773,6 +16790,223 @@
"correlations": [],
"indexes": [],
"type": "P"
},
{
"id": "064CF6AF-A53D-4A10-9C89-22CB064D3BE1",
"env": {
"base": {
"nameSpace": "",
"codeRoot": ""
}
},
"defKey": "station_manage",
"defName": "站点管理员",
"comment": "",
"properties": {},
"sysProps": {
"nameTemplate": "{defKey}[{defName}]"
},
"notes": {},
"headers": [
{
"refKey": "hideInGraph",
"hideInGraph": true
},
{
"refKey": "defKey",
"freeze": false,
"hideInGraph": false
},
{
"refKey": "type",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "len",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "scale",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "defaultValue",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "defName",
"freeze": false,
"hideInGraph": false
},
{
"refKey": "comment",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "notNull",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "primaryKey",
"freeze": false,
"hideInGraph": false
},
{
"refKey": "autoIncrement",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "refDict",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "domain",
"freeze": false,
"hideInGraph": false
},
{
"refKey": "isStandard",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "uiHint",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "extProps",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr1",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr2",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr3",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr4",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr5",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr6",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr7",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr8",
"freeze": false,
"hideInGraph": true
},
{
"refKey": "attr9",
"freeze": false,
"hideInGraph": true
}
],
"fields": [
{
"defKey": "id",
"defName": "Id",
"comment": "",
"type": "BIGINT",
"len": "",
"scale": "",
"primaryKey": true,
"notNull": true,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"extProps": {},
"domain": "",
"id": "C5DCC65A-E401-4EC1-A13B-EA0AFB68765D",
"baseType": "9B6B9E10-DB11-4409-878B-5868A19CD9B0"
},
{
"defKey": "station_id",
"defName": "站点 Id",
"comment": "",
"type": "BIGINT",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": true,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"baseType": "9B6B9E10-DB11-4409-878B-5868A19CD9B0",
"extProps": {},
"id": "7593BBFF-3808-4FA9-A436-CF73CD6B58B0"
},
{
"defKey": "user_id",
"defName": "用户 Id",
"comment": "",
"type": "BIGINT",
"len": "",
"scale": "",
"primaryKey": false,
"notNull": true,
"autoIncrement": false,
"defaultValue": "",
"hideInGraph": false,
"refDict": "",
"baseType": "9B6B9E10-DB11-4409-878B-5868A19CD9B0",
"extProps": {},
"id": "7209DAF4-19DC-4DB4-A714-1727E86DB613"
},
{
"defKey": "canuse",
"defName": "是否启用",
"comment": "0-->否、1-->是",
"type": "TINYINT",
"len": 1,
"scale": "",
"primaryKey": false,
"notNull": true,
"autoIncrement": false,
"defaultValue": "1",
"hideInGraph": false,
"refDict": "",
"baseType": "9C056E28-859C-4498-9E07-63480343AFEB",
"extProps": {},
"id": "1400430D-B7EB-42FC-9E61-8CC6ACFB3AA4"
}
],
"correlations": [],
"indexes": [],
"type": "P"
}
],
"views": [],