Commit 9c947f36 authored by xiaosl's avatar xiaosl
parents 17297993 6f84994c
......@@ -8,53 +8,11 @@ public class ResultCode {
////////////////////////////参数相关///////////////////////////
//参数非法,请修改
public static int PARAM_ILLEGAL_CODE = Integer.valueOf(SystemProperty.getResultConfig("PARAM_ILLEGAL_CODE"));
//参数时效已过时,不能使用X
public static int PARAM_EPIRE_CODE = Integer.valueOf(SystemProperty.getResultConfig("PARAM_EXPIRE_CODE"));
public static int VEHICLE_IS_BOOKED = Integer.valueOf(SystemProperty.getResultConfig("VEHICLE_IS_BOOKED"));
// 操作成功
public static int SUCCESS_CODE = Integer.valueOf(SystemProperty.getResultConfig("SUCCESS_CODE"));
// 操作失败
public static int FAILED_CODE = Integer.valueOf(SystemProperty.getResultConfig("FAILED_CODE"));
//IM消息删除失败
public static int IM_DELETE_FAIL_CODE = Integer.valueOf(SystemProperty.getResultConfig("IM_DELETE_FAIL_CODE"));
public static int IM_MSG_NOT_EXIST_CODE = Integer.valueOf(SystemProperty.getResultConfig("IM_MSG_NOT_EXIST_CODE"));
// 车辆预定失败,请重试
public static int BOOKED_FAILED_CODE = Integer.valueOf(SystemProperty.getResultConfig("BOOKED_FAILED_CODE"));
//预定时间不能为空 DATE_TIME_IS_NULL
public static int DATE_TIME_IS_NULL = Integer.valueOf(SystemProperty.getResultConfig("DATE_TIME_IS_NULL"));
// 预定时间不能小于当前时间
public static int ONLY_BOOK_FROM_TODAY = Integer.valueOf(SystemProperty.getResultConfig("ONLY_BOOK_FROM_TODAY"));
public static int END_TIME_FROM_TODAY = Integer.valueOf(SystemProperty.getResultConfig("END_TIME_FROM_TODAY"));
// 只能预定两个月内的车辆
public static int ONLY_BOOK_TWO_MONTH = Integer.valueOf(SystemProperty.getResultConfig("ONLY_BOOK_TWO_MONTH"));
// 只能取消预定两个月内的车辆
public static int ONLY_UNBOOK_TWO_MONTH = Integer.valueOf(SystemProperty.getResultConfig("ONLY_UNBOOK_TWO_MONTH"));
// 添加车辆太多
public static int ADD_VEHICLE_MORE = Integer.valueOf(SystemProperty.getResultConfig("ADD_VEHICLE_MORE"));
// 停靠公司不能为空
public static int RET_COMPANY_CAN_NOT_BE_NULL = Integer.valueOf(SystemProperty.getResultConfig("RET_COMPANY_CAN_NOT_BE_NULL"));
// 车牌不能为空
public static int NUMBER_PLAT_CAN_NOT_BE_NULL = Integer.valueOf(SystemProperty.getResultConfig("NUMBER_PLAT_CAN_NOT_BE_NULL"));
// 选择日期不可取消预定
public static int VEHICLE_CAN_NOT_UNBOOK = Integer.valueOf(SystemProperty.getResultConfig("VEHICLE_CAN_NOT_UNBOOK"));
//预定日期为空
public static int BOOKED_DATE_IS_EMPTY = Integer.valueOf(SystemProperty.getResultConfig("BOOKED_DATE_IS_EMPTY"));
public static int TODAY_CAN_NOT_BOOK = Integer.valueOf(SystemProperty.getResultConfig("TODAY_CAN_NOT_BOOK"));
// 添加车辆失败,请重试
public static int ADD_VEHICLE_FAIL = Integer.valueOf(SystemProperty.getResultConfig("ADD_VEHICLE_FAIL"));
// 修改车辆失败,请重试
public static int UPDATE_VEHICLE_FAIL = Integer.valueOf(SystemProperty.getResultConfig("UPDATE_VEHICLE_FAIL"));
// 操作失败
public static int NULL_CODE = Integer.valueOf(SystemProperty.getResultConfig("NULL_CODE"));
// 操作出现异常
......@@ -73,32 +31,6 @@ public class ResultCode {
public static int WXAPI_CODE = Integer.valueOf(SystemProperty.getResultConfig("WXAPI_CODE"));
// 微信用户不存在
public static int WXNOTEXIST_CODE = Integer.valueOf(SystemProperty.getResultConfig("WXNOTEXIST_CODE"));
// ajax请求,用户未登录
public static int AJAX_WECHAT_NOTEXIST_CODE = Integer
.valueOf(SystemProperty.getResultConfig("AJAX_WECHAT_NOTEXIST_CODE"));
// 手机号已绑定人脸
public static int FACE_BIND_CODE = Integer.valueOf(SystemProperty.getResultConfig("FACE_BIND_CODE"));
// 手机号未绑定人脸
public static int FACE_NOTBIND_CODE = Integer.valueOf(SystemProperty.getResultConfig("FACE_NOTBIND_CODE"));
// 人脸识别失败
public static int FACE_NOTEXIST_CODE = Integer.valueOf(SystemProperty.getResultConfig("FACE_NOTEXIST_CODE"));
// 人脸比对失败
public static int FACE_COMPARE_FAILED_CODE = Integer
.valueOf(SystemProperty.getResultConfig("FACE_COMPARE_FAILED_CODE"));
// 人脸+眼睛识别失败
public static int EYE_NOTEXIST_CODE = Integer.valueOf(SystemProperty.getResultConfig("EYE_NOTEXIST_CODE"));
// redis中的token过期或者为空
public static int REDIS_TOKEN_NULL_CODE = Integer.valueOf(SystemProperty.getResultConfig("REDIS_TOKEN_NULL_CODE"));
// 手机号码已被使用
public static int PHONE_EXIST_CODE = Integer.valueOf(SystemProperty.getResultConfig("PHONE_EXIST_CODE"));
// 获取app用户失败
public static int GET_APPUSER_FAILED_CODE = Integer
.valueOf(SystemProperty.getResultConfig("GET_APPUSER_FAILED_CODE"));
// 用户不存在
public static int USER_NOTEXIST_CODE = Integer.valueOf(SystemProperty.getResultConfig("USER_NOTEXIST_CODE"));
......@@ -106,128 +38,19 @@ public class ResultCode {
// 用户已存在
public static int USER_EXIST_CODE = Integer.valueOf(SystemProperty.getResultConfig("USER_EXIST_CODE"));
// 手机号已绑定人脸
public static int WX_BIND_CODE = Integer.valueOf(SystemProperty.getResultConfig("WX_BIND_CODE"));
// 人脸已绑定手机号
public static int FACE_BIND_PHONE_CODE = Integer.valueOf(SystemProperty.getResultConfig("FACE_BIND_PHONE_CODE"));
// 新增组织失败
public static int ORG_INSERT_FAILED_CODE = Integer
.valueOf(SystemProperty.getResultConfig("ORG_INSERT_FAILED_CODE"));
// 更新组织信息失败
public static int ORG_UPDATE_FAILED_CODE = Integer
.valueOf(SystemProperty.getResultConfig("ORG_UPDATE_FAILED_CODE"));
// 新增角色信息失败
public static int ROLE_INSERT_FAILED_CODE = Integer
.valueOf(SystemProperty.getResultConfig("ROLE_INSERT_FAILED_CODE"));
// 更新组织信息失败
public static int ROLE_UPDATE_FAILED_CODE = Integer
.valueOf(SystemProperty.getResultConfig("ROLE_UPDATE_FAILED_CODE"));
// 组织下已存在超级管理员角色
public static int ROLE_SUPER_ISEXIST_CODE = Integer
.valueOf(SystemProperty.getResultConfig("ROLE_SUPER_ISEXIST_CODE"));
// 角色不存在
public static int ROLE_NOTEXIST_CODE = Integer.valueOf(SystemProperty.getResultConfig("ROLE_NOTEXIST_CODE"));
// 没有操作菜单的权限
public static int NOT_MENU_AUTH_CODE = Integer.valueOf(SystemProperty.getResultConfig("NOT_MENU_AUTH_CODE"));
// 新增权限失败
public static int INSERT_AUTH_FAILED_CODE = Integer
.valueOf(SystemProperty.getResultConfig("INSERT_AUTH_FAILED_CODE"));
// 更新权限失败
public static int UPDATE_AUTH_FAILED_CODE = Integer
.valueOf(SystemProperty.getResultConfig("UPDATE_AUTH_FAILED_CODE"));
// 角色权限不存在
public static int ROLE_NOTEXIST_AUTH_CODE = Integer
.valueOf(SystemProperty.getResultConfig("ROLE_NOTEXIST_AUTH_CODE"));
// 无一级角色
public static int NOT_HAVE_LEVEL1 = Integer.valueOf(SystemProperty.getResultConfig("NOT_HAVE_LEVEL1"));
// 账户已存在
public static int ACCOUNT_ISEXIST_CODE = Integer.valueOf(SystemProperty.getResultConfig("ACCOUNT_ISEXIST_CODE"));
// 账户不存在
public static int ACCOUNT_NOT_EXIST_CODE = Integer
.valueOf(SystemProperty.getResultConfig("ACCOUNT_NOT_EXIST_CODE"));
// 账户不存在
public static int ORG_DONTHAVE_PUBLIC_CODE = Integer
.valueOf(SystemProperty.getResultConfig("ORG_DONTHAVE_PUBLIC_CODE"));
// 组织超级管理员已存在
public static int ACCOUNT_FIRST_ISEXIST_CODE = Integer
.valueOf(SystemProperty.getResultConfig("ACCOUNT_FIRST_ISEXIST_CODE"));
// 昵称格式有误,请填写正确昵称
public static int NICKNAME_NULL_CODE = Integer.valueOf(SystemProperty.getResultConfig("NICKNAME_NULL_CODE"));
// 账户已禁用
public static int ACCOUNTINFO_ISDEL = Integer.valueOf(SystemProperty.getResultConfig("ACCOUNTINFO_ISDEL"));
// // 监控设备不存在
// public static int DEVICE_NOTEXIST_CODE = Integer.valueOf(SystemProperty.getResultConfig("DEVICE_NOTEXIST_CODE"));
// // 设备access_token获取失败
// public static int DEVICE_TOKEN_NOTEXIST_CODE = Integer
// .valueOf(SystemProperty.getResultConfig("DEVICE_TOKEN_NOTEXIST_CODE"));
// 操作频繁提示
public static int API_MAX_CODE = Integer.valueOf(SystemProperty.getResultConfig("API_MAX_CODE"));
// 公众号不存在
public static int PUBLIC_NOTEXIST_CODE = Integer.valueOf(SystemProperty.getResultConfig("PUBLIC_NOTEXIST_CODE"));
// 公众号不存在
public static int REPEAT_SUB_CODE = Integer.valueOf(SystemProperty.getResultConfig("REPEAT_SUB_CODE"));
// 身份证信息已存在
public static int IDNUM_ISEXIST_CODE = Integer.valueOf(SystemProperty.getResultConfig("IDNUM_ISEXIST_CODE"));
// 身份证信息已存在
public static int IDCARD_INVALID_CODE = Integer.valueOf(SystemProperty.getResultConfig("IDCARD_INVALID_CODE"));
// 企业个人简历不存在
public static int CORP_VITA_NOTEXIST = Integer.valueOf(SystemProperty.getResultConfig("CORP_VITA_NOTEXIST"));
// 企业个人简历不完善
public static int CORP_VITA_INCOMPLETET = Integer.valueOf(SystemProperty.getResultConfig("CORP_VITA_INCOMPLETET"));
// 简历有效期内已投
public static int VITA_DELIVERED = Integer.valueOf(SystemProperty.getResultConfig("VITA_DELIVERED"));
// 岗位已下架
public static int POST_END_CODE = Integer.valueOf(SystemProperty.getResultConfig("POST_END_CODE"));
// 客服下存在粉丝
public static int SERVICE_HAS_FANS = Integer.valueOf(SystemProperty.getResultConfig("SERVICE_HAS_FANS"));
// 未找到客服信息
public static int NOT_FIND_SERVICE_CODE = Integer.valueOf(SystemProperty.getResultConfig("NOT_FIND_SERVICE_CODE"));
// 非客服身份
public static int NOT_SERVICE = Integer.valueOf(SystemProperty.getResultConfig("NOT_SERVICE"));
// 圈子模块resultInfo类型返回正确码
public static int SCRM_RESULTINFO_SUCCESS_CODE = Integer
.valueOf(SystemProperty.getResultConfig("SCRM_RESULTINFO_SUCCESS_CODE"));
// 市接口无数据返回
public static int NO_SELECT_BY_RS = Integer.valueOf(SystemProperty.getResultConfig("NO_SELECT_BY_RS"));
// 未绑定社保卡
public static int NOT_BIND_SOCIAL_CARD = Integer.valueOf(SystemProperty.getResultConfig("NOT_BIND_SOCIAL_CARD"));
// 操作失败
public static int STOCK_CODE = Integer.valueOf(SystemProperty.getResultConfig("STOCK_CODE"));
public static int GET_AUTH_INFO_FAILED_CODE = Integer.valueOf(SystemProperty.getResultConfig("GET_AUTH_INFO_FAILED_CODE"));
public static int WRONG_FORMAT_OF_ID_CARD = Integer.valueOf(SystemProperty.getResultConfig("WRONG_FORMAT_OF_ID_CARD"));
public static int INCOMPLETE_DATA = Integer.valueOf(SystemProperty.getResultConfig("INCOMPLETE_DATA"));
/* ----------------------------------------------------订单相关---------------------------------------------------------- */
public static int ORDER_NOT_EXIST = Integer.valueOf(SystemProperty.getResultConfig("ORDER_NOT_EXIST"));
public static String getMsg(int code) {
return SystemProperty.getResultConfig(String.valueOf(code));
}
......
......@@ -6,10 +6,6 @@ SUCCESS_CODE=200
#操作失败
FAILED_CODE=1001
1001=操作失败
IM_DELETE_FAIL_CODE = 10011
10011 = 删除消息失败
IM_MSG_NOT_EXIST_CODE = 10012
10012 = 消息不存在
#数据已存在
EXIST_CODE=1002
1002=数据已存在
......@@ -22,12 +18,11 @@ NULL_CODE=1003
#操作出现异常
EXCEPTION_CODE=1004
1004=操作出现异常
#操作频繁,稍后再试
API_MAX_CODE=1005
1005=操作频繁,稍后再试
#rstoken已失效
RSTOKEN_EXPIRED_CODE=1006
1006=rstoken已失效
#rstoken为空
RSTOKEN_NULL_CODE=1007
1007=rstoken为空
......@@ -37,63 +32,14 @@ RSTOKEN_NULL_CODE=1007
DB_OPERATION_FAIL_CODE=1008
1008=数据库操作失败
VEHICLE_IS_BOOKED=10080
10080=车辆已经被预定
#参数非法
PARAM_ILLEGAL_CODE=1011
1011=参数非法,请修改
#参数时效已过时
PARAM_EXPIRE_CODE=1010
1010=参数时效已过时,不能使用
#请求微信接口失败
WXAPI_CODE=2001
#微信用不不存在
WXNOTEXIST_CODE=2003
#公众号不存在
PUBLIC_NOTEXIST_CODE=2004
2004=公众号不存在
#ajax请求,用户未登录
AJAX_WECHAT_NOTEXIST_CODE=2005
2005=ajax请求,用户未登录
#手机号已绑定人脸
FACE_BIND_CODE=3000
3000=手机号已绑定人脸
#手机号未绑定人脸
FACE_NOTBIND_CODE=3001
3001=手机号未绑定人脸
#人脸识别失败
FACE_NOTEXIST_CODE=3002
3002=人脸识别失败
#人脸比对失败
FACE_COMPARE_FAILED_CODE=3003
3003=人脸比对失败
#人脸已绑定手机号码
FACE_BIND_PHONE_CODE=3004
3004=人脸已绑定手机号
#人脸已绑定手机号码
EYE_NOTEXIST_CODE=3005
3005=识别失败
#登陆token过期
REDIS_TOKEN_NULL_CODE=4001
4001=登陆token过期
#手机号已绑定微信
WX_BIND_CODE=4002
4002=手机号已绑定微信
#获取用户失败
GET_APPUSER_FAILED_CODE=4003
4003=获取用户失败
#手机号码已被使用
PHONE_EXIST_CODE=5001
......@@ -107,101 +53,15 @@ USER_NOTEXIST_CODE=5002
USER_EXIST_CODE=5003
5003=用户不存在
ORG_INSERT_FAILED_CODE=6001
6001=新增组织失败
ORG_UPDATE_FAILED_CODE=6002
6002=更新组织信息失败
ROLE_INSERT_FAILED_CODE=7001
7001=新增角色信息失败
ROLE_UPDATE_FAILED_CODE=7002
7002=更新角色信息失败
ROLE_SUPER_ISEXIST_CODE=7003
7003=该组织已存在一级管理员角色
ROLE_NOTEXIST_CODE=7004
7004=角色不存在
NOT_HAVE_LEVEL1=7005
7005=该组织无一级角色,请先创建
NOT_MENU_AUTH_CODE=8001
8001=没有操作该菜单的权限
INSERT_AUTH_FAILED_CODE=8003
8003=新增权限失败
UPDATE_AUTH_FAILED_CODE=8002
8002=更新权限失败
ROLE_NOTEXIST_AUTH_CODE=8004
8004=角色权限不存在
ACCOUNT_ISEXIST_CODE=9001
9001=账户已存在
ACCOUNT_FIRST_ISEXIST_CODE=9002
9002=该组织已存在超级管理员账户
ACCOUNT_NOT_EXIST_CODE=9003
9003=账户不存在
NOT_FIND_SERVICE_CODE=9004
9004=未找到客服信息
ORG_DONTHAVE_PUBLIC_CODE=9005
9005=该组织暂未配置公众号信息,请先配置!
NICKNAME_NULL_CODE=9006
9006=昵称格式有误,请填写正确昵称
ACCOUNTINFO_ISDEL=9007
9007=账户已禁用
#DEVICE_NOTEXIST_CODE=1005
#1005=监控设备不存在
#DEVICE_TOKEN_NOTEXIST_CODE=1006
#1005=设备access_token获取失败
REPEAT_SUB_CODE=1008
#身份证信息已采集
IDNUM_ISEXIST_CODE=10001
#身份证已过去
IDCARD_INVALID_CODE=10002
#企业个人简历不存在
CORP_VITA_NOTEXIST=20001
20001=个人简历不存在,请先创建简历
#企业个人简历不完善
CORP_VITA_INCOMPLETET=20002
20002=个人简历不完善,请先完善简历
#简历在有效时间内已投递
VITA_DELIVERED=20003
#岗位已下架
POST_END_CODE=20004
20004=该岗位已下架
#客服存在粉丝
SERVICE_HAS_FANS=40001
40001=请先转移该客服的粉丝!
#客服
NOT_SERVICE=40002
40002=当前用户不是客服身份!
#圈子模块resultInfo类型返回正确码
SCRM_RESULTINFO_SUCCESS_CODE=10344
#市接口无数据返回
NO_SELECT_BY_RS=1010
#还未绑定社保卡
NOT_BIND_SOCIAL_CARD=3010
#库存不足
STOCK_CODE=201
#获取用户认证信息失败
GET_AUTH_INFO_FAILED_CODE=4004
4004=获取用户认证信息失败!
#证件件格式
......@@ -211,44 +71,6 @@ WRONG_FORMAT_OF_ID_CARD=4005
INCOMPLETE_DATA=4006
4006=资料不齐全!
BOOKED_FAILED_CODE = 4007
4007=车辆预定失败,请重试!
ONLY_BOOK_FROM_TODAY = 4008
4008=预定时间不能小于当前时间
ADD_VEHICLE_FAIL = 4009
4009 = 添加车辆失败,请重试
UPDATE_VEHICLE_FAIL = 4010
4010 = 修改车辆失败,请重试
DATE_TIME_IS_NULL = 4011
4011 = 预定时间不能为空
ONLY_BOOK_TWO_MONTH = 4012
4012 = 最多提前三个月预约
ONLY_UNBOOK_TWO_MONTH = 4013
4013 = 只能取消预定两月内的车辆
VEHICLE_CAN_NOT_UNBOOK = 4014
4014 = 选择日期不可取消预定
BOOKED_DATE_IS_EMPTY = 4015
4015 = 预定日期为空
TODAY_CAN_NOT_BOOK = 4016
4016 = 当天不可预定
ADD_VEHICLE_MORE = 4017
4017 = 添加车辆过多,请分批添加
RET_COMPANY_CAN_NOT_BE_NULL = 4018
4018 = 停靠公司不能为空
NUMBER_PLAT_CAN_NOT_BE_NULL = 4019
4019 = 车牌不能为空
END_TIME_FROM_TODAY = 4020
4020 = 结束时间不能小于开始时间
\ No newline at end of file
####################################订单相关################################
ORDER_NOT_EXIST = 20001
20001 = 该订单不存在!
\ No newline at end of file
......@@ -73,6 +73,11 @@ public class AppUserManageDTO {
* 真实姓名
*/
private String realName;
/**
* 状态:0-启用,1-禁用
*/
private Integer status;
// /**
// * 接收前台时间范围
// */
......
......@@ -12,6 +12,7 @@ import com.github.wxiaoqi.security.admin.vo.AppUserVo;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.exception.BaseException;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtilsBean;
import org.apache.commons.collections.CollectionUtils;
......@@ -37,113 +38,136 @@ import java.util.stream.Collectors;
@Slf4j
public class AppUserManageBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail> {
@Autowired
private AppUserLoginMapper appUserLoginMapper;
@Autowired
private AppUserDetailBiz appUserDetailBiz;
/**
* 根据条件查询
*
* @param appUserManageDTO 查询条件
* @return
*/
public PageInfo<AppUserManageVo> findAllByQuery(AppUserManageDTO appUserManageDTO) {
if (Objects.nonNull(appUserManageDTO.getRegistrationTimeEnd())){
long registerEndTime = appUserManageDTO.getRegistrationTimeEnd()+(24*60*60);
appUserManageDTO.setRegistrationTimeEnd(registerEndTime);
}
PageHelper.startPage(appUserManageDTO.getPage(), appUserManageDTO.getLimit());
List<AppUserManageVo> appUserManageVos = mapper.selectAppUser(appUserManageDTO);
PageInfo<AppUserManageVo> pageInfo = PageInfo.of(appUserManageVos);
if (pageInfo.getList()==null||pageInfo.getList().size()==0) {
return pageInfo;
}
throw new BaseException("User error!");
}
/**
* 禁用账户
* @param id
*/
@Transactional(rollbackFor =Exception.class)
public void deleteAppUser(Integer id,Integer isDel) {
AppUserLogin appUserLogin = new AppUserLogin();
//修改为禁用并设置修改时间
appUserLogin.setIsdel(isDel);
appUserLogin.setUpdatetime(System.currentTimeMillis());
Example example = new Example(AppUserLogin.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("id", id);
appUserLoginMapper.updateByExampleSelective(appUserLogin, example);
//设置
AppUserDetail appUserDetail = new AppUserDetail();
appUserDetail.setIsdel(isDel);
appUserDetail.setUpdatetime(System.currentTimeMillis());
Example detailExample = new Example(AppUserLogin.class);
Example.Criteria detailCriteria = detailExample.createCriteria();
criteria.andEqualTo("id", id);
mapper.updateByExampleSelective(appUserDetail, detailCriteria);
}
/**
* 查询一条
* @param id
* @return
*/
public AppUserVo findOneById(Integer id) {
return mapper.getUserInfo(id);
}
/**
*保存
* @param appUserVo
*/
@Transactional(rollbackFor =Exception.class)
public void save(AppUserVo appUserVo) {
AppUserLogin appUserLogin = new AppUserLogin();
AppUserDetail appUserDetail = new AppUserDetail();
try {
BeanUtilsBean.getInstance().copyProperties(appUserLogin, appUserVo);
BeanUtilsBean.getInstance().copyProperties(appUserDetail, appUserVo);
if (appUserVo.getUserid() == null || appUserVo.getUserid() == 0) {
//设置登录用户信息
appUserLogin.setIsdel(0);
appUserLogin.setCreatetime(System.currentTimeMillis());
appUserLogin.setCertificationStatus(0);
appUserLogin.setStatus(0);
//设置用户详情
appUserDetail.setIsdel(0);
if (appUserDetail.getIsMember() == null) {
appUserDetail.setIsMember(0);
}
appUserLoginMapper.insertSelective(appUserLogin);
mapper.insertSelective(appUserDetail);
} else {
appUserLogin.setUpdatetime(System.currentTimeMillis());
appUserDetail.setUpdatetime(System.currentTimeMillis());
appUserLoginMapper.updateByPrimaryKeySelective(appUserLogin);
mapper.updateByPrimaryKeySelective(appUserDetail);
}
} catch (Exception e) {
log.error(e.getMessage(), e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
}
public AppUserManageVo findUserInfoById(Integer userId) {
AppUserManageVo appUserManageVo = new AppUserManageVo();
List<AppUserManageVo> appUserManageVos = mapper.selectAppUserManage(userId);
if (CollectionUtils.isEmpty(appUserManageVos)){
return appUserManageVo;
}
return appUserManageVos.get(0);
}
@Autowired
private AppUserLoginMapper appUserLoginMapper;
@Autowired
private AppUserDetailBiz appUserDetailBiz;
/**
* 根据条件查询
*
* @param appUserManageDTO 查询条件
* @return
*/
public PageInfo<AppUserManageVo> findAllByQuery(AppUserManageDTO appUserManageDTO) {
if (Objects.nonNull(appUserManageDTO.getRegistrationTimeEnd())) {
long registerEndTime = appUserManageDTO.getRegistrationTimeEnd() + (24 * 60 * 60);
appUserManageDTO.setRegistrationTimeEnd(registerEndTime);
}
PageHelper.startPage(appUserManageDTO.getPage(), appUserManageDTO.getLimit());
List<AppUserManageVo> appUserManageVos = mapper.selectAppUser(appUserManageDTO);
PageInfo<AppUserManageVo> pageInfo = PageInfo.of(appUserManageVos);
if (pageInfo.getList() == null || pageInfo.getList().size() == 0) {
return new PageInfo<>();
}
return pageInfo;
}
/**
* 禁用账户
*
* @param id
*/
@Transactional(rollbackFor = Exception.class)
public void deleteAppUser(Integer id, Integer isDel) {
AppUserLogin appUserLogin = new AppUserLogin();
//修改为禁用并设置修改时间
appUserLogin.setIsdel(isDel);
appUserLogin.setUpdatetime(System.currentTimeMillis());
Example example = new Example(AppUserLogin.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("id", id);
appUserLoginMapper.updateByExampleSelective(appUserLogin, example);
//设置
AppUserDetail appUserDetail = new AppUserDetail();
appUserDetail.setIsdel(isDel);
appUserDetail.setUpdatetime(System.currentTimeMillis());
Example detailExample = new Example(AppUserLogin.class);
Example.Criteria detailCriteria = detailExample.createCriteria();
criteria.andEqualTo("id", id);
mapper.updateByExampleSelective(appUserDetail, detailCriteria);
}
/**
* 查询一条
*
* @param id
* @return
*/
public AppUserVo findOneById(Integer id) {
return mapper.getUserInfo(id);
}
/**
* 启用禁用
*
* @param appUserLogin
* @return
*/
public ObjectRestResponse updateStatus(AppUserLogin appUserLogin) {
if (appUserLogin == null || appUserLogin.getId() == null || appUserLogin.getStatus() == null) {
return ObjectRestResponse.paramIsEmpty();
}
AppUserLogin old = appUserLoginMapper.selectByPrimaryKey(appUserLogin.getId());
if (old == null || old.getIsdel() == 1) {
return ObjectRestResponse.createFailedResult(ResultCode.NOTEXIST_CODE, ResultCode.getMsg(ResultCode.NOTEXIST_CODE));
}
old.setStatus(appUserLogin.getStatus());
appUserLoginMapper.updateByPrimaryKeySelective(old);
return ObjectRestResponse.succ();
}
/**
* 保存
*
* @param appUserVo
*/
@Transactional(rollbackFor = Exception.class)
public void save(AppUserVo appUserVo) {
AppUserLogin appUserLogin = new AppUserLogin();
AppUserDetail appUserDetail = new AppUserDetail();
try {
BeanUtilsBean.getInstance().copyProperties(appUserLogin, appUserVo);
BeanUtilsBean.getInstance().copyProperties(appUserDetail, appUserVo);
if (appUserVo.getUserid() == null || appUserVo.getUserid() == 0) {
//设置登录用户信息
appUserLogin.setIsdel(0);
appUserLogin.setCreatetime(System.currentTimeMillis());
appUserLogin.setCertificationStatus(0);
appUserLogin.setStatus(0);
//设置用户详情
appUserDetail.setIsdel(0);
if (appUserDetail.getIsMember() == null) {
appUserDetail.setIsMember(0);
}
appUserLoginMapper.insertSelective(appUserLogin);
mapper.insertSelective(appUserDetail);
} else {
appUserLogin.setUpdatetime(System.currentTimeMillis());
appUserDetail.setUpdatetime(System.currentTimeMillis());
appUserLoginMapper.updateByPrimaryKeySelective(appUserLogin);
mapper.updateByPrimaryKeySelective(appUserDetail);
}
} catch (Exception e) {
log.error(e.getMessage(), e);
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
}
}
public AppUserManageVo findUserInfoById(Integer userId) {
AppUserManageVo appUserManageVo = new AppUserManageVo();
List<AppUserManageVo> appUserManageVos = mapper.selectAppUserManage(userId);
if (CollectionUtils.isEmpty(appUserManageVos)) {
return appUserManageVo;
}
return appUserManageVos.get(0);
}
}
......@@ -49,8 +49,6 @@ public class AppUsersManageController extends BaseController<AppUserManageBiz,Ap
@Autowired
protected UserAuthConfig userAuthConfig;
@Autowired
private PublicController publicController;
@Autowired
private UserAuthUtil userAuthUtil;
......@@ -63,15 +61,12 @@ public class AppUsersManageController extends BaseController<AppUserManageBiz,Ap
*/
@PostMapping("/findAll")
public ObjectRestResponse<PageInfo<AppUserManageVo>> findAllByQuery(@RequestBody AppUserManageDTO appUserManageDTO) throws Exception {
String token = userAuthConfig.getToken(request);
ObjectRestResponse objectRestResponse = publicController.userinfoByToken(token);
User user = (User) objectRestResponse.getData();
if (user==null){
throw new BaseException("User error!");
}
// if (ALL_PERMISSIONS.equals(user.getDataAll())) {
return ObjectRestResponse.succ(baseBiz.findAllByQuery(appUserManageDTO));
// }
}
@PostMapping(value = "updateStatus")
public ObjectRestResponse updateStatus(@RequestBody AppUserLogin appUserLogin) {
return baseBiz.updateStatus(appUserLogin);
}
/**
......
......@@ -217,6 +217,9 @@
<if test="userId!=null">
and l.id=#{userId}
</if>
<if test="status != null">
and l.status = #{status}
</if>
<if test="postionState != null">
<choose>
<when test="postionState == 6">
......
......@@ -77,8 +77,9 @@ public class RscpAreaImageTotal implements java.io.Serializable {
private String imageArea;
/** dataId */
/** imageYear */
@ApiModelProperty(value = "")
private String dataId;
private Long dataId;
/** imageCloudage */
@ApiModelProperty(value = "")
......@@ -383,7 +384,7 @@ public class RscpAreaImageTotal implements java.io.Serializable {
*
* @return dataId
*/
public String getDataId() {
public Long getDataId() {
return this.dataId;
}
......@@ -392,7 +393,7 @@ public class RscpAreaImageTotal implements java.io.Serializable {
*
* @param dataId
*/
public void setDataId(String dataId) {
public void setDataId(Long dataId) {
this.dataId = dataId;
}
......
......@@ -19,7 +19,7 @@ public class RscpImageDataTotal implements java.io.Serializable {
/** 标识id */
@ApiModelProperty(value = "标识id")
private String id;
private Long id;
/** 编号 */
@ApiModelProperty(value = "编号")
......@@ -277,4 +277,8 @@ public class RscpImageDataTotal implements java.io.Serializable {
@ApiModelProperty(value = "")
private Integer imageYear;
/** imageYear */
@ApiModelProperty(value = "")
private Long dataId;
}
\ No newline at end of file
......@@ -3,10 +3,13 @@ package com.upyuns.platform.rs.datacenter.fegin;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.upyuns.platform.rs.datacenter.entity.RscpAreaInfo;
import com.upyuns.platform.rs.datacenter.entity.RscpImageDataTotal;
import com.upyuns.platform.rs.datacenter.pojo.ImageDataVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.List;
/**
* ${DESCRIPTION}
......@@ -20,6 +23,6 @@ public interface DatacenterFeign {
@RequestMapping(value = "/web/areaInfo/app/unauth/Fegin/queryByCodeFegin", method = RequestMethod.GET)
public ObjectRestResponse<RscpAreaInfo> queryByCode(String areaCode);
@RequestMapping(value = "/web/imageData/app/unauth/Fegin/queryById", method = RequestMethod.GET)
public ObjectRestResponse<RscpImageDataTotal> queryById(String id);
@RequestMapping(value = "/web/imageData/app/unauth/Fegin/queryByIds", method = RequestMethod.GET)
public ObjectRestResponse<List<ImageDataVO>> queryByIds(String ids);
}
package com.upyuns.platform.rs.datacenter.pojo;
import com.upyuns.platform.rs.datacenter.entity.RscpAreaImageTotal;
import com.upyuns.platform.rs.datacenter.entity.RscpImageDataTotal;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ImageDataVO extends RscpAreaImageTotal {
BigDecimal price = BigDecimal.ZERO;
}
package com.upyuns.platform.rs.datacenter.rest;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
......@@ -14,7 +15,11 @@ import com.github.wxiaoqi.security.common.util.result.JsonResultUtil;
import com.github.wxiaoqi.security.common.vo.PageParam;
import com.upyuns.platform.rs.datacenter.biz.RscpAreaImageTotalBiz;
import com.upyuns.platform.rs.datacenter.biz.RscpImageDataTotalBiz;
import com.upyuns.platform.rs.datacenter.biz.RscpImagePriceBiz;
import com.upyuns.platform.rs.datacenter.entity.RscpAreaImageTotal;
import com.upyuns.platform.rs.datacenter.entity.RscpImageDataTotal;
import com.upyuns.platform.rs.datacenter.entity.RscpImagePrice;
import com.upyuns.platform.rs.datacenter.pojo.ImageDataVO;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
......@@ -27,6 +32,8 @@ import java.math.BigDecimal;
import java.util.Collections;
import java.util.List;
import static com.github.wxiaoqi.security.common.constant.CommonConstants.SYS_TRUE;
@RestController
@RequestMapping("/web/imageData")
public class RscpImageDataTotalController extends BaseController<RscpImageDataTotalBiz, RscpImageDataTotal> {
......@@ -34,6 +41,9 @@ public class RscpImageDataTotalController extends BaseController<RscpImageDataTo
@Autowired
RscpAreaImageTotalBiz rscpAreaImageTotalBiz;
@Autowired
RscpImagePriceBiz rscpImagePriceBiz;
@RequestMapping(value = "/app/unauth/query", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse unauthQuery(PageParam pageParam) {
......@@ -78,9 +88,28 @@ public class RscpImageDataTotalController extends BaseController<RscpImageDataTo
}
}
@RequestMapping(value = "/web/imageData/app/unauth/Fegin/queryByIds", method = RequestMethod.GET)
public ObjectRestResponse<List<RscpImageDataTotal>> queryById(String ids){
return ObjectRestResponse.succ(baseBiz.selectByAttrs(RscpImageDataTotal::getId, CollUtil.toList(ids.split(","))));
@RequestMapping(value = "/app/unauth/Fegin/queryByIds", method = RequestMethod.GET)
@IgnoreUserToken
public ObjectRestResponse<List<RscpImageDataTotal>> queryByIds(String ids){
List<RscpImagePrice> list = rscpImagePriceBiz.selectByWeekend(w -> {
w.andEqualTo(RscpImagePrice::getStatus, SYS_TRUE);
return w;
}, " daily_sort asc");
List<RscpImageDataTotal> list2 = baseBiz.selectByAttrs(RscpImageDataTotal::getId, CollUtil.toList(ids.split(",")));
List<ImageDataVO> list3 = CollUtil.newArrayList();
list2.forEach(t -> {
ImageDataVO vo = BeanUtil.toBean(t, ImageDataVO.class);
vo.setBeginTime(t.getImageTakeTime());
list.forEach(p -> {
if(t.getImageSatelliteType().equals(p.getImageSatelliteType())
&& t.getImageSensorType().equals(p.getImageSensorType())) {
vo.setPrice(p.getUnitPrice());
}
});
list3.add(vo);
});
return ObjectRestResponse.succ(list3);
}
......
package com.upyuns.platform.rs.website.dto;
import lombok.Data;
/**
* @ClassName : ConfirmReceivedDto
* @Description : 确认收货
* @Author : jiaoruizhen
* @Date: 2020-12-17 14:01
*/
@Data
public class ConfirmReceivedDto {
//订单号
Long orderId;
/**
* 快递单号
*/
String trackingNumber;
/**
* 快递单图片
*/
String trackingImg;
}
......@@ -11,7 +11,7 @@ import lombok.Data;
@Data
public class ItemInfoDto {
Integer id;
Long id;
Integer number;
......
......@@ -42,9 +42,13 @@ public class OrderInfoDto extends PageParam {
*/
private List<ItemInfoDto> itemInfoDtoList;
/**
* 发票内容
*/
private String invoiceContent;
//详情ID
Integer detailId;
Long detailId;
//1、标准数据,2、影像图库,3、行业应用信息
Integer type;
......
package com.upyuns.platform.rs.website.dto;
import lombok.Data;
/**
* @ClassName : OrderInvoiceDto
* @Description : 订单发票
* @Author : jiaoruizhen
* @Date: 2020-12-17 15:23
*/
@Data
public class OrderInvoiceDto {
/**
* 订单号
*/
private Long orderId;
/**
* 发票链接
*/
private String invoiceUrl;
}
......@@ -188,4 +188,11 @@ public class CustomForm implements Serializable {
@ApiModelProperty(value = "区名称")
private String areaName;
/**
* 几何json
*/
@Column(name = "geojson")
@ApiModelProperty(value = "几何json")
private String geojson;
}
......@@ -167,6 +167,16 @@ public class OrderEInvoice implements Serializable {
@Column(name = "content_title")
@ApiModelProperty(value = "发票内容")
private String contentTitle;
/**
* 快递单号
*/
String trackingNumber;
/**
* 快递单图片
*/
String trackingImg;
}
......@@ -3,14 +3,16 @@ package com.upyuns.platform.rs.website.entity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 订单信息
*
*
* @author jiaoruizhen
* @email jiaoruizhen@126.com
* @date 2020-12-03 13:29:23
......@@ -19,166 +21,200 @@ import lombok.Data;
@Table(name = "order_info")
public class OrderInfo implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
@Id
/**
*
*/
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@ApiModelProperty("")
private Long orderId;
/**
* 订单号
*/
@Column(name = "order_no")
private Long orderId;
/**
* 订单号
*/
@Column(name = "order_no")
@ApiModelProperty(value = "订单号")
private String orderNo;
/**
* 单价
*/
@Column(name = "amount")
private String orderNo;
/**
* 单价
*/
@Column(name = "amount")
@ApiModelProperty(value = "单价")
private BigDecimal amount;
/**
* 数量
*/
@Column(name = "number")
private BigDecimal amount;
/**
* 数量
*/
@Column(name = "number")
@ApiModelProperty(value = "数量")
private Integer number;
/**
* 订单状态:1--创建订单,2--待付款,3--已支付,4--已发货,5--已完成 -1、删除,-2、取消
*/
@Column(name = "status")
@ApiModelProperty(value = " 订单状态:1--创建订单,2--待付款,3--已支付,4--已发货,5--已完成 -1、删除,-2、取消")
private Integer status;
private Integer number;
/**
* 订单状态:0、定制订单无价格 1--创建订单,2--待付款,3--已支付,4--已发货, 5--已收货, 6、已完成 -1、删除,-2、取消, -3 退款
*/
@Column(name = "status")
@ApiModelProperty(value = " 订单状态:0、定制订单无价格 1--创建订单,2--待付款,3--已支付,4--已发货, 5--已收货, 6、已完成 -1、删除,-2、取消, -3 退款")
private Integer status;
/**
* 支付状态:1--未支付,2--已支付
* 发货状态0待发货,1已发货,2收货,3退货,
*/
private Integer shippingStatus;
/**
* 1待付款,2已付款,3已退款
*/
private Integer payStatus;
/**
* 用户id
*/
@Column(name = "user_id")
/**
* 用户id
*/
@Column(name = "user_id")
@ApiModelProperty(value = "用户id")
private Integer userId;
/**
* 用户手机号
*/
@Column(name = "phone")
private Integer userId;
/**
* 用户手机号
*/
@Column(name = "phone")
@ApiModelProperty(value = "用户手机号")
private String phone;
/**
* 用户昵称
*/
@Column(name = "nickname")
private String phone;
/**
* 用户昵称
*/
@Column(name = "nickname")
@ApiModelProperty(value = "用户昵称")
private String nickname;
/**
* 用户真实姓名
*/
@Column(name = "real_name")
private String nickname;
/**
* 用户真实姓名
*/
@Column(name = "real_name")
@ApiModelProperty(value = "用户真实姓名")
private String realName;
/**
* 头像
*/
@Column(name = "head_img")
private String realName;
/**
* 头像
*/
@Column(name = "head_img")
@ApiModelProperty(value = "头像")
private String headImg;
/**
* 1、微信支付,2、支付宝支付,3、对公支付
*/
@Column(name = "pay_type")
private String headImg;
/**
* 1、微信支付,2、支付宝支付,3、对公支付
*/
@Column(name = "pay_type")
@ApiModelProperty(value = "1、微信支付,2、支付宝支付,3、对公支付")
private Integer payType;
/**
* 下单时间
*/
@Column(name = "crt_time")
@ApiModelProperty(value = "下单时间", hidden = true )
private Date crtTime;
/**
* 支付时间
*/
@Column(name = "pay_time")
private Integer payType;
/**
* 下单时间
*/
@Column(name = "crt_time")
@ApiModelProperty(value = "下单时间", hidden = true)
private Date crtTime;
/**
* 支付时间
*/
@Column(name = "pay_time")
@ApiModelProperty(value = "支付时间")
private Date payTime;
/**
*
*/
@Column(name = "upd_time")
@ApiModelProperty(value = "", hidden = true )
private Date updTime;
/**
* 运费
*/
@Column(name = "fee")
private Date payTime;
/**
*
*/
@Column(name = "upd_time")
@ApiModelProperty(value = "", hidden = true)
private Date updTime;
/**
* 运费
*/
@Column(name = "fee")
@ApiModelProperty(value = "运费")
private BigDecimal fee;
/**
* 订单备注
*/
@Column(name = "remark")
private BigDecimal fee;
/**
* 订单备注
*/
@Column(name = "remark")
@ApiModelProperty(value = "订单备注")
private String remark;
/**
* 配送方式:1、线上配送,2、快递配送
*/
@Column(name = "send_type")
private String remark;
/**
* 配送方式:1、线上配送,2、快递配送
*/
@Column(name = "send_type")
@ApiModelProperty(value = "配送方式:1、线上配送,2、快递配送")
private Integer sendType;
/**
* 收货人姓名
*/
@Column(name = "receive_name")
private Integer sendType;
/**
* 收货人姓名
*/
@Column(name = "receive_name")
@ApiModelProperty(value = "收货人姓名")
private String receiveName;
/**
* 收货人电话
*/
@Column(name = "receive_phone")
private String receiveName;
/**
* 收货人电话
*/
@Column(name = "receive_phone")
@ApiModelProperty(value = "收货人电话")
private String receivePhone;
/**
* 收货地址
*/
@Column(name = "receive_address")
private String receivePhone;
/**
* 收货地址
*/
@Column(name = "receive_address")
@ApiModelProperty(value = "收货地址")
private String receiveAddress;
/**
*
*/
@Column(name = "total_amount")
private String receiveAddress;
/**
* 总金额
*/
@Column(name = "total_amount")
@ApiModelProperty(value = "")
private BigDecimal totalAmount;
/**
*
*/
@Column(name = "type")
private BigDecimal totalAmount;
/**
* 1、普通订单,2、定制订单
*/
@Column(name = "type")
@ApiModelProperty(value = "1、普通订单,2、定制订单")
private Integer type;
private Integer type;
/**
* 发票状态: 1、未开发票,2、已开发票, 3、已发货, 4、已收货、5、退回, 6、已完成
*/
private Integer invoiceStatus;
/**
* 发票ID
*/
private Integer invoiceId;
/**
* 快递单号
*/
String trackingNumber;
/**
* 快递单图片
*/
String trackingImg;
/**
* 取消备注
*/
String cancelRemark;
@Transient
private List<OrderItem> orderItemList;
@Transient
OrderEInvoice orderEInvoice;
}
......@@ -47,7 +47,7 @@ public class OrderItem implements Serializable {
*/
@Column(name = "detail_id")
@ApiModelProperty(value = "详情id")
private Integer detailId;
private Long detailId;
/**
* 详情json信息
......
......@@ -40,7 +40,7 @@ public class ShoppingCartInfo implements Serializable {
*/
@Column(name = "detail_id")
@ApiModelProperty(value = "详情id")
private Integer detailId;
private Long detailId;
/**
* 详情json信息
......
package com.upyuns.platform.rs.website.type;
import lombok.Data;
/**
* @ClassName : OrderInvoiceStatus
* @Description : 订单发票状态
* @Author : jiaoruizhen
* @Date: 2020-12-17 15:39
* 发票状态: 1、未开发票,2、已开发票, 3、已发货, 4、已收货、5、退回, 6、已完成
*/
public enum OrderInvoiceStatusEnum {
INVOICE_NO_OPEN(1, "未开发票"),
INVOICE_OPEN(2, "已开发票"),
INVOICE_SEND(3, "已发货"),
INVOICE_RECEIVED(4, "已收货"),
INVOICE_REFUND(5, "退回"),
INVOICE_COMPLETE(6, "已完成"),
;
private Integer type;
private String msg;
OrderInvoiceStatusEnum(Integer type, String msg) {
this.type = type;
this.msg = msg;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static <T extends OrderInvoiceStatusEnum> String getType(Integer code, Class<T> t) {
for (T item : t.getEnumConstants()) {
if (item.getType().equals(code)) {
return item.getMsg();
}
}
return "";
}
public static OrderInvoiceStatusEnum getByCode(Integer code) {
for (OrderInvoiceStatusEnum v : values()) {
if (v.getType() == code) {
return v;
}
}
return null;
}
public static String getProductStatusEnum(Integer code) {
return getType(code, OrderInvoiceStatusEnum.class);
}
}
package com.upyuns.platform.rs.website.type;
/**
* @ClassName : OrderStatusEnum
* @Description : 订单发货状态
* @Author : jiaoruizhen
* 订单发货状态:0待发货,1已发货,2收货,3退货,
* @Date: 2020-12-12 16:50
*/
public enum OrderShippingStatusEnum {
ORDER_NO_SEND(0, "待发货"),
ORDER_SEND(1, "已发货"),
ORDER_RECEIVED(2, "已收货"),
ORDER_REFUND(3, "退货");
private Integer type;
private String msg;
OrderShippingStatusEnum(Integer type, String msg) {
this.type = type;
this.msg = msg;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static <T extends OrderShippingStatusEnum> String getType(Integer code, Class<T> t) {
for (T item : t.getEnumConstants()) {
if (item.getType().equals(code)) {
return item.getMsg();
}
}
return "";
}
public static OrderShippingStatusEnum getByCode(Integer code) {
for (OrderShippingStatusEnum v : values()) {
if (v.getType() == code) {
return v;
}
}
return null;
}
public static String getProductStatusEnum(Integer code) {
return getType(code, OrderShippingStatusEnum.class);
}
}
package com.upyuns.platform.rs.website.type;
/**
* @ClassName : OrderStatusEnum
* @Description : 订单状态
* @Author : jiaoruizhen
* 订单状态:0、定制订单无价格 1--创建订单,2--待付款,3--已支付,4--已发货, 5--已收货, 6、已完成 -1、删除,-2、取消, -3 退款
* @Date: 2020-12-12 16:50
*/
public enum OrderStatusEnum {
ORDER_NO_PRICE(0, "定制订单无价格"),
ORDER_CREATED(1, "创建订单"),
ORDER_UNPAID(2, "待付款"),
ORDER_PAID(3, "已支付"),
ORDER_SEND(4, "已发货"),
ORDER_RECEIVED(5, "已收货"),
ORDER_COMPLETE(6, "已完成"),
ORDER_DELETE(-1, "删除"),
ORDER_CANCEL(-2, "取消"),
ORDER_REFUND(-3, "退款");
private Integer type;
private String msg;
OrderStatusEnum(Integer type, String msg) {
this.type = type;
this.msg = msg;
}
public Integer getType() {
return type;
}
public void setType(Integer type) {
this.type = type;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public static <T extends OrderStatusEnum> String getType(Integer code, Class<T> t) {
for (T item : t.getEnumConstants()) {
if (item.getType().equals(code)) {
return item.getMsg();
}
}
return "";
}
public static OrderStatusEnum getByCode(Integer code) {
for (OrderStatusEnum v : values()) {
if (v.getType() == code) {
return v;
}
}
return null;
}
public static String getProductStatusEnum(Integer code) {
return getType(code, OrderStatusEnum.class);
}
}
......@@ -12,7 +12,7 @@ import java.math.BigDecimal;
*/
@Data
public class ItemInfoVo {
private Integer id;
private Long id;
private String detailJson;
private Integer number;
private BigDecimal price;
......
......@@ -3,6 +3,7 @@ package com.upyuns.platform.rs.website.biz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.upyuns.platform.rs.website.entity.OrderItem;
import org.springframework.stereotype.Service;
import com.upyuns.platform.rs.website.entity.OrderEInvoice;
......@@ -52,4 +53,14 @@ public class OrderEInvoiceBiz extends BaseBiz<OrderEInvoiceMapper, OrderEInvoice
return mapper.selectByExample(example);
}
/**
* 根据ID查询所有订单发票
* @param idList
* @return
*/
public List<OrderEInvoice> getOrderEInvoice(List<Integer> idList) {
Example example = new Example(OrderEInvoice.class);
example.createCriteria().andIn("id", idList);
return mapper.selectByExample(example);
}
}
\ No newline at end of file
......@@ -7,18 +7,22 @@ import com.github.wxiaoqi.security.admin.feign.UserFeign;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.OrderUtil;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.upyuns.platform.rs.universal.constant.DictionaryKey;
import com.upyuns.platform.rs.universal.entity.Dictionary;
import com.upyuns.platform.rs.universal.feign.ThirdFeign;
import com.upyuns.platform.rs.website.dto.ItemInfoDto;
import com.upyuns.platform.rs.website.dto.OrderInfoDto;
import com.upyuns.platform.rs.website.dto.UserOrderDto;
import com.upyuns.platform.rs.website.dto.*;
import com.upyuns.platform.rs.website.entity.*;
import com.upyuns.platform.rs.website.mapper.OrderItemMapper;
import com.upyuns.platform.rs.website.type.OrderInvoiceStatusEnum;
import com.upyuns.platform.rs.website.type.OrderShippingStatusEnum;
import com.upyuns.platform.rs.website.type.OrderStatusEnum;
import com.upyuns.platform.rs.website.type.OrderTypeEnum;
import com.upyuns.platform.rs.website.vo.ItemInfoVo;
import org.apache.commons.lang3.StringUtils;
import org.apache.regexp.RE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -30,7 +34,9 @@ import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
/**
* 订单信息
......@@ -129,7 +135,13 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
* @param userOrderDto
* @return
*/
public List<OrderInfo> getUserOrder(UserOrderDto userOrderDto) {
public ObjectRestResponse getUserOrder(UserOrderDto userOrderDto) {
AppUserDTO appUserDTO = userFeign.userDetailByToken(request.getHeader("Authorization")).getData();
if (appUserDTO == null) {
return ObjectRestResponse.createFailedResult(ResultCode.RSTOKEN_EXPIRED_CODE, ResultCode.getMsg(ResultCode.RSTOKEN_EXPIRED_CODE));
}
appUserDTO.setUserid(appUserDTO.getUserid());
Query query = new Query(userOrderDto);
Example example = new Example(OrderInfo.class);
Example orderItemExample = new Example(OrderItem.class);
Example.Criteria orderInfoCriteria = example.createCriteria();
......@@ -148,13 +160,76 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
}
orderInfoCriteria.andNotEqualTo("status", -1);
example.orderBy("updTime").desc();
List<OrderInfo> orderInfoList = mapper.selectByExample(example);
if (orderInfoList != null) {
PageDataVO<OrderInfo> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectByExample(example));
if (pageDataVO != null && pageDataVO.getData() != null) {
fillOrderItem(pageDataVO.getData());
fillOrderEInvoice(pageDataVO.getData());
return ObjectRestResponse.succ(pageDataVO);
}
return ObjectRestResponse.succ(new PageDataVO<>());
}
/**
* 填充订单发票信息
* @param orderInfoList
*/
private void fillOrderEInvoice(List<OrderInfo> orderInfoList) {
List<Integer> orderInvoiceIdList = orderInfoList.stream().map(OrderInfo::getInvoiceId).collect(Collectors.toList());
if (orderInvoiceIdList != null && orderInvoiceIdList.size() > 0) {
List<OrderEInvoice> orderEInvoiceList = orderEInvoiceBiz.getOrderEInvoice(orderInvoiceIdList);
if (orderEInvoiceList != null && orderEInvoiceList.size() > 0) {
Map<Integer, List<OrderEInvoice>> map = orderEInvoiceList.stream().collect(Collectors.groupingBy(OrderEInvoice::getId));
if (map != null && map.size() > 0) {
orderInfoList.parallelStream().forEach(orderInfo -> {
orderInfo.setOrderEInvoice(map.get(orderInfo.getInvoiceId()).get(0));
});
}
}
}
}
/**
* 查询订单详情
* @param orderId
* @return
*/
public OrderInfo getOrderDetail(Long orderId) {
Example example = new Example(OrderInfo.class);
example.createCriteria().andEqualTo("orderId", orderId).andNotEqualTo("status", -1).andNotEqualTo("status", -2);
OrderInfo orderInfo = mapper.selectOneByExample(example);
if (orderInfo == null) {
return null;
}
if (orderInfo.getInvoiceId() != null) {
OrderEInvoice orderEInvoice = orderEInvoiceBiz.selectById(orderInfo.getInvoiceId());
if (orderEInvoice != null) {
orderInfo.setOrderEInvoice(orderEInvoice);
}
}
return new ArrayList<>();
List<OrderItem> orderItemList = orderItemBiz.getByOrderId(orderInfo.getOrderId());
if (orderItemList != null && orderItemList.size() > 0) {
orderInfo.setOrderItemList(orderItemList);
}
return orderInfo;
}
/**
* 填充订单商品
* @param orderInfoList
*/
private void fillOrderItem(List<OrderInfo> orderInfoList) {
List<Long> orderIdList = orderInfoList.stream().map(OrderInfo::getOrderId).collect(Collectors.toList());
List<OrderItem> orderItemList = orderItemBiz.getAllByOrderId(orderIdList);
if (orderItemList != null) {
Map<Long, List<OrderItem>> map = orderItemList.stream().collect(Collectors.groupingBy(OrderItem::getOrderId));
if (map != null && map.size() > 0) {
orderInfoList.parallelStream().forEach(orderInfo -> {
orderInfo.setOrderItemList(map.get(orderInfo.getOrderId()));
});
}
}
}
/**
* 提交订单
......@@ -182,7 +257,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
break;
//行业应用
case INDUSTRY_INFO:
IndustryApplicationInfo industryApplicationInfo = industryApplicationInfoBiz.getOneById(itemInfoDto.getId()).getData();
IndustryApplicationInfo industryApplicationInfo = industryApplicationInfoBiz.getOneById(itemInfoDto.getId().intValue()).getData();
if (industryApplicationInfo != null) {
OrderItem orderItem = new OrderItem();
orderItem.setType(itemInfoDto.getType());
......@@ -192,7 +267,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
orderItem.setName(industryApplicationInfo.getTitle());
orderItem.setItemPic(industryApplicationInfo.getCoverImg());
orderItem.setDetailJson(JSONObject.toJSONString(industryApplicationInfo));
orderItem.setDetailId(industryApplicationInfo.getId());
orderItem.setDetailId(Long.valueOf(industryApplicationInfo.getId()));
orderItemList.add(orderItem);
//总数量
number.updateAndGet(v -> v + itemInfoDto.getNumber());
......@@ -204,7 +279,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
case IMAGE_STORAGE:
ImageInfoRelation imageInfoRelation = imageInfoRelationBiz.selectById(itemInfoDto.getId());
if (imageInfoRelation != null ) {
ImageImgStorage imageImgStorage = imageImgStorageBiz.getDetail(itemInfoDto.getId()).getData();
ImageImgStorage imageImgStorage = imageImgStorageBiz.getDetail(itemInfoDto.getId().intValue()).getData();
if (imageImgStorage != null) {
List<ImageInfoRelation> imageInfoRelationList = new ArrayList<>();
imageInfoRelationList.add(imageInfoRelation);
......@@ -217,7 +292,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
orderItem.setName(imageImgStorage.getName());
orderItem.setItemPic(imageImgStorage.getCoverImg());
orderItem.setDetailJson(JSONObject.toJSONString(imageImgStorage));
orderItem.setDetailId(imageImgStorage.getId());
orderItem.setDetailId(Long.valueOf(imageImgStorage.getId()));
orderItemList.add(orderItem);
//总数量
number.updateAndGet(v -> v + itemInfoDto.getNumber());
......@@ -269,6 +344,7 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
}
orderInfo.setRemark(orderInfoDto.getRemark());
orderInfo.setAmount(new BigDecimal(amount.get()));
orderInfo.setNumber(number.get());
Dictionary dictionary = thirdFeign.findDictionaryByTypeAndCode(DictionaryKey.APP_ORDER, DictionaryKey.SEND_FEE);
if (dictionary != null && StringUtils.isNotBlank(dictionary.getDetail())) {
orderInfo.setFee(new BigDecimal(dictionary.getDetail()));
......@@ -276,19 +352,6 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
if (orderInfo.getFee() != null) {
orderInfo.setTotalAmount(orderInfo.getAmount().add(orderInfo.getFee()));
}
orderInfo.setSendType(orderInfoDto.getSendType());
orderInfo.setType(1);
/**
* 新增订单
*/
orderInfo.setOrderNo(OrderUtil.GetOrderNumber("", OrderUtil.APP_MID));
generateOrder(orderInfo);
orderItemList.parallelStream().forEach(orderItem -> {
if (orderItem != null) {
orderItem.setOrderId(orderInfo.getOrderId());
orderItemBiz.insertSelective(orderItem);
}
});
//订单发票信息
if (orderInfoDto.getUserInvoiceId() != null) {
......@@ -305,12 +368,206 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
orderEInvoice.setContentAccount(userInvoice.getOpenBank() + " " + userInvoice.getAccount());
orderEInvoice.setContentContact(orderInfo.getReceiveAddress() + " " + orderInfo.getReceiveName() + " " + orderInfo.getReceivePhone());
//发票内容
orderEInvoice.setContentTitle("");
if (StringUtils.isNotBlank(orderInfoDto.getInvoiceContent())) {
orderEInvoice.setContentTitle(orderInfoDto.getInvoiceContent());
}
orderEInvoiceBiz.addUpdate(orderEInvoice);
orderInfo.setInvoiceStatus(2);
orderInfo.setInvoiceId(orderEInvoice.getId());
}
}
orderInfo.setSendType(orderInfoDto.getSendType());
orderInfo.setType(1);
/**
* 新增订单
*/
orderInfo.setOrderNo(OrderUtil.GetOrderNumber("", OrderUtil.APP_MID));
generateOrder(orderInfo);
orderItemList.parallelStream().forEach(orderItem -> {
if (orderItem != null) {
orderItem.setOrderId(orderInfo.getOrderId());
orderItemBiz.insertSelective(orderItem);
}
});
return ObjectRestResponse.succ();
}
/**
* 确认收货
* @return
*/
public ObjectRestResponse confirmReceived(Long orderId) {
if (orderId == null) {
return ObjectRestResponse.paramIsEmpty();
}
OrderInfo orderInfo = selectById(orderId);
if (orderInfo == null || orderInfo.getStatus().equals(OrderStatusEnum.ORDER_DELETE.getType())) {
return ObjectRestResponse.createFailedResult(ResultCode.ORDER_NOT_EXIST, ResultCode.getMsg(ResultCode.ORDER_NOT_EXIST));
}
if (!orderInfo.getStatus().equals(OrderStatusEnum.ORDER_SEND.getType())) {
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "订单状态错误");
}
orderInfo.setShippingStatus(OrderShippingStatusEnum.ORDER_RECEIVED.getType());
orderInfo.setStatus(OrderStatusEnum.ORDER_RECEIVED.getType());
updateSelectiveByIdRe(orderInfo);
return ObjectRestResponse.succ();
}
/**
* 发货
* @return
*/
public ObjectRestResponse orderSend(ConfirmReceivedDto confirmReceivedDto) {
if (confirmReceivedDto == null || confirmReceivedDto.getOrderId() == null || StringUtils.isBlank(confirmReceivedDto.getTrackingNumber())) {
return ObjectRestResponse.paramIsEmpty();
}
OrderInfo orderInfo = selectById(confirmReceivedDto.getOrderId());
if (orderInfo == null || orderInfo.getStatus().equals(OrderStatusEnum.ORDER_DELETE.getType())) {
return ObjectRestResponse.createFailedResult(ResultCode.ORDER_NOT_EXIST, ResultCode.getMsg(ResultCode.ORDER_NOT_EXIST));
}
if (!orderInfo.getStatus().equals(OrderStatusEnum.ORDER_PAID.getType())) {
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "订单状态错误");
}
orderInfo.setShippingStatus(OrderShippingStatusEnum.ORDER_SEND.getType());
orderInfo.setStatus(OrderStatusEnum.ORDER_SEND.getType());
orderInfo.setTrackingNumber(confirmReceivedDto.getTrackingNumber());
orderInfo.setTrackingImg(confirmReceivedDto.getTrackingImg());
updateSelectiveByIdRe(orderInfo);
return ObjectRestResponse.succ();
}
/**
* 开发票
* @return
*/
public ObjectRestResponse setInvoice(OrderInvoiceDto orderInvoiceDto) {
if (orderInvoiceDto == null || orderInvoiceDto.getOrderId() == null || StringUtils.isBlank(orderInvoiceDto.getInvoiceUrl())) {
return ObjectRestResponse.paramIsEmpty();
}
OrderInfo orderInfo = selectById(orderInvoiceDto.getOrderId());
if (orderInfo == null || orderInfo.getStatus().equals(OrderStatusEnum.ORDER_DELETE.getType())) {
return ObjectRestResponse.createFailedResult(ResultCode.ORDER_NOT_EXIST, ResultCode.getMsg(ResultCode.ORDER_NOT_EXIST));
}
if (orderInfo.getInvoiceId() != null) {
OrderEInvoice orderEInvoice = orderEInvoiceBiz.selectById(orderInfo.getInvoiceId());
if (orderEInvoice == null) {
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "订单发票不存在");
}
orderEInvoice.setStatus(OrderInvoiceStatusEnum.INVOICE_OPEN.getType());
orderEInvoice.setInvoiceUrl(orderInvoiceDto.getInvoiceUrl());
orderEInvoiceBiz.updateSelectiveByIdRe(orderEInvoice);
orderInfo.setInvoiceStatus(OrderInvoiceStatusEnum.INVOICE_OPEN.getType());
updateSelectiveByIdRe(orderInfo);
} else {
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "订单未开票");
}
return ObjectRestResponse.succ();
}
/**
* 发票发货
* @param confirmReceivedDto
* @return
*/
public ObjectRestResponse invoiceSend(ConfirmReceivedDto confirmReceivedDto) {
if (confirmReceivedDto == null || confirmReceivedDto.getOrderId() == null || StringUtils.isBlank(confirmReceivedDto.getTrackingNumber())) {
return ObjectRestResponse.paramIsEmpty();
}
OrderInfo orderInfo = selectById(confirmReceivedDto.getOrderId());
if (orderInfo == null || orderInfo.getStatus().equals(OrderStatusEnum.ORDER_DELETE.getType())) {
return ObjectRestResponse.createFailedResult(ResultCode.ORDER_NOT_EXIST, ResultCode.getMsg(ResultCode.ORDER_NOT_EXIST));
}
if (!orderInfo.getInvoiceStatus().equals(OrderInvoiceStatusEnum.INVOICE_OPEN.getType())) {
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "订单状态错误");
}
OrderEInvoice orderEInvoice = orderEInvoiceBiz.selectById(orderInfo.getInvoiceId());
if (orderEInvoice == null) {
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "订单发票不存在");
}
orderEInvoice.setTrackingNumber(confirmReceivedDto.getTrackingNumber());
orderEInvoice.setTrackingImg(confirmReceivedDto.getTrackingImg());
orderEInvoiceBiz.updateSelectiveByIdRe(orderEInvoice);
orderInfo.setInvoiceStatus(OrderInvoiceStatusEnum.INVOICE_SEND.getType());
updateSelectiveByIdRe(orderInfo);
return ObjectRestResponse.succ();
}
/**
* 订单发票确认收货
* @param orderId
* @return
*/
public ObjectRestResponse confirmOrderInvoice(Long orderId) {
if (orderId == null) {
return ObjectRestResponse.paramIsEmpty();
}
OrderInfo orderInfo = selectById(orderId);
if (orderInfo == null || orderInfo.getStatus().equals(OrderStatusEnum.ORDER_DELETE.getType())) {
return ObjectRestResponse.createFailedResult(ResultCode.ORDER_NOT_EXIST, ResultCode.getMsg(ResultCode.ORDER_NOT_EXIST));
}
if (!orderInfo.getInvoiceStatus().equals(OrderInvoiceStatusEnum.INVOICE_SEND.getType())) {
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "订单状态错误");
}
orderInfo.setInvoiceStatus(OrderInvoiceStatusEnum.INVOICE_RECEIVED.getType());
updateSelectiveByIdRe(orderInfo);
return ObjectRestResponse.succ();
}
/**
* 取消订单
* @param orderId
* @param remark
* @return
*/
public ObjectRestResponse cancelOrder(Long orderId, String remark) {
if (orderId == null) {
return ObjectRestResponse.paramIsEmpty();
}
OrderInfo orderInfo = selectById(orderId);
if (orderInfo == null || orderInfo.getStatus().equals(OrderStatusEnum.ORDER_DELETE.getType())) {
return ObjectRestResponse.createFailedResult(ResultCode.ORDER_NOT_EXIST, ResultCode.getMsg(ResultCode.ORDER_NOT_EXIST));
}
//订单状态为待支付前, 直接改变状态
if (orderInfo.getStatus() < 3) {
orderInfo.setStatus(OrderStatusEnum.ORDER_CANCEL.getType());
} else if (orderInfo.getStatus() == 3) { //订单已支付
orderInfo.setStatus(OrderStatusEnum.ORDER_CANCEL.getType());
//todo 执行退款操作
} else if (orderInfo.getStatus() > 3) { //已发货订单不可取消
return ObjectRestResponse.createFailedResult(ResultCode.FAILED_CODE, "订单不可取消");
}
if (StringUtils.isNotBlank(remark)) {
orderInfo.setCancelRemark(remark);
}
updateSelectiveByIdRe(orderInfo);
return ObjectRestResponse.succ();
}
/**
* 删除订单
* @param orderId
* @return
*/
public ObjectRestResponse deleteOrder(Long orderId) {
if (orderId == null) {
return ObjectRestResponse.paramIsEmpty();
}
OrderInfo orderInfo = selectById(orderId);
if (orderInfo == null || orderInfo.getStatus().equals(OrderStatusEnum.ORDER_DELETE.getType())) {
return ObjectRestResponse.createFailedResult(ResultCode.ORDER_NOT_EXIST, ResultCode.getMsg(ResultCode.ORDER_NOT_EXIST));
}
orderInfo.setStatus(OrderStatusEnum.ORDER_DELETE.getType());
updateSelectiveByIdRe(orderInfo);
return ObjectRestResponse.succ();
}
}
\ No newline at end of file
......@@ -5,6 +5,9 @@ import org.springframework.stereotype.Service;
import com.upyuns.platform.rs.website.entity.OrderItem;
import com.upyuns.platform.rs.website.mapper.OrderItemMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
/**
* 订单商品信息
......@@ -16,4 +19,26 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
@Service
public class OrderItemBiz extends BaseBiz<OrderItemMapper,OrderItem> {
/**
* 根据订单ID查询所有订单商品
* @param orderIdList
* @return
*/
public List<OrderItem> getAllByOrderId(List<Long> orderIdList) {
Example example = new Example(OrderItem.class);
example.createCriteria().andIn("orderId", orderIdList);
return mapper.selectByExample(example);
}
/**
* 根据订单ID
* @param OrderId
* @return
*/
public List<OrderItem> getByOrderId(Long OrderId) {
Example example = new Example(OrderItem.class);
example.createCriteria().andEqualTo("orderId", OrderId);
return mapper.selectByExample(example);
}
}
\ No newline at end of file
......@@ -126,7 +126,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper, Shoppin
updateSelectiveByIdRe(old);
} else {
ShoppingCartInfo shoppingCartInfo = new ShoppingCartInfo();
shoppingCartInfo.setDetailId(imageImgStorage.getId());
shoppingCartInfo.setDetailId(Long.valueOf(imageImgStorage.getId()));
shoppingCartInfo.setDetailJson(JSONObject.toJSONString(imageImgStorage));
shoppingCartInfo.setPrice(orderInfoDto.getPrice());
shoppingCartInfo.setFilePath(orderInfoDto.getFilePath());
......@@ -159,7 +159,7 @@ public class ShoppingCartInfoBiz extends BaseBiz<ShoppingCartInfoMapper, Shoppin
updateSelectiveByIdRe(old);
} else {
ShoppingCartInfo shoppingCartInfo = new ShoppingCartInfo();
shoppingCartInfo.setDetailId(industryApplicationInfo.getId());
shoppingCartInfo.setDetailId(Long.valueOf(industryApplicationInfo.getId()));
shoppingCartInfo.setDetailJson(JSONObject.toJSONString(industryApplicationInfo));
shoppingCartInfo.setPrice(orderInfoDto.getPrice());
shoppingCartInfo.setFilePath(orderInfoDto.getFilePath());
......
......@@ -22,21 +22,37 @@ public class CustomFormWebController extends BaseController<CustomFormBiz,Custom
@RequestMapping(value = "customIndustry",method = RequestMethod.POST)
public ObjectRestResponse customIndustry(@RequestBody CustomForm entity) {
// if(StrUtil.isNotBlank(entity.getProvinceCode())) {
// entity.setProvinceName(AssertUtils.isFeignSucc(datacenterFegin.queryByCode(entity.getProvinceCode()).getData());
// }
if(StrUtil.isNotBlank(entity.getProvinceCode())) {
entity.setProvinceName(datacenterFegin.queryByCode(entity.getProvinceCode()).getData().getName());
}
if(StrUtil.isNotBlank(entity.getCityCode())) {
entity.setCityName(datacenterFegin.queryByCode(entity.getCityCode()).getData().getName());
}
if(StrUtil.isNotBlank(entity.getAreaCode())) {
entity.setAreaName(datacenterFegin.queryByCode(entity.getAreaCode()).getData().getName());
}
baseBiz.insertSelective(entity);
return ObjectRestResponse.succ();
}
@RequestMapping(value = "customImgStorage",method = RequestMethod.POST)
public ObjectRestResponse customImgStorage(@RequestBody CustomForm entity) {
baseBiz.insertSelective(entity);
return ObjectRestResponse.succ();
}
@RequestMapping(value = "customImageData",method = RequestMethod.POST)
public ObjectRestResponse customImageData(@RequestBody CustomForm entity) {
if(StrUtil.isNotBlank(entity.getProvinceCode())) {
entity.setProvinceName(datacenterFegin.queryByCode(entity.getProvinceCode()).getData().getName());
}
if(StrUtil.isNotBlank(entity.getCityCode())) {
entity.setCityName(datacenterFegin.queryByCode(entity.getCityCode()).getData().getName());
}
if(StrUtil.isNotBlank(entity.getAreaCode())) {
entity.setAreaName(datacenterFegin.queryByCode(entity.getAreaCode()).getData().getName());
}
baseBiz.insertSelective(entity);
return ObjectRestResponse.succ();
}
......
......@@ -5,13 +5,11 @@ import com.github.wxiaoqi.security.common.rest.BaseController;
import com.upyuns.platform.rs.website.biz.OrderInfoBiz;
import com.upyuns.platform.rs.website.dto.ConfirmOrderDto;
import com.upyuns.platform.rs.website.dto.OrderInfoDto;
import com.upyuns.platform.rs.website.dto.UserOrderDto;
import com.upyuns.platform.rs.website.entity.OrderInfo;
import com.upyuns.platform.rs.website.service.ConfirmOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
@RestController
@RequestMapping("orderInfo/web")
......@@ -29,4 +27,14 @@ public class OrderInfoWebController extends BaseController<OrderInfoBiz,OrderInf
public ObjectRestResponse submitOrder(@RequestBody OrderInfoDto orderInfoDto) {
return baseBiz.submitOrder(orderInfoDto);
}
@GetMapping(value = "getOrderList")
public ObjectRestResponse getUserOrder(UserOrderDto userOrderDto) {
return baseBiz.getUserOrder(userOrderDto);
}
@GetMapping(value = "detail")
public ObjectRestResponse getDetail(Long id) {
return ObjectRestResponse.succ(baseBiz.getOrderDetail(id));
}
}
\ No newline at end of file
......@@ -70,10 +70,10 @@ public class ConfirmOrderService {
break;
//行业应用
case INDUSTRY_INFO:
IndustryApplicationInfo industryApplicationInfo = industryApplicationInfoBiz.getOneById(itemInfoDto.getId()).getData();
IndustryApplicationInfo industryApplicationInfo = industryApplicationInfoBiz.getOneById(itemInfoDto.getId().intValue()).getData();
if (industryApplicationInfo != null) {
ItemInfoVo itemInfoVo = new ItemInfoVo();
itemInfoVo.setId(industryApplicationInfo.getId());
itemInfoVo.setId(Long.valueOf(industryApplicationInfo.getId()));
itemInfoVo.setDetailJson(JSONObject.toJSONString(industryApplicationInfo));
itemInfoVo.setImg(industryApplicationInfo.getCoverImg());
itemInfoVo.setNumber(itemInfoDto.getNumber());
......@@ -91,13 +91,13 @@ public class ConfirmOrderService {
case IMAGE_STORAGE:
ImageInfoRelation imageInfoRelation = imageInfoRelationBiz.selectById(itemInfoDto.getId());
if (imageInfoRelation != null ) {
ImageImgStorage imageImgStorage = imageImgStorageBiz.getDetail(itemInfoDto.getId()).getData();
ImageImgStorage imageImgStorage = imageImgStorageBiz.getDetail(itemInfoDto.getId().intValue()).getData();
if (imageImgStorage != null) {
List<ImageInfoRelation> imageInfoRelationList = new ArrayList<>();
imageInfoRelationList.add(imageInfoRelation);
imageImgStorage.setImageInfoRelationList(imageInfoRelationList);
ItemInfoVo itemInfoVo = new ItemInfoVo();
itemInfoVo.setId(imageImgStorage.getId());
itemInfoVo.setId(Long.valueOf(imageImgStorage.getId()));
itemInfoVo.setPrice(imageInfoRelation.getPrice());
itemInfoVo.setType(itemInfoDto.getType());
itemInfoVo.setNumber(itemInfoDto.getNumber());
......@@ -117,7 +117,7 @@ public class ConfirmOrderService {
ShoppingCartInfo shoppingCartInfo = shoppingCartInfoBiz.selectById(itemInfoDto.getId());
if (shoppingCartInfo != null) {
ItemInfoVo itemInfoVo = new ItemInfoVo();
itemInfoVo.setId(shoppingCartInfo.getCartId().intValue());
itemInfoVo.setId(shoppingCartInfo.getCartId());
itemInfoVo.setPrice(shoppingCartInfo.getPrice());
itemInfoVo.setType(shoppingCartInfo.getType());
itemInfoVo.setNumber(itemInfoDto.getNumber());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment