提交 317c12fa 作者: zhenjie

Merge branch 'develop'

...@@ -18,4 +18,4 @@ patches: ...@@ -18,4 +18,4 @@ patches:
images: images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG - name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms
newTag: 37582a668837033ad61d64321c6fa7620ea17d45 newTag: 2e525557874dabcb58b6516aefc612e98bf6e76e
package com.mmc.pms.auth.dto; package com.mmc.pms.auth.dto;
import com.mmc.pms.model.other.dto.RoleInfoDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
...@@ -17,15 +18,16 @@ import java.io.Serializable; ...@@ -17,15 +18,16 @@ import java.io.Serializable;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class LoginSuccessDTO implements Serializable { public class LoginSuccessDTO implements Serializable {
private static final long serialVersionUID = -1200834589953161925L; private static final long serialVersionUID = -1200834589953161925L;
private String token; private String token;
private Integer userAccountId; private Integer userAccountId;
private String accountNo; private String accountNo;
private Integer portType; private Integer portType;
private String uid; private String uid;
private String phoneNum; private String phoneNum;
private String userName; private String userName;
private String nickName; private String nickName;
private CompanyInfoVO companyInfoVO; private CompanyInfoVO companyInfoVO;
// private RoleInfoDTO roleInfo; private RoleInfoDTO roleInfo;
private Integer appUserAccountId;
} }
...@@ -5,435 +5,438 @@ package com.mmc.pms.common; ...@@ -5,435 +5,438 @@ package com.mmc.pms.common;
*/ */
public enum ResultEnum implements BaseErrorInfoInterface { public enum ResultEnum implements BaseErrorInfoInterface {
// 数据操作错误定义 // 数据操作错误定义
SUCCESS("200", "success"), SUCCESS("200", "success"),
BODY_NOT_MATCH("400", "请求的数据格式不符!"), BODY_NOT_MATCH("400", "请求的数据格式不符!"),
SIGNATURE_NOT_MATCH("401", "请求的数字签名不匹配!"), SIGNATURE_NOT_MATCH("401", "请求的数字签名不匹配!"),
NOT_FOUND("404", "未找到该资源!"), NOT_FOUND("404", "未找到该资源!"),
INTERNAL_SERVER_ERROR("500", "服务器内部错误!"), INTERNAL_SERVER_ERROR("500", "服务器内部错误!"),
SERVER_BUSY("503", "服务器正忙,请稍后再试!"), SERVER_BUSY("503", "服务器正忙,请稍后再试!"),
FILE_UPLOAD_ERROR("600", "文件上传有误"), FILE_UPLOAD_ERROR("600", "文件上传有误"),
FILE_UPLOAD_NULL_ERROR("601", "上传的文件不能为空"), FILE_UPLOAD_NULL_ERROR("601", "上传的文件不能为空"),
TOKEN_EXPIRED_ERROR("602", "登录信息已过期,请重新登录"), TOKEN_EXPIRED_ERROR("602", "登录信息已过期,请重新登录"),
TOKEN_INVALID_ERROR("603", "无效的登录信息"), TOKEN_INVALID_ERROR("603", "无效的登录信息"),
VERIFY_CODE_ERROR("604", "验证码错误,请重新输入"), VERIFY_CODE_ERROR("604", "验证码错误,请重新输入"),
TOKEN_REDIS_ERROR("605", "登录失效"), TOKEN_REDIS_ERROR("605", "登录失效"),
AUTH_ACCOUNT_ERROR("606", "当前账号未授权,请先授权"), AUTH_ACCOUNT_ERROR("606", "当前账号未授权,请先授权"),
TOEKN_REPEAT_ERROR("607", "该账号已在其他设备登录,请重新登录"), TOEKN_REPEAT_ERROR("607", "该账号已在其他设备登录,请重新登录"),
TOKEN_NOT_VALID_ERROR("608", "access_token已失效或access_token不是最新的"), TOKEN_NOT_VALID_ERROR("608", "access_token已失效或access_token不是最新的"),
SCHEDULE_SYS_ERROR("703", "系统定时任务执行错误"), SCHEDULE_SYS_ERROR("703", "系统定时任务执行错误"),
FORM_REPEAT_ERROR("704", "操作次数频繁,请稍后重试"), FORM_REPEAT_ERROR("704", "操作次数频繁,请稍后重试"),
DATA_VERSION_ERROR("705", "数据写入版本不一致,请稍后重试。"), DATA_VERSION_ERROR("705", "数据写入版本不一致,请稍后重试。"),
REQUEST_PARAM_ILLEGAL_ERROR("706", "请求参数非法"), REQUEST_PARAM_ILLEGAL_ERROR("706", "请求参数非法"),
DATA_INSERT_ERROR("707", "数据插入失败"), DATA_INSERT_ERROR("707", "数据插入失败"),
SCORE_RELEASE_ERROR("708", "积分发放失败,请重试或联系管理员!"), SCORE_RELEASE_ERROR("708", "积分发放失败,请重试或联系管理员!"),
ENTRY_INTO_FORCE_TIME_SET_ERROR("709", "生效时间不能小于当前时间!"), ENTRY_INTO_FORCE_TIME_SET_ERROR("709", "生效时间不能小于当前时间!"),
INFO_NO_EXISTENCE_OR_STATUS_ERROR("710", "信息不存在或状态有误!"), INFO_NO_EXISTENCE_OR_STATUS_ERROR("710", "信息不存在或状态有误!"),
// 业务操作错误定义 // 业务操作错误定义
CUSTOM_ERROR("-1", "自定义业务错误消息"), CUSTOM_ERROR("-1", "自定义业务错误消息"),
FEIGN_ORDER_SERVLET_ERROR("4001", "访问订单服务失败"), FEIGN_ORDER_SERVLET_ERROR("4001", "访问订单服务失败"),
FEIGN_USER_SERVLET_ERROR("4002", "访问用户服务失败"), FEIGN_USER_SERVLET_ERROR("4002", "访问用户服务失败"),
FEIGN_PAY_SERVLET_ERROR("4003", "访问消耗服务失败"), FEIGN_PAY_SERVLET_ERROR("4003", "访问消耗服务失败"),
DISABLE_ACCOUNT_TOKEN_ERROR("4004", "账号信息变更,登录失效"), DISABLE_ACCOUNT_TOKEN_ERROR("4004", "账号信息变更,登录失效"),
FEIGN_OPERATION_SERVLET_ERROR("4005", "访问行业服务失败"), FEIGN_OPERATION_SERVLET_ERROR("4005", "访问行业服务失败"),
ADMIN_ROLE_REPEAT_ERROR("4006", "操作失败,超级管理员和运营管理员有且只有一个"), ADMIN_ROLE_REPEAT_ERROR("4006", "操作失败,超级管理员和运营管理员有且只有一个"),
FEIGN_FLYER_SERVLET_ERROR("4007", "访问飞手服务失败"), FEIGN_FLYER_SERVLET_ERROR("4007", "访问飞手服务失败"),
FEIGN_REPOORDER_SERVLET_ERROR("4008", "访问订单服务失败"), FEIGN_REPOORDER_SERVLET_ERROR("4008", "访问订单服务失败"),
FEIGN_REPOPAY_SERVLET_ERROR("4009", "访问云仓消耗服务失败"), FEIGN_REPOPAY_SERVLET_ERROR("4009", "访问云仓消耗服务失败"),
FEIGN_REPOUSER_SERVLET_ERROR("4010", "访问云仓用户服务失败"), FEIGN_REPOUSER_SERVLET_ERROR("4010", "访问云仓用户服务失败"),
FEIGN_WARE_SERVLET_ERROR("4010", "访问云仓商品服务失败"), FEIGN_WARE_SERVLET_ERROR("4010", "访问云仓商品服务失败"),
FEIGN_DEVICE_SERVLET_ERROR("4011", "访问云仓设备服务失败"), FEIGN_DEVICE_SERVLET_ERROR("4011", "访问云仓设备服务失败"),
CENTER_USER_SERVLET_ERROR("4012", "访问用户中心服务失败"), CENTER_USER_SERVLET_ERROR("4012", "访问用户中心服务失败"),
GATEWAY_HYSRIX_ERROR("4013", "服务器貌似在开小差~"), GATEWAY_HYSRIX_ERROR("4013", "服务器貌似在开小差~"),
FEIGN_FLYER_PAY_SERVLET_ERROR("4014", "访问飞手消耗服务失败"), FEIGN_FLYER_PAY_SERVLET_ERROR("4014", "访问飞手消耗服务失败"),
MALL_USER_SERVLET_ERROR("4015", "访问机城用户服务失败"), MALL_USER_SERVLET_ERROR("4015", "访问机城用户服务失败"),
PRIMARY_KEY_DEFECT("5001", "主键ID缺失"), PRIMARY_KEY_DEFECT("5001", "主键ID缺失"),
WALLET_NOT_FIND_ERROR("5002", "钱包账户不存在"), WALLET_NOT_FIND_ERROR("5002", "钱包账户不存在"),
PARAM_DEFECT("5004", "参数缺失"), PARAM_DEFECT("5004", "参数缺失"),
LOGIN_ACCOUNT_NOT_EXIT_ERROR("5005", "账号不存在"), LOGIN_ACCOUNT_NOT_EXIT_ERROR("5005", "账号不存在"),
LOGIN_PASSWORD_ERROR("5006", "密码错误"), LOGIN_PASSWORD_ERROR("5006", "密码错误"),
LOGIN_ACCOUNT_STATUS_ERROR("5008", "未登录"), LOGIN_ACCOUNT_STATUS_ERROR("5008", "未登录"),
OPERATE_USER_ORDERCOUNT_ERROR("5007", "当前账号有存在相关订单未关闭"), OPERATE_USER_ORDERCOUNT_ERROR("5007", "当前账号有存在相关订单未关闭"),
WALLET_CASH_NOT_ENOUGH_ERROR("5009", "现金余额不足"), WALLET_CASH_NOT_ENOUGH_ERROR("5009", "现金余额不足"),
AMT_PAID_VERITY_ERROR("5010", "变更额度不在有效范围"), AMT_PAID_VERITY_ERROR("5010", "变更额度不在有效范围"),
CREDIT_NOT_ENOUGH_ERROR("5011", "信用余额不足,当前信用余额:"), CREDIT_NOT_ENOUGH_ERROR("5011", "信用余额不足,当前信用余额:"),
CREDIT_METHOD_ERROR("5012", "变更类型有误"), CREDIT_METHOD_ERROR("5012", "变更类型有误"),
CREDIT_OWED_BEGGER_ERROR("5013", "归还额度不可超过剩余欠款,当前剩余欠款:"), CREDIT_OWED_BEGGER_ERROR("5013", "归还额度不可超过剩余欠款,当前剩余欠款:"),
CASH_ADD_OWED_ERROR("5014", "该账号仍有剩余欠款,请先将全部欠款归还后,再进行充值。"), CASH_ADD_OWED_ERROR("5014", "该账号仍有剩余欠款,请先将全部欠款归还后,再进行充值。"),
WALLET_CREDIT_NOT_ENOUGH_ERROR("5015", "信用余额不足"), WALLET_CREDIT_NOT_ENOUGH_ERROR("5015", "信用余额不足"),
ORDER_PAY_FORMAT_ERROR("5016", "现金和信用金额不能同时为空"), ORDER_PAY_FORMAT_ERROR("5016", "现金和信用金额不能同时为空"),
WALLET_CASH_FREEZE_NOT_ENOUGH_ERROR("5017", "现金的冻结余额不足"), WALLET_CASH_FREEZE_NOT_ENOUGH_ERROR("5017", "现金的冻结余额不足"),
WALLET_CREDIT_FREEZE_NOT_ENOUGH_ERROR("5018", "信用的冻结余额不足"), WALLET_CREDIT_FREEZE_NOT_ENOUGH_ERROR("5018", "信用的冻结余额不足"),
ORDER_CASH_FREEZE_NOT_FIND_ERROR("5019", "现金的冻结余额不存在"), ORDER_CASH_FREEZE_NOT_FIND_ERROR("5019", "现金的冻结余额不存在"),
ORDER_CREDIT_FREEZE_NOT_FIND_ERROR("5019", "信用的冻结余额不存在"), ORDER_CREDIT_FREEZE_NOT_FIND_ERROR("5019", "信用的冻结余额不存在"),
WALLET_BANLANCE_NOT_ENOUGH_ERROR("5020", "现金和信用的余额不足"), WALLET_BANLANCE_NOT_ENOUGH_ERROR("5020", "现金和信用的余额不足"),
WALLET_FREEZE_NOT_ENOUGH_ERROR("5020", "现金和信用的冻结余额不足"), WALLET_FREEZE_NOT_ENOUGH_ERROR("5020", "现金和信用的冻结余额不足"),
CREDIT_REPEAT_NULL_ERROR("5021", "欠款归还不能为空"), CREDIT_REPEAT_NULL_ERROR("5021", "欠款归还不能为空"),
CREDIT_CHANGE_NULL_ERROR("5021", "信用余额变更不能为空"), CREDIT_CHANGE_NULL_ERROR("5021", "信用余额变更不能为空"),
ORDER_TOTAL_COST_ERROR("5022", "结算金额不能大于预支付的金额"), ORDER_TOTAL_COST_ERROR("5022", "结算金额不能大于预支付的金额"),
ORDER_PAY_NOT_ENOUGH_ERROR("5023", "总余额不足,订单无法结算"), ORDER_PAY_NOT_ENOUGH_ERROR("5023", "总余额不足,订单无法结算"),
NOT_MENU_POWER_ERROR("5024", "当前账号无平台使用权限"), NOT_MENU_POWER_ERROR("5024", "当前账号无平台使用权限"),
OPENID_NOT_FIND_ERROR("5025", "OPENID未注册,请登录授权后调用"), OPENID_NOT_FIND_ERROR("5025", "OPENID未注册,请登录授权后调用"),
PASSWORD_INCONSISTENT("5026", "新密码与确认密码不一致,请确认一致"), PASSWORD_INCONSISTENT("5026", "新密码与确认密码不一致,请确认一致"),
WX_ACCESS_TOKEN_ERROR("5027", "获取微信AccessToken失败"), WX_ACCESS_TOKEN_ERROR("5027", "获取微信AccessToken失败"),
WX_NOT_REL_ERROR("5028", "获取微信公众号用户信息失败"), WX_NOT_REL_ERROR("5028", "获取微信公众号用户信息失败"),
WX_NOT_SEND_MSG_PARAM_ERROR("5029", "userId和openId至少一个不为空"), WX_NOT_SEND_MSG_PARAM_ERROR("5029", "userId和openId至少一个不为空"),
APPLET_QR_CODE_CREATE_ERROR("5030", "生成小程序码错误:"), APPLET_QR_CODE_CREATE_ERROR("5030", "生成小程序码错误:"),
APPLET_USER_ACCESS_TOKE_ERROR("5031", "获取accessToken签名校验失败"), APPLET_USER_ACCESS_TOKE_ERROR("5031", "获取accessToken签名校验失败"),
REBATE_AMT_NOT_MIN_ERROR("5032", "金额不足300元无法提现,300元为最低门槛"), REBATE_AMT_NOT_MIN_ERROR("5032", "金额不足300元无法提现,300元为最低门槛"),
REBATE_AMT_NOT_ENOUGH_ERROR("5033", "申请失败,超过可提现的金额"), REBATE_AMT_NOT_ENOUGH_ERROR("5033", "申请失败,超过可提现的金额"),
BANK_INFO_NOT_SAVE_ERROR("5034", "请先完善收款账号,才可以申请提现"), BANK_INFO_NOT_SAVE_ERROR("5034", "请先完善收款账号,才可以申请提现"),
REBATE_APPLY_STATUS_ERROR("5035", "提现状态有误"), REBATE_APPLY_STATUS_ERROR("5035", "提现状态有误"),
REBATE_INFO_NOT_FIND_ERROR("5036", "提现申请单信息不存在"), REBATE_INFO_NOT_FIND_ERROR("5036", "提现申请单信息不存在"),
REBATE_FAIL_EXIT_ERROR("5037", "你的收款账号信息有误,请修改信息后重新申请提现。"), REBATE_FAIL_EXIT_ERROR("5037", "你的收款账号信息有误,请修改信息后重新申请提现。"),
REBATE_AMT_FORMAT_ERROR("5038", "提现金额必须大于0元"), REBATE_AMT_FORMAT_ERROR("5038", "提现金额必须大于0元"),
REBATE_REPEAT_CHECK_ERROR("5039", "提现申请单已被审批,切勿重复审批。"), REBATE_REPEAT_CHECK_ERROR("5039", "提现申请单已被审批,切勿重复审批。"),
CHOOSE_FLYER_NUM_ERROR("5040", "请至少选中一个飞手。"), CHOOSE_FLYER_NUM_ERROR("5040", "请至少选中一个飞手。"),
CHOOSE_FLYER_MORE_NUM_ERROR("5041", "暂只支持一个订单只能指派一个飞手。"), CHOOSE_FLYER_MORE_NUM_ERROR("5041", "暂只支持一个订单只能指派一个飞手。"),
ORDER_NO_EXIT_ERROR("5042", "订单信息不存在。"), ORDER_NO_EXIT_ERROR("5042", "订单信息不存在。"),
ORDER_STATUS_ERROR("5043", "订单状态流程有误。"), ORDER_STATUS_ERROR("5043", "订单状态流程有误。"),
INTERFACE_NOT_INVAILD("5044", "接口已废弃或不存在"), INTERFACE_NOT_INVAILD("5044", "接口已废弃或不存在"),
PAPER_CODE_NOT_INVAILD("5045", "接口已废弃或不存在"), PAPER_CODE_NOT_INVAILD("5045", "接口已废弃或不存在"),
PHONE_INVAILD_ERROR("5046", "无效的手机号"), PHONE_INVAILD_ERROR("5046", "无效的手机号"),
TIME_CODE_INVAILD_ERROR("5047", "无效的时间编码"), TIME_CODE_INVAILD_ERROR("5047", "无效的时间编码"),
REPEACT_COMMIT_ERROR("5048", "已提交,切勿重复提交"), REPEACT_COMMIT_ERROR("5048", "已提交,切勿重复提交"),
IMPORT_EXCEL_ERROR("5049", "excel导入失败"), IMPORT_EXCEL_ERROR("5049", "excel导入失败"),
REQ_SMS_CODE_ERROR("5050", "注册码格式有误"), REQ_SMS_CODE_ERROR("5050", "注册码格式有误"),
SKU_NOT_PRICE_ERROR("5051", "当前SKU未配置价格"), SKU_NOT_PRICE_ERROR("5051", "当前SKU未配置价格"),
SKU_NOT_ENOUGH_ERROR("5052", "套餐(sku)数量不足"), SKU_NOT_ENOUGH_ERROR("5052", "套餐(sku)数量不足"),
LEASE_DATE_MATH_ERROR("5053", "租期开始日不能大于结束日"), LEASE_DATE_MATH_ERROR("5053", "租期开始日不能大于结束日"),
ADD_LEASE_ADDR_ERROR("5054", "请选择收货方式"), ADD_LEASE_ADDR_ERROR("5054", "请选择收货方式"),
SHOP_NEED_PHONE_ERROR("5055", "门店自取需要您的联系电话,请填写联系电话"), SHOP_NEED_PHONE_ERROR("5055", "门店自取需要您的联系电话,请填写联系电话"),
ORDER_POWER_ERROR("5056", "订单不存在或你无权操作该订单"), ORDER_POWER_ERROR("5056", "订单不存在或你无权操作该订单"),
ORDER_AUTH_ERROR("5057", "请完成认证再下单"), ORDER_AUTH_ERROR("5057", "请完成认证再下单"),
EXPRESS_RETURN_ERROR("5058", "请完善物流单号和物流公司"), EXPRESS_RETURN_ERROR("5058", "请完善物流单号和物流公司"),
SHOP_RETURN_ERROR("5059", "请选择门店"), SHOP_RETURN_ERROR("5059", "请选择门店"),
ORDER_REFUND_EXIT_ERROR("5060", "该订单已提交过退款申请,请勿重复申请。"), ORDER_REFUND_EXIT_ERROR("5060", "该订单已提交过退款申请,请勿重复申请。"),
ORDER_EXPRESS_ERROR("5061", "获取订单物流信息有误。"), ORDER_EXPRESS_ERROR("5061", "获取订单物流信息有误。"),
ORDER_PAY_JOB_ERROR("5062", "执行定时任务有误"), ORDER_PAY_JOB_ERROR("5062", "执行定时任务有误"),
NO_AUTH_ORDER_ERROR("5063", "请完成企业认证或实名认证后再进行下单"), NO_AUTH_ORDER_ERROR("5063", "请完成企业认证或实名认证后再进行下单"),
WARE_NOT_ENOUGH_ERROR("5064", "商品数量不足"), WARE_NOT_ENOUGH_ERROR("5064", "商品数量不足"),
EX_INFO_ERROR("5065", "物流信息不完善"), EX_INFO_ERROR("5065", "物流信息不完善"),
NOT_REAL_AUTH_ERROR("5066", "请完成实名认证后再进行操作"), NOT_REAL_AUTH_ERROR("5066", "请完成实名认证后再进行操作"),
REBATE_NOT_ENOUGH_ERROR("5067", "提现申请金额需在10至8000元范围之内"), REBATE_NOT_ENOUGH_ERROR("5067", "提现申请金额需在10至8000元范围之内"),
MORE_THAN_LIMIT_ERROR("5067", "提现申请金额需在0.1至98000元范围之内"), MORE_THAN_LIMIT_ERROR("5067", "提现申请金额需在0.1至98000元范围之内"),
FLYER_ENT_MORE_THAN_LIMIT_ERROR("50670", "飞手机构用户银行卡单笔最低10元,最高100,000元"), FLYER_ENT_MORE_THAN_LIMIT_ERROR("50670", "飞手机构用户银行卡单笔最低10元,最高100,000元"),
FLYER_MORE_THAN_LIMIT_ERROR("50671", "飞手个人用户银行卡单笔最低10元,最高5,000元"), FLYER_MORE_THAN_LIMIT_ERROR("50671", "飞手个人用户银行卡单笔最低10元,最高5,000元"),
MORE_THAN_LIMIT_TODAY_ERROR("50672", "单个账户每月提现额度为100,000元"), MORE_THAN_LIMIT_TODAY_ERROR("50672", "单个账户每月提现额度为100,000元"),
SYSTEM_AMT_NOT_ENOUGH_ERROR("5068", "系统处理中,请稍后再试。"), SYSTEM_AMT_NOT_ENOUGH_ERROR("5068", "系统处理中,请稍后再试。"),
FEIGN_XZH_SERVLET_ERROR("5069", "访问线上支付接口服务失败"), FEIGN_XZH_SERVLET_ERROR("5069", "访问线上支付接口服务失败"),
XZH_SERVLET_ERROR("5070", "调用线上支付失败:"), XZH_SERVLET_ERROR("5070", "调用线上支付失败:"),
XZH_FAIL_ERROR("5071", "支付服务失败:"), XZH_FAIL_ERROR("5071", "支付服务失败:"),
REFUSE_COUNT_ERROR("5072", "今日拒绝的次数已达上限,暂不可参与抢单"), REFUSE_COUNT_ERROR("5072", "今日拒绝的次数已达上限,暂不可参与抢单"),
APPLY_ORDER_COUNT_ERROR("5073", "请勿重复接单"), APPLY_ORDER_COUNT_ERROR("5073", "请勿重复接单"),
ORDER_ARRIVE_ERROR("5074", "抢单失败,订单已被指派"), ORDER_ARRIVE_ERROR("5074", "抢单失败,订单已被指派"),
REST_APPLY_ORDER_ERROR("5075", "请先开启接单状态后再进行抢单"), REST_APPLY_ORDER_ERROR("5075", "请先开启接单状态后再进行抢单"),
EVALUATED_ERROR("5076", "您已经评价过啦!"), EVALUATED_ERROR("5076", "您已经评价过啦!"),
BACKET_TYPE_ERROR("5077", "红包类型有误"), BACKET_TYPE_ERROR("5077", "红包类型有误"),
BACKET_NOT_ENOUGH_ERROR("5078", "红包已被抢光"), BACKET_NOT_ENOUGH_ERROR("5078", "红包已被抢光"),
USER_PHONE_AUTH_ERROR("5079", "请授权登录后领取"), USER_PHONE_AUTH_ERROR("5079", "请授权登录后领取"),
TOKEN_REQUIRED_ERROR("5080", "Please bring a token"), TOKEN_REQUIRED_ERROR("5080", "Please bring a token"),
UNIONID_NOT_ERROR("5081", "UnionId不能为空"), UNIONID_NOT_ERROR("5081", "UnionId不能为空"),
OPENID_NOT_ERROR("5081", "云享飞openid、云飞手openid、云仓openid、无人机城openid至少要有一个"), OPENID_NOT_ERROR("5081", "云享飞openid、云飞手openid、云仓openid、无人机城openid至少要有一个"),
NO_EVALUATED_ERROR("5090", "暂无评价信息!"), NO_EVALUATED_ERROR("5090", "暂无评价信息!"),
DAY_NUM_ERROR("5091", "天数有误"), DAY_NUM_ERROR("5091", "天数有误"),
TASK_TYPE_ERROR("5092", "您的账号类型为个人飞手,只能抢任务人数1人的订单。"), TASK_TYPE_ERROR("5092", "您的账号类型为个人飞手,只能抢任务人数1人的订单。"),
TASK_FLYER_COUNT_LESS_ERROR("5093", "机构认证的飞手多于任务需要的飞手才可以抢单。"), TASK_FLYER_COUNT_LESS_ERROR("5093", "机构认证的飞手多于任务需要的飞手才可以抢单。"),
FLYER_REBATE_ERROR("5094", "提现失败,请稍后重试"), FLYER_REBATE_ERROR("5094", "提现失败,请稍后重试"),
OPERATION_SYS_ERROR("5095", "操作失败,请稍后重试"), OPERATION_SYS_ERROR("5095", "操作失败,请稍后重试"),
WAG_CHECK_STATUS_ERROR("5096", "操作失败,未通过或待确认状态才能进行重新编辑"), WAG_CHECK_STATUS_ERROR("5096", "操作失败,未通过或待确认状态才能进行重新编辑"),
EXPORT_NO_DATA_ERROR("5097", "查询到当前符合条件的数据为0条"), EXPORT_NO_DATA_ERROR("5097", "查询到当前符合条件的数据为0条"),
WAG_ZERO_ERROR("5098", "工资抵扣后当月工资不能少于0元"), WAG_ZERO_ERROR("5098", "工资抵扣后当月工资不能少于0元"),
WAG_REPEAT_DATE_ERROR("5099", "操作失败,工资日期重复:"), WAG_REPEAT_DATE_ERROR("5099", "操作失败,工资日期重复:"),
BUY_NUM_ERROR("5100", "购买数量必须大于0"), BUY_NUM_ERROR("5100", "购买数量必须大于0"),
SHOP_CAR_ERROR("5101", "购物车信息不存在"), SHOP_CAR_ERROR("5101", "购物车信息不存在"),
GOODS_VERSION_ERROR("5102", "操作失败,当前商品已经发生信息变更,请刷新后重试"), GOODS_VERSION_ERROR("5102", "操作失败,当前商品已经发生信息变更,请刷新后重试"),
WAG_DETAIL_COUNT_ERROR("5103", "账单天数必须大于0"), WAG_DETAIL_COUNT_ERROR("5103", "账单天数必须大于0"),
WAG_TERM_PARAM_ERROR("5104", "飞手工资、结算基数、操作三个选项必须填一个"), WAG_TERM_PARAM_ERROR("5104", "飞手工资、结算基数、操作三个选项必须填一个"),
IMPORT_PARAM_ERROR("5105", "导入的数据行不能为空或者格式错误"), IMPORT_PARAM_ERROR("5105", "导入的数据行不能为空或者格式错误"),
SHOP_GOODS_NOT_ERROR("5106", "当前商品已下架或已删除"), SHOP_GOODS_NOT_ERROR("5106", "当前商品已下架或已删除"),
ALL_PAY_ERROR("5107", "当前订单为分期付款,请先上传尾款凭证"), ALL_PAY_ERROR("5107", "当前订单为分期付款,请先上传尾款凭证"),
FLYER_EVLT_PARAM_ERROR("5108", "飞手评分参数有误,请检查"), FLYER_EVLT_PARAM_ERROR("5108", "飞手评分参数有误,请检查"),
FLYER_REPEAT_BIND_ERROR("5108", "飞手已被绑定过,请勿重复绑定"), FLYER_REPEAT_BIND_ERROR("5108", "飞手已被绑定过,请勿重复绑定"),
FLYER_NUM_BIND_ERROR("5108", "飞手数量有误,本任务需要的飞手人数为:"), FLYER_NUM_BIND_ERROR("5108", "飞手数量有误,本任务需要的飞手人数为:"),
FLYER_ORDER_TYPE_ERROR("5110", "飞手类型有误,该订单只允许个人飞手接单"), FLYER_ORDER_TYPE_ERROR("5110", "飞手类型有误,该订单只允许个人飞手接单"),
FLYER_ENT_ORDER_TYPE_ERROR("5111", "飞手类型有误,该订单只允许飞手机构接单"), FLYER_ENT_ORDER_TYPE_ERROR("5111", "飞手类型有误,该订单只允许飞手机构接单"),
PHONE_NUM_EXIT_ERROR("5112", "手机号已存在"), PHONE_NUM_EXIT_ERROR("5112", "手机号已存在"),
FLYER_UN_BIND_ERROR("5113", "飞手已被解绑,请勿重复解绑"), FLYER_UN_BIND_ERROR("5113", "飞手已被解绑,请勿重复解绑"),
REPEAT_NOTIFICATION("5114", "您已对此订单进行过催付款操作"), REPEAT_NOTIFICATION("5114", "您已对此订单进行过催付款操作"),
FLYER_WORK_ERROR("5115", "指派飞手失败,飞手休息中:"), FLYER_WORK_ERROR("5115", "指派飞手失败,飞手休息中:"),
DISABLE_APPLY_ORDER_ERROR("5116", "当前时间此订单不可抢"), DISABLE_APPLY_ORDER_ERROR("5116", "当前时间此订单不可抢"),
COMPANY_EXIT_ERROR("5117", "单位名称已存在"), COMPANY_EXIT_ERROR("5117", "单位名称已存在"),
COMPANY_NOT_BIND_ERROR("5118", "未绑定单位,请先绑定单位"), COMPANY_NOT_BIND_ERROR("5118", "未绑定单位,请先绑定单位"),
COMPANY_REMOVE_ERROR("5119", "删除失败,请先移除该单位的账号信息"), COMPANY_REMOVE_ERROR("5119", "删除失败,请先移除该单位的账号信息"),
COMPANY_REMOVE_CHILD_ERROR("5120", "删除失败,请先移除该单位的子级单位"), COMPANY_REMOVE_CHILD_ERROR("5120", "删除失败,请先移除该单位的子级单位"),
EXIST_THE_SAME_GOODS_ERROR("5121", "购物车已存在您选择的商品"), EXIST_THE_SAME_GOODS_ERROR("5121", "购物车已存在您选择的商品"),
// clientOAuth // clientOAuth
OAUTH_CLIENT_NOT_FOUND("6404", "client_id不存在或已注销"), OAUTH_CLIENT_NOT_FOUND("6404", "client_id不存在或已注销"),
OAUTH_SECRET_ERROR("6405", "client_secret有误"), OAUTH_SECRET_ERROR("6405", "client_secret有误"),
OAUTH_AUTHORIZE_ERROR("6406", "当前账号未获得任何授权,请确认"), OAUTH_AUTHORIZE_ERROR("6406", "当前账号未获得任何授权,请确认"),
OAUTH_API_AUTH_ERROR("6407", "当前资源未被授权"), OAUTH_API_AUTH_ERROR("6407", "当前资源未被授权"),
OAUTH_CREATE_TOKEN_ERROR("6408", "系统内部错误,获取accessToken失败,"), OAUTH_CREATE_TOKEN_ERROR("6408", "系统内部错误,获取accessToken失败,"),
PWD_CREATE_ERROR("6001", "创建密码失败"), PWD_CREATE_ERROR("6001", "创建密码失败"),
PWD_CONPARED_ERROR("6002", "密码错误"), PWD_CONPARED_ERROR("6002", "密码错误"),
PWD_ALERT_ERROR("6003", "密码不一致"), PWD_ALERT_ERROR("6003", "密码不一致"),
PWD_REQUEST_AUTH_ERROR("6003", "密码请求验证"), PWD_REQUEST_AUTH_ERROR("6003", "密码请求验证"),
APPLET_PORT_TYPE_ERROR("7001", "小程序端口类型错误"), APPLET_PORT_TYPE_ERROR("7001", "小程序端口类型错误"),
APPLET_GET_OPENID_ERROR("7002", "获取小程序openid失败"), APPLET_GET_OPENID_ERROR("7002", "获取小程序openid失败"),
UPDATE_USER_ACCOUNT_REPEAT("7003", "修改后的账户名已存在"), UPDATE_USER_ACCOUNT_REPEAT("7003", "修改后的账户名已存在"),
ADD_USER_ACCOUNT_NAME_EXISTS("7004", "新增账户名已经存在"), ADD_USER_ACCOUNT_NAME_EXISTS("7004", "新增账户名已经存在"),
ACCOUNT_NOT_FIND_ERROR("8000", "账号信息不存在"), ACCOUNT_NOT_FIND_ERROR("8000", "账号信息不存在"),
REPEAT_SOFT_DELETE("8001", "账号已删除"), REPEAT_SOFT_DELETE("8001", "账号已删除"),
ADMIN_ROLE_DELETE_ERROR("8002", "此账号为管理员账号,禁止删除"), ADMIN_ROLE_DELETE_ERROR("8002", "此账号为管理员账号,禁止删除"),
ROLE_ADMIN_DELETE_ERROR("8003", "此角色为管理员角色,禁止删除"), ROLE_ADMIN_DELETE_ERROR("8003", "此角色为管理员角色,禁止删除"),
ROLE_NAME_REPEAT_ERROR("8004", "角色名已存在"), ROLE_NAME_REPEAT_ERROR("8004", "角色名已存在"),
ROLE_AVL_USER_DELETE_ERROR("8005", "此角色尚有可用账号,请将所有账号移除后在进行操作"), ROLE_AVL_USER_DELETE_ERROR("8005", "此角色尚有可用账号,请将所有账号移除后在进行操作"),
ROLE_AVL_USER_STATUS_ERROR("8006", "此角色尚有可用账号,请将所有账号禁用后在进行操作"), ROLE_AVL_USER_STATUS_ERROR("8006", "此角色尚有可用账号,请将所有账号禁用后在进行操作"),
ROLE_SYSTEM_DELETE_ERROR("8007", "此角色为系统角色,禁止删除"), ROLE_SYSTEM_DELETE_ERROR("8007", "此角色为系统角色,禁止删除"),
ADMIN_ROLE_POWER_ERROR("8008", "禁止修改管理类角色权限"), ADMIN_ROLE_POWER_ERROR("8008", "禁止修改管理类角色权限"),
SYSTEM_ROLE_POWER_ERROR("8009", "禁止修改系统类角色权限"), SYSTEM_ROLE_POWER_ERROR("8009", "禁止修改系统类角色权限"),
ROLE_SELF_POWER_ERROR("8010", "禁止修改与当前登录账号角色相同的角色权限"), ROLE_SELF_POWER_ERROR("8010", "禁止修改与当前登录账号角色相同的角色权限"),
ADMIN_ACCOUNT_DISABLE_ERROR("8011", "此账号为管理员账号,禁用失败"), ADMIN_ACCOUNT_DISABLE_ERROR("8011", "此账号为管理员账号,禁用失败"),
OPERATE_USER_DEL_ERROR("8012", "该账号仍有进行中的订单需要负责,请先移交订单后再删除。"), OPERATE_USER_DEL_ERROR("8012", "该账号仍有进行中的订单需要负责,请先移交订单后再删除。"),
OPERATE_USER_DISABLED_ERROR("8013", "该账号仍有进行中的订单需要负责,请先移交订单后再禁用。"), OPERATE_USER_DISABLED_ERROR("8013", "该账号仍有进行中的订单需要负责,请先移交订单后再禁用。"),
DELETE_USER_UNFILLED_ORDER_EXIST("9001", "平台中有此账号相关的订单,不可删除此账号"), DELETE_USER_UNFILLED_ORDER_EXIST("9001", "平台中有此账号相关的订单,不可删除此账号"),
STOP_UNFILLED_ORDER_EXIST("9002", "平台中有此账号相关的订单正在进行中,不可停用此账号"), STOP_UNFILLED_ORDER_EXIST("9002", "平台中有此账号相关的订单正在进行中,不可停用此账号"),
ACCOUNT_ALREADY_DELETED("10001", "此账号已经被删除"), ACCOUNT_ALREADY_DELETED("10001", "此账号已经被删除"),
ACCOUNT_ALREADY_STOP("10002", "此账号已经被停用,不能登录此小程序,详情请联系管理员"), ACCOUNT_ALREADY_STOP("10002", "此账号已经被停用,不能登录此小程序,详情请联系管理员"),
INDUSTRY_NAME_CREATE_ERROR("20001", "行业名称请勿重复,请重新输入"), INDUSTRY_NAME_CREATE_ERROR("20001", "行业名称请勿重复,请重新输入"),
INSPECTION_NAME_CREATE_ERROR("20002", "服务名称请勿重复,请重新输入"), INSPECTION_NAME_CREATE_ERROR("20002", "服务名称请勿重复,请重新输入"),
INSPECTION_REPEAT("20003", "绑定服务重复"), INSPECTION_REPEAT("20003", "绑定服务重复"),
INDUSTRY_REPEAT("20004", "绑定行业重复"), INDUSTRY_REPEAT("20004", "绑定行业重复"),
INSERT_INDUSTRY_SUCCESS("20005", "新增行业成功"), INSERT_INDUSTRY_SUCCESS("20005", "新增行业成功"),
UPDATE_INDUSTRY_SUCCESS("20006", "修改行业成功"), UPDATE_INDUSTRY_SUCCESS("20006", "修改行业成功"),
DELETE_INDUSTRY_SUCCESS("20007", "删除行业成功"), DELETE_INDUSTRY_SUCCESS("20007", "删除行业成功"),
INSERT_INSPECTION_SUCCESS("20008", "新增服务成功"), INSERT_INSPECTION_SUCCESS("20008", "新增服务成功"),
UPDATE_INSPECTION_SUCCESS("20009", "修改服务成功"), UPDATE_INSPECTION_SUCCESS("20009", "修改服务成功"),
DELETE_INSPECTION_SUCCESS("20010", "删除服务成功"), DELETE_INSPECTION_SUCCESS("20010", "删除服务成功"),
SORT_PARAMETER_ERROR("28199", "排序参数错误"), SORT_PARAMETER_ERROR("28199", "排序参数错误"),
OPRATING_FREQUENCY_TOO_HIGH("28449", "更新频率过快,请重试"), OPRATING_FREQUENCY_TOO_HIGH("28449", "更新频率过快,请重试"),
INSERT_INDUSTRY_INSPECTION_SUCCESS("20011", "添加对应服务成功"), INSERT_INDUSTRY_INSPECTION_SUCCESS("20011", "添加对应服务成功"),
INSERT_INSPECTION_INDUSTRY_SUCCESS("20012", "添加对应行业成功"), INSERT_INSPECTION_INDUSTRY_SUCCESS("20012", "添加对应行业成功"),
DELETE_INDUSTRY_INSPECTION_SUCCESS("20013", "删除对应服务成功"), DELETE_INDUSTRY_INSPECTION_SUCCESS("20013", "删除对应服务成功"),
DELETE_INSPECTION_INDUSTRY_SUCCESS("20014", "删除对应行业成功"), DELETE_INSPECTION_INDUSTRY_SUCCESS("20014", "删除对应行业成功"),
INSERT_INDUSTRY_SHELF_SUCCESS("20015", "行业上架成功"), INSERT_INDUSTRY_SHELF_SUCCESS("20015", "行业上架成功"),
DELETE_INDUSTRY_SHELF_SUCCESS("20016", "行业下架成功"), DELETE_INDUSTRY_SHELF_SUCCESS("20016", "行业下架成功"),
INSERT_INSPECTION_SHELF_SUCCESS("20017", "服务上架成功"), INSERT_INSPECTION_SHELF_SUCCESS("20017", "服务上架成功"),
DELETE_INSPECTION_SHELF_SUCCESS("20018", "服务下架成功"), DELETE_INSPECTION_SHELF_SUCCESS("20018", "服务下架成功"),
DELETE_INSPECTION_ERROR("20022", "该服务仍有未完成的订单,不可删除"), DELETE_INSPECTION_ERROR("20022", "该服务仍有未完成的订单,不可删除"),
INSPECTION_NOT_EXIST("20023", "很抱歉,目前该服务已下架"), INSPECTION_NOT_EXIST("20023", "很抱歉,目前该服务已下架"),
FAKE_NUM_CREATE_ERROR("20024", "输入的数据有误,请重新输入!"), FAKE_NUM_CREATE_ERROR("20024", "输入的数据有误,请重新输入!"),
WORK_TYPE_NAME_ERROR("20026", "服务作业类型重复,请重新输入"), WORK_TYPE_NAME_ERROR("20026", "服务作业类型重复,请重新输入"),
EXIST_BINDING_INSPECTION_ERROR("20027", "此作业类型被服务绑定,删除失败!"), EXIST_BINDING_INSPECTION_ERROR("20027", "此作业类型被服务绑定,删除失败!"),
UPLOAD_IMG_ERROR("20019", "请选择jpg,png,jpeg格式的图片"), UPLOAD_IMG_ERROR("20019", "请选择jpg,png,jpeg格式的图片"),
UPLOAD_VIDEO_ERROR("20020", "请选择MP4,avi,mov,mkv格式的视频"), UPLOAD_VIDEO_ERROR("20020", "请选择MP4,avi,mov,mkv格式的视频"),
UPLOAD_DOC_ERROR("20021", "请选择doc,ppt,pdf,xls格式的文件"), UPLOAD_DOC_ERROR("20021", "请选择doc,ppt,pdf,xls格式的文件"),
UPLOAD_IMG_LESS_3M_ERROR("20022", "请上传小于3M的图片"), UPLOAD_IMG_LESS_3M_ERROR("20022", "请上传小于3M的图片"),
INSERT_ORDER_SUCCESS("21000", "新增订单成功"), INSERT_ORDER_SUCCESS("21000", "新增订单成功"),
UPDATE_ORDER_SUCCESS("21001", "修改订单成功"), UPDATE_ORDER_SUCCESS("21001", "修改订单成功"),
ORDER_TRANS_SUCCESS("21002", "订单移交成功"), ORDER_TRANS_SUCCESS("21002", "订单移交成功"),
ORDER_EVALUATE_SUCCESS("21003", "订单评价完成"), ORDER_EVALUATE_SUCCESS("21003", "订单评价完成"),
ORDER_BEFORE_PAY_ERROR("21004", "订单预支付失败"), ORDER_BEFORE_PAY_ERROR("21004", "订单预支付失败"),
ORDER_CLOSE_PAY_ERROR("21005", "订单结算支付失败"), ORDER_CLOSE_PAY_ERROR("21005", "订单结算支付失败"),
INSERT_ORDER_DETAIL_SUCCESS("21006", "新增订单动态成功"), INSERT_ORDER_DETAIL_SUCCESS("21006", "新增订单动态成功"),
CHECK_USER_ERROR("22001", "用户未通过验证"), CHECK_USER_ERROR("22001", "用户未通过验证"),
GET_ORDER_LIST_ERROR("22002", "获取订单列表失败"), GET_ORDER_LIST_ERROR("22002", "获取订单列表失败"),
COMMANT_CAR_NAME_EXIST("22003", "指挥车名字已存在,请重新输入"), COMMANT_CAR_NAME_EXIST("22003", "指挥车名字已存在,请重新输入"),
// 认证提示 // 认证提示
APP_CODE_ERROR("30301", "appcode 错误"), APP_CODE_ERROR("30301", "appcode 错误"),
REQUE_ENVIROMENT_ERROR("30302", "请求的 Method、Path 或者环境错误"), REQUE_ENVIROMENT_ERROR("30302", "请求的 Method、Path 或者环境错误"),
REQUEST_PARAMETER_ERROR("30303", "请求参数错误"), REQUEST_PARAMETER_ERROR("30303", "请求参数错误"),
SERVICE_NOT_AUTHORIZED("30304", "服务未被授权(或URL和Path不正确)"), SERVICE_NOT_AUTHORIZED("30304", "服务未被授权(或URL和Path不正确)"),
TIMES_USED_UP("30305", "很抱歉,目前我们的实名认证次数已达上限,正在处理中,请稍后再进行认证。"), TIMES_USED_UP("30305", "很抱歉,目前我们的实名认证次数已达上限,正在处理中,请稍后再进行认证。"),
OTHER_ERROR("30306", "其他错误/服务次数用完"), OTHER_ERROR("30306", "其他错误/服务次数用完"),
LIVE_AUTHENTICATION_FAILED("3824", "活体认证失败"), LIVE_AUTHENTICATION_FAILED("3824", "活体认证失败"),
ID_INFO_AND_ID_card_MISMATCH("3904", "身份信息与身份证不匹配"), ID_INFO_AND_ID_card_MISMATCH("3904", "身份信息与身份证不匹配"),
LIVE_AUTHENTICATION_SUCESS("3999", "活体验证成功"), LIVE_AUTHENTICATION_SUCESS("3999", "活体验证成功"),
NO_REAL_NAME("3854", "用户未实名认证"), NO_REAL_NAME("3854", "用户未实名认证"),
URL_FORMAT_ERROR("37462", "URL格式错误"), URL_FORMAT_ERROR("37462", "URL格式错误"),
URL_ADDRESS_ERROR("36752", "URL地址错误"), URL_ADDRESS_ERROR("36752", "URL地址错误"),
INTERFACE_ACCESS_EXCEPTION("36894", "接口访问异常/次数用尽"), INTERFACE_ACCESS_EXCEPTION("36894", "接口访问异常/次数用尽"),
FRONT_BACK_VAGUE("35556", "身份证正反面不明确"), FRONT_BACK_VAGUE("35556", "身份证正反面不明确"),
ID_CARD_THOTO_MESSAGE_ERROR("36651", "身份照信息错误"), ID_CARD_THOTO_MESSAGE_ERROR("36651", "身份照信息错误"),
EXPTION_ID_CARD_THOTO_MESSAGE_ERROR("36651", "信息异常"), EXPTION_ID_CARD_THOTO_MESSAGE_ERROR("36651", "信息异常"),
PHOTO_FORMAT_ERROR("12138", "身份证图片格式错误"), PHOTO_FORMAT_ERROR("12138", "身份证图片格式错误"),
VALIDATION_INFO_EXPIRED("32815", "认证时间过长信息过期或认证信息不完整,请重新开始认证"), VALIDATION_INFO_EXPIRED("32815", "认证时间过长信息过期或认证信息不完整,请重新开始认证"),
REAL_IMAGE_AUTHENTICATION_SUCESS("38844", "验证成功"), REAL_IMAGE_AUTHENTICATION_SUCESS("38844", "验证成功"),
REAL_IMAGE_AUTHENTICATION_FAILED("38855", "验证失败,请再次进行人脸识别"), REAL_IMAGE_AUTHENTICATION_FAILED("38855", "验证失败,请再次进行人脸识别"),
IDENTITY_HAS_BEEN_AUTHENTICATED("34444", "此身份证信息已经被认证,请重试"), IDENTITY_HAS_BEEN_AUTHENTICATED("34444", "此身份证信息已经被认证,请重试"),
REAL_NAME_ACCOUNT_ID_ERROR("36771", "账户id错误"), REAL_NAME_ACCOUNT_ID_ERROR("36771", "账户id错误"),
REAL_NAME_FUSING_ERROR("36772", "认证失败,请重新认证"), REAL_NAME_FUSING_ERROR("36772", "认证失败,请重新认证"),
// 企业认证 // 企业认证
BUSINESS_LICENSE_CHECK_ANALYSIS_ERROR("30400", "营业执照解析失败,请上传有效清晰的执照"), BUSINESS_LICENSE_CHECK_ANALYSIS_ERROR("30400", "营业执照解析失败,请上传有效清晰的执照"),
BUSINESS_LICENSE_CHECK_PARAMETER_ERROR("30401", "企业信息与营业执照信息不一致,请重新上传"), BUSINESS_LICENSE_CHECK_PARAMETER_ERROR("30401", "企业信息与营业执照信息不一致,请重新上传"),
BANK_ACCOUNT_CHECK1_ERROR("30402", "账号与开户名不符"), BANK_ACCOUNT_CHECK1_ERROR("30402", "账号与开户名不符"),
BANK_ACCOUNT_CHECK2_ERROR("30403", "开户行名称错误"), BANK_ACCOUNT_CHECK2_ERROR("30403", "开户行名称错误"),
BANK_ACCOUNT_CHECK3_ERROR("30404", "仅支持对公账户验证,不支持个人卡"), BANK_ACCOUNT_CHECK3_ERROR("30404", "仅支持对公账户验证,不支持个人卡"),
BANK_ACCOUNT_CHECK4_ERROR("30405", "企业账号信息有误,请重新输入"), BANK_ACCOUNT_CHECK4_ERROR("30405", "企业账号信息有误,请重新输入"),
BANK_ACCOUNT_CHECK5_ERROR("30406", "24小时之内不能重复申请"), BANK_ACCOUNT_CHECK5_ERROR("30406", "24小时之内不能重复申请"),
BANK_ACCOUNT_CHECK6_ERROR( BANK_ACCOUNT_CHECK6_ERROR(
"30407", "很抱歉,目前我们的企业认证次数已达上限,如需继续认证请及时联系相关负责人进行处理,联系方式:科比特管理人员,18938853647。"), "30407", "很抱歉,目前我们的企业认证次数已达上限,如需继续认证请及时联系相关负责人进行处理,联系方式:科比特管理人员,18938853647。"),
BANK_ACCOUNT_CHECK7_ERROR("30408", "企业名称与开户名称不一致,请确认一致后再提交认证"), BANK_ACCOUNT_CHECK7_ERROR("30408", "企业名称与开户名称不一致,请确认一致后再提交认证"),
ENTERPRISE_HAVE_VERIFIED("30409", "您输入的企业信息已被其他用户认证,请重新输入"), ENTERPRISE_HAVE_VERIFIED("30409", "您输入的企业信息已被其他用户认证,请重新输入"),
ID_NUMBER_PARA_ERROR("30410", "身份证号码有错,请重新输入"), ID_NUMBER_PARA_ERROR("30410", "身份证号码有错,请重新输入"),
DEAL_ERROR("30411", "有报错,请联系平台客服。"), DEAL_ERROR("30411", "有报错,请联系平台客服。"),
NOT_DATA_ERROR("30412", "查无数据"), NOT_DATA_ERROR("30412", "查无数据"),
API_STOP_USE_ERROR("30413", "接口停用"), API_STOP_USE_ERROR("30413", "接口停用"),
OFFICE_DATA_SUSTAIN_ERROR("30414", "官方数据源维护,请稍候再试"), OFFICE_DATA_SUSTAIN_ERROR("30414", "官方数据源维护,请稍候再试"),
SERVER_SUSTAIN_ERROR("30415", "服务商维护,请稍候再试"), SERVER_SUSTAIN_ERROR("30415", "服务商维护,请稍候再试"),
PARA_ERROR("30416", "参数错误,请重新输入"), PARA_ERROR("30416", "参数错误,请重新输入"),
VERIFY_COUNT_ERROR("30416", "认证次数上限,请联系管理员"), VERIFY_COUNT_ERROR("30416", "认证次数上限,请联系管理员"),
NOT_ENT_VERIFY_ERROR("30417", "机构未认证或认证未通过,请先进行机构认证"), NOT_ENT_VERIFY_ERROR("30417", "机构未认证或认证未通过,请先进行机构认证"),
NOT__VERIFY_ERROR("30418", "机构未认证或飞手认证未通过,请先进行认证"), NOT__VERIFY_ERROR("30418", "机构未认证或飞手认证未通过,请先进行认证"),
// 渠道认证 // 渠道认证
NOT_ENT_USER("30501", "感谢您有意向成为我们的渠道商,请先完成企业认证。"), NOT_ENT_USER("30501", "感谢您有意向成为我们的渠道商,请先完成企业认证。"),
NEW_NOT_ENT_USER("30502", "此用户未进行企业认证,渠道变更失败!"), NEW_NOT_ENT_USER("30502", "此用户未进行企业认证,渠道变更失败!"),
BEFORE_NOT_CHANNEL_USER("30503", "此用户还不是渠道"), BEFORE_NOT_CHANNEL_USER("30503", "此用户还不是渠道"),
// 飞手端认证 // 飞手端认证
NOT_AUTH_FLYER_ERROR("30600", "飞手未认证,请先完成飞手认证"), NOT_AUTH_FLYER_ERROR("30600", "飞手未认证,请先完成飞手认证"),
NOT_HAVE_AUTH_FLYER_ERROR("30601", "没有认证的飞手,暂不可接单"), NOT_HAVE_AUTH_FLYER_ERROR("30601", "没有认证的飞手,暂不可接单"),
// 设备型号提醒 // 设备型号提醒
DEVICE_MODEL_REPEAT_ERROR("30700", "产品名称不可重复,请重新输入"), DEVICE_MODEL_REPEAT_ERROR("30700", "产品名称不可重复,请重新输入"),
DEVICE_MODEL_FAILURE_ERROR("30701", "设备添加失败"), DEVICE_MODEL_FAILURE_ERROR("30701", "设备添加失败"),
DEVICE_MODEL_REMOVE_ERROR("30702", "设备未在仓库,删除失败"), DEVICE_MODEL_REMOVE_ERROR("30702", "设备未在仓库,删除失败"),
DEVICE_MODEL_UPDATE_ERROR("30703", "设备修改失败"), DEVICE_MODEL_UPDATE_ERROR("30703", "设备修改失败"),
DEVICE_HAS_BEEN_RENT_ERROR("30704", "该设备不在仓库,不能出库"), DEVICE_HAS_BEEN_RENT_ERROR("30704", "该设备不在仓库,不能出库"),
// 仓库提醒 // 仓库提醒
REPO_INFO_NAME("30800", "仓库名称不可重复,请重新输入"), REPO_INFO_NAME("30800", "仓库名称不可重复,请重新输入"),
REPO_INFO_FAILURE("30801", "仓库添加失败"), REPO_INFO_FAILURE("30801", "仓库添加失败"),
REPO_INFO_REMOVE("30702", "仓库删除失败"), REPO_INFO_REMOVE("30702", "仓库删除失败"),
// 商品 // 商品
WARE_NAME_HAS_BEEN_EXIST("30900", "商品名称已存在"), WARE_NAME_HAS_BEEN_EXIST("30900", "商品名称已存在"),
WARE_TYPE_NAME_HAS_BEEN_EXIST("30901", "分类名称已存在"), WARE_TYPE_NAME_HAS_BEEN_EXIST("30901", "分类名称已存在"),
WARE_TYPE_ICON_NOT_NULL("30902", "一级分类图标不能为空"), WARE_TYPE_ICON_NOT_NULL("30902", "一级分类图标不能为空"),
GROUP_DONT_DELETE("30903", "该分类下尚有商品或服务或课程存在"), GROUP_DONT_DELETE("30903", "该分类下尚有商品或服务或课程存在"),
GOODS_STATUS_ERROR("30904", "状态有误"), GOODS_STATUS_ERROR("30904", "状态有误"),
GOODS_ON_SHELF_SUCCESS("30905", "商品上架成功"), GOODS_ON_SHELF_SUCCESS("30905", "商品上架成功"),
GOODS_DOWN_SHELF_SUCCESS("30906", "商品下架成功"), GOODS_DOWN_SHELF_SUCCESS("30906", "商品下架成功"),
GOODS_SKU_IS_NOT_NULL("30907", "商品规格不能为空"), GOODS_SKU_IS_NOT_NULL("30907", "商品规格不能为空"),
GOODS_PIC_IS_NOT_NULL("30908", "主图不能为空"), GOODS_PIC_IS_NOT_NULL("30908", "商品主图不能为空"),
GOODS_DESC_IS_NOT_NULL("30910", "商品描述不能为空"), GOODS_DESC_IS_NOT_NULL("30910", "商品描述不能为空"),
GOODS_GROUP_IS_NOT_NULL("30911", "商品类型不能为空"), GOODS_GROUP_IS_NOT_NULL("30911", "商品类型不能为空"),
GROUP_DONT_DELETE_BY_CHILD("30912", "该分类下尚有子分类存在"), GROUP_DONT_DELETE_BY_CHILD("30912", "该分类下尚有子分类存在"),
GOODS_NOT_EXIST_OR_ALREADY_DOWN_SHELF("30913", "商品不存在或已下架"), GOODS_NOT_EXIST_OR_ALREADY_DOWN_SHELF("30913", "商品不存在或已下架"),
GOODS_NAME_IS_NOT_NULL("30914", "商品名称不能为空或名字长度不能大于60"), GOODS_NAME_IS_NOT_NULL("30914", "商品名称不能为空或名字长度不能大于60"),
GOODS_DELETE_FAIL("30915", "批量删除商品失败,商品已被其他商品绑定"), GOODS_DELETE_FAIL("30915", "批量删除商品失败,商品已被其他商品绑定"),
BRAND_DELETE_FAIL("30916", "删除失败,产品管理中有产品绑定该品牌名称"), BRAND_DELETE_FAIL("30916", "删除失败,产品管理中有产品绑定该品牌名称"),
// 返祖 // 返祖
RETURN_SHARE_ORDER_ERROR("40000", "设备返祖订单相关信息找不到,请重新输入订单号"), RETURN_SHARE_ORDER_ERROR("40000", "设备返祖订单相关信息找不到,请重新输入订单号"),
RETURN_SHARE_ORDER_NOT_FINISH_ERROR("40001", "此设备的订单未完成,请添加其他设备"), RETURN_SHARE_ORDER_NOT_FINISH_ERROR("40001", "此设备的订单未完成,请添加其他设备"),
RETURN_SHARE_ORDER_HAS_BEEN_ADD_ERROR("40002", "此订单的设备已经被添加过,不能重复添加"), RETURN_SHARE_ORDER_HAS_BEEN_ADD_ERROR("40002", "此订单的设备已经被添加过,不能重复添加"),
// 宣传中心 // 宣传中心
EXIST_SAME_NAME_OF_MODULE_ERROR("40500", "所属产品中不能有相同名字的模块"), EXIST_SAME_NAME_OF_MODULE_ERROR("40500", "所属产品中不能有相同名字的模块"),
EXIST_SAME_NAME_OF_BANNER_ERROR("40501", "名称重复,请重新输入"), EXIST_SAME_NAME_OF_BANNER_ERROR("40501", "名称重复,请重新输入"),
EXIST_SAME_CODE_OF_MODULE_ERROR("40502", "moduleCode已重复,请输入其他moduleCode"), EXIST_SAME_CODE_OF_MODULE_ERROR("40502", "moduleCode已重复,请输入其他moduleCode"),
HAS_BEEN_USE_ERROR("40503", "此标签有用户在使用,不能删除!"), HAS_BEEN_USE_ERROR("40503", "此标签有用户在使用,不能删除!"),
FILE_PARSE_ERROR("40600", "上传文件无数据或内容识别失败,请重新上传"), FILE_PARSE_ERROR("40600", "上传文件无数据或内容识别失败,请重新上传"),
HAS_BEEN_APPLY_ERROR("40601", "已提交申请!将有客服人员与你联系"), HAS_BEEN_APPLY_ERROR("40601", "已提交申请!将有客服人员与你联系"),
PRICE_TO_HIGH_ERROR("40602", "标价确认在0-10000000万元内"), PRICE_TO_HIGH_ERROR("40602", "标价确认在0-10000000万元内"),
EXIST_SAME_NAME_ERROR("40603", "快讯名称重复,请重新上传"), EXIST_SAME_NAME_ERROR("40603", "快讯名称重复,请重新上传"),
TENDER_FORMAT_ERROR("40604", "招标序号或内容不能为空,请补全后上传"), TENDER_FORMAT_ERROR("40604", "招标序号或内容不能为空,请补全后上传"),
TENDER_CONTENT_TOO_LONG_ERROR("40605", "存在招标内容字符过长"), TENDER_CONTENT_TOO_LONG_ERROR("40605", "存在招标内容字符过长"),
GOODS_CATEGORY_NAME_EXIST_ERROR("40605", "名称重复,请重新输入!"), GOODS_CATEGORY_NAME_EXIST_ERROR("40605", "名称重复,请重新输入!"),
CONTRACT_STATUS_MISTAKEN("40607", "当前合同状态不可进行编辑!"), CONTRACT_STATUS_MISTAKEN("40607", "当前合同状态不可进行编辑!"),
CONTRACT_STATUS_CANNOT_BE_DELETED("40607", "当前合同状态不可进行删除!"), CONTRACT_STATUS_CANNOT_BE_DELETED("40607", "当前合同状态不可进行删除!"),
CONTRACT_NOT_EXIST("40608", "合同不存在或已删除!"), CONTRACT_NOT_EXIST("40608", "合同不存在或已删除!"),
CONTRACT_STATUS_DOES_NOT_ALLOW_FILE("40609", "该状态合同不允许归档!"), CONTRACT_STATUS_DOES_NOT_ALLOW_FILE("40609", "该状态合同不允许归档!"),
SEAL_INFO_NOT_EXIST("40610", "请前往印章管理上传印章或设置默认印章!"), SEAL_INFO_NOT_EXIST("40610", "请前往印章管理上传印章或设置默认印章!"),
AGENCY_NO_FLYER("40611", "机构下暂无飞手,快去招募吧~"), AGENCY_NO_FLYER("40611", "机构下暂无飞手,快去招募吧~"),
NO_FLYER_WORK("40612", "现在没有飞手上班哦~"), NO_FLYER_WORK("40612", "现在没有飞手上班哦~"),
TEMPORARY_NOT_SUPPORT_TRANSFER_ORDER("40613", "个人订单暂不支持转单操作~"), TEMPORARY_NOT_SUPPORT_TRANSFER_ORDER("40613", "个人订单暂不支持转单操作~"),
ELECTRONIC_SIGNATURE_NOT_REAL_NAME_AUTHENTICATION("40614", "请完成电子签约实名认证后再进行操作"), ELECTRONIC_SIGNATURE_NOT_REAL_NAME_AUTHENTICATION("40614", "请完成电子签约实名认证后再进行操作"),
DIRECTORY_DOES_NOT_EXIST("40615", "目录不存在或已删除"), DIRECTORY_DOES_NOT_EXIST("40615", "目录不存在或已删除"),
DEFAULT_DIRECTORY_CANNOT_BE_DEL("40616", "默认目录不可删除"), DEFAULT_DIRECTORY_CANNOT_BE_DEL("40616", "默认目录不可删除"),
THERE_ARE_CATEGORIES_IN_THE_DIRECTORY("40167", "该目录下有分类存在不可删除"), THERE_ARE_CATEGORIES_IN_THE_DIRECTORY("40167", "该目录下有分类存在不可删除"),
DIRECTORY_NAME_HAS_BEEN_EXIST("40168", "目录名称已存在"), DIRECTORY_NAME_HAS_BEEN_EXIST("40168", "目录名称已存在"),
FAILED_TO_ADD_DATA("40169", "数据新增失败,请稍后重试"), FAILED_TO_ADD_DATA("40169", "数据新增失败,请稍后重试"),
FAILED_TO_EDIT_DATA("40170", "数据修改失败,请稍后重试"), FAILED_TO_EDIT_DATA("40170", "数据修改失败,请稍后重试"),
PRODUCT_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED("40171", "产品不存在或已删除,请刷新后重试!"), PRODUCT_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED("40171", "产品不存在或已删除,请刷新后重试!"),
SPEC_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED("40172", "规格不存在或已删除,请刷新后重试!"), SPEC_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED("40172", "规格不存在或已删除,请刷新后重试!"),
SKU_ALREADY_EXIST_IN_THIS_INDUSTRY("40173", "该所属行业下已经存在sku,请检查后重试!"), SKU_ALREADY_EXIST_IN_THIS_INDUSTRY("40173", "该所属行业下已经存在sku,请检查后重试!"),
SPEC_EXIST_UNDER_THE_SKU("40174", "该产品下有规格存在,无法删除!"), SPEC_EXIST_UNDER_THE_SKU("40174", "该产品下有规格存在,无法删除!"),
SPEC_NOT_CONFIG_PRICE("40175", "存在规格没有配置价格,请联系客服获取报价!"), SPEC_NOT_CONFIG_PRICE("40175", "存在规格没有配置价格,请联系客服获取报价!"),
SHOP_CAR_SIZE_MORE_2("40176", "行业购物车下单数量仅限一个"), SHOP_CAR_SIZE_MORE_2("40176", "行业购物车下单数量仅限一个"),
CONTRACT_TEMPLATE_NOT_EXIST_OR_DELETED("40177", "合同模板不存在或已删除!"), CONTRACT_TEMPLATE_NOT_EXIST_OR_DELETED("40177", "合同模板不存在或已删除!"),
SCORE_ERROR("40177", "您输入的积分数量有误,请重新输入!"), SCORE_ERROR("40177", "您输入的积分数量有误,请重新输入!"),
PLEASE_FILL_IN_THE_CONTRACT_TEMPLATE_FIRST("40178", "请先填充合同模板!"), PLEASE_FILL_IN_THE_CONTRACT_TEMPLATE_FIRST("40178", "请先填充合同模板!"),
SCORE_NOT_GIVE_MYSELF("40179", "积分不能转赠给本人,请重新操作"), SCORE_NOT_GIVE_MYSELF("40179", "积分不能转赠给本人,请重新操作"),
ALREADY_FINISH_ENT_AUTH_ERROR("2000", "助力已完成!"), ALREADY_FINISH_ENT_AUTH_ERROR("2000", "助力已完成!"),
SYSTEM_ERROR("2001", "系统错误,请稍后重试"), SYSTEM_ERROR("2001", "系统错误,请稍后重试"),
RULE_ERROR("2002", "当前兑换比例已失效,请刷新后重试"), RULE_ERROR("2002", "当前兑换比例已失效,请刷新后重试"),
COUNT_LIMIT_ERROR("2003", "参与次数已达上线"), COUNT_LIMIT_ERROR("2003", "参与次数已达上线"),
ALREADY_ENT_AUTH_ERROR("2004", "助力失败,您已完成企业认证!"), ALREADY_ENT_AUTH_ERROR("2004", "助力失败,您已完成企业认证!"),
ALREADY_REAL_NAME_AUTH_ERROR("2005", "助力失败,您已完成实名认证!"), ALREADY_REAL_NAME_AUTH_ERROR("2005", "助力失败,您已完成实名认证!"),
PARTICIPATE_BUT_NOT_AUTH_ERROR("2006", "待完成授权或认证"), PARTICIPATE_BUT_NOT_AUTH_ERROR("2006", "待完成授权或认证"),
ALREADY_HELP_ERROR("2007", "已助力"), ALREADY_HELP_ERROR("2007", "已助力"),
ALREADY_STOP_ERROR("2008", "活动已下线"), ALREADY_STOP_ERROR("2008", "活动已下线"),
HELP_FAIL_ERROR("2009", "不能给自己助力哦!"), HELP_FAIL_ERROR("2009", "不能给自己助力哦!"),
ALREADY_BINDING_ERROR("2010", "优惠券已被绑定"), ALREADY_BINDING_ERROR("2010", "优惠券已被绑定"),
ALREADY_DIVIDE_ERROR("2011", "订单已分成"), ALREADY_DIVIDE_ERROR("2011", "订单已分成"),
DIVIDE_OBJ_NOT_EXIST("2012", "先点击确认添加分成对象"), DIVIDE_OBJ_NOT_EXIST("2012", "先点击确认添加分成对象"),
DEFAULT_DIRECTORY("3001", "默认目录不可删除或修改名称!"); DEFAULT_DIRECTORY("3001", "默认目录不可删除或修改名称!"),
/** THE_NAME_OF_A_CLASS_MUST_BE_UNIQUE("3002", "一级分类名称重复"),
* 错误码 THE_CURRENT_CATEGORY_IS_ASSOCIATED_WITH_GOODS("3004", "当前分类已经关联商品请先删除商品"),
* THE_NAME_OF_THE_SECONDARY_CLASS_MUST_BE_UNIQUE("3003", "同一级分类下面二级分类不能重复");
* @return /**
*/ * 错误码
String resultCode; *
* @return
/** */
* 错误描述 String resultCode;
*
* @return /**
*/ * 错误描述
String resultMsg; *
* @return
ResultEnum(String resultCode, String resultMsg) { */
this.resultCode = resultCode; String resultMsg;
this.resultMsg = resultMsg;
} ResultEnum(String resultCode, String resultMsg) {
this.resultCode = resultCode;
@Override this.resultMsg = resultMsg;
public String getResultCode() { }
return resultCode;
} @Override
public String getResultCode() {
@Override return resultCode;
public String getResultMsg() { }
return resultMsg;
} @Override
public String getResultMsg() {
return resultMsg;
}
} }
...@@ -22,127 +22,127 @@ import java.util.List; ...@@ -22,127 +22,127 @@ import java.util.List;
/** /**
* @Author LW * @Author LW
*
* @date 2023/3/14 13:22 概要: * @date 2023/3/14 13:22 概要:
*/ */
@RestController @RestController
@RequestMapping("/goods") @RequestMapping("/goods")
@Api(tags = {"后台-商品管理-相关接口"}) @Api(tags = {"后台-商品管理-相关接口"})
public class BackstageGoodsManageController extends BaseController { public class BackstageGoodsManageController extends BaseController {
@Resource private GoodsInfoService goodsInfoService; @Resource
private GoodsInfoService goodsInfoService;
@ApiOperation(value = "新增(租赁/销售)商品")
@PostMapping("addGoodsInfo") @ApiOperation(value = "新增(租赁/销售)商品")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @PostMapping("addGoodsInfo")
public ResultBody addGoods( @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@ApiParam("商品信息VO") @Validated(Create.class) @RequestBody GoodsAddVO goodsAddVO, public ResultBody addGoods(
HttpServletRequest request) { @ApiParam("商品信息VO") @Validated(Create.class) @RequestBody GoodsAddVO goodsAddVO,
return goodsInfoService.addGoods( HttpServletRequest request) {
goodsAddVO, this.getUserLoginInfoFromRedis(request).getUserAccountId()); return goodsInfoService.addGoods(
} goodsAddVO, this.getUserLoginInfoFromRedis(request).getUserAccountId());
}
@ApiOperation(value = "修改(租赁/销售)商品")
@PostMapping("editGoodsInfo") @ApiOperation(value = "修改(租赁/销售)商品")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @PostMapping("editGoodsInfo")
public ResultBody editGoodsInfo( @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@ApiParam("商品信息VO") @Validated(Update.class) @RequestBody GoodsAddVO goodsAddVO) { public ResultBody editGoodsInfo(
return goodsInfoService.editGoodsInfo(goodsAddVO); @ApiParam("商品信息VO") @Validated(Update.class) @RequestBody GoodsAddVO goodsAddVO) {
} return goodsInfoService.editGoodsInfo(goodsAddVO);
}
@ApiOperation(value = "PC端-商品详情")
@GetMapping("getGoodsInfoDetail") @ApiOperation(value = "PC端-商品详情")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsDetailDTO.class)}) @GetMapping("getGoodsInfoDetail")
public ResultBody getGoodsInfoDetail( @ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsDetailDTO.class)})
@ApiParam("商品id") @RequestParam Integer goodsInfoId, public ResultBody getGoodsInfoDetail(
@RequestParam Integer type, @ApiParam("商品id") @RequestParam Integer goodsInfoId,
@RequestParam(required = false) @ApiParam("租赁时限:(输入0:1-7天、输入1:8-15天、输入2:16-30天、输入3:30天以上)") @RequestParam Integer type,
Integer leaseTerm) { @RequestParam(required = false) @ApiParam("租赁时限:(输入0:1-7天、输入1:8-15天、输入2:16-30天、输入3:30天以上)")
return goodsInfoService.getGoodsInfoDetail(goodsInfoId, type, leaseTerm); Integer leaseTerm) {
} return goodsInfoService.getGoodsInfoDetail(goodsInfoId, type, leaseTerm);
}
@ApiOperation(value = "商品列表-分页")
@PostMapping("listPageGoodsInfo") @ApiOperation(value = "商品列表-分页")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = GoodsInfoListDTO.class)}) @PostMapping("listPageGoodsInfo")
public ResultBody listPageGoodsInfo(@ApiParam("商品查询条件QO") @RequestBody MallGoodsQO param) { @ApiResponses({@ApiResponse(code = 200, message = "OK", response = GoodsInfoListDTO.class)})
return ResultBody.success(goodsInfoService.listPageGoodsInfo(param)); public ResultBody listPageGoodsInfo(@ApiParam("商品查询条件QO") @RequestBody MallGoodsQO param) {
} return ResultBody.success(goodsInfoService.listPageGoodsInfo(param));
}
@ApiOperation(value = "商品批量上下架")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiOperation(value = "商品批量上下架")
@PostMapping("batchOnShelfOrTakeDown") @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody batchOnShelfOrTakeDown( @PostMapping("batchOnShelfOrTakeDown")
@ApiParam(value = "商品上下架参数", required = true) @RequestBody BatchShelfVO batchOnShelfVO) { public ResultBody batchOnShelfOrTakeDown(
return goodsInfoService.batchOnShelfOrTakeDown( @ApiParam(value = "商品上下架参数", required = true) @RequestBody BatchShelfVO batchOnShelfVO) {
batchOnShelfVO.getGoodsIds(), batchOnShelfVO.getStatus()); return goodsInfoService.batchOnShelfOrTakeDown(
} batchOnShelfVO.getGoodsIds(), batchOnShelfVO.getStatus());
}
@ApiOperation(value = "商品批量删除")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiOperation(value = "商品批量删除")
@PostMapping("batchRemoveWareInfo") @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody batchRemoveWareInfo( @PostMapping("batchRemoveWareInfo")
@ApiParam(value = "商品id数组", required = true) @RequestBody List<Integer> ids) { public ResultBody batchRemoveWareInfo(
return goodsInfoService.batchRemoveWareInfo(ids); @ApiParam(value = "商品id数组", required = true) @RequestBody List<Integer> ids) {
} return goodsInfoService.batchRemoveWareInfo(ids);
}
@ApiOperation(value = "单位信息")
@GetMapping("getSkuUnit") @ApiOperation(value = "单位信息")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = SkuUnitDTO.class)}) @GetMapping("getSkuUnit")
public ResultBody getSkuUnit() { @ApiResponses({@ApiResponse(code = 200, message = "OK", response = SkuUnitDTO.class)})
return goodsInfoService.getSkuUnit(); public ResultBody getSkuUnit() {
} return goodsInfoService.getSkuUnit();
}
@ApiOperation(value = "PC端-其他服务-列表")
@GetMapping("listOtherService") @ApiOperation(value = "PC端-其他服务-列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = SaleServiceDTO.class)}) @GetMapping("listOtherService")
public ResultBody listOtherService() { @ApiResponses({@ApiResponse(code = 200, message = "OK", response = SaleServiceDTO.class)})
return goodsInfoService.getSaleServiceInfoToList(); public ResultBody listOtherService() {
} return goodsInfoService.getSaleServiceInfoToList();
}
@ApiOperation(value = "feign根据购物车信息填充未知信息", hidden = true)
@PostMapping("fillGoodsInfo") @ApiOperation(value = "feign根据购物车信息填充未知信息", hidden = true)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsShopCarDTO.class)}) @PostMapping("fillGoodsInfo")
public List<MallGoodsShopCarDTO> fillGoodsInfo(@RequestBody List<MallGoodsShopCarDTO> param) { @ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsShopCarDTO.class)})
return goodsInfoService.fillGoodsInfo(param); public List<MallGoodsShopCarDTO> fillGoodsInfo(@RequestBody List<MallGoodsShopCarDTO> param) {
} return goodsInfoService.fillGoodsInfo(param);
}
@ApiOperation(value = "feign根据渠道等级和产品规格id获取对应价格", hidden = true)
@PostMapping("feignListProductSpecPrice") @ApiOperation(value = "feign根据渠道等级和产品规格id获取对应价格", hidden = true)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @PostMapping("feignListProductSpecPrice")
public List<MallProductSpecPriceDTO> feignListProductSpecPrice( @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@RequestBody ProductSpecPriceQO productSpecPriceQO) { public List<MallProductSpecPriceDTO> feignListProductSpecPrice(
return goodsInfoService.feignListProductSpecPrice(productSpecPriceQO); @RequestBody ProductSpecPriceQO productSpecPriceQO) {
} return goodsInfoService.feignListProductSpecPrice(productSpecPriceQO);
}
@ApiOperation(value = "feign根据渠道等级获取单价信息", hidden = true)
@GetMapping("feignGetUnitPriceByTag") @ApiOperation(value = "feign根据渠道等级获取单价信息", hidden = true)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSpecPriceDTO.class)}) @GetMapping("feignGetUnitPriceByTag")
public ProductSpecPriceDTO feignGetUnitPriceByTag( @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSpecPriceDTO.class)})
@RequestParam(value = "specId") Integer specId, public ProductSpecPriceDTO feignGetUnitPriceByTag(
@RequestParam(value = "tagId") Integer tagId) { @RequestParam(value = "specId") Integer specId,
return goodsInfoService.feignGetUnitPriceByTag(specId, tagId); @RequestParam(value = "tagId") Integer tagId) {
} return goodsInfoService.feignGetUnitPriceByTag(specId, tagId);
}
@ApiOperation(value = "feign根据商品的产品规格id查询商品信息", hidden = true)
@PostMapping("feignListProdGoodsSkuInfo") @ApiOperation(value = "feign根据商品的产品规格id查询商品信息", hidden = true)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = OrderGoodsProdDTO.class)}) @PostMapping("feignListProdGoodsSkuInfo")
public List<OrderGoodsProdDTO> feignListProdGoodsSkuInfo( @ApiResponses({@ApiResponse(code = 200, message = "OK", response = OrderGoodsProdDTO.class)})
@RequestBody MallOrderGoodsInfoQO mallOrderGoodsInfoQO) { public List<OrderGoodsProdDTO> feignListProdGoodsSkuInfo(
return goodsInfoService.feignListProdGoodsSkuInfo(mallOrderGoodsInfoQO); @RequestBody MallOrderGoodsInfoQO mallOrderGoodsInfoQO) {
} return goodsInfoService.feignListProdGoodsSkuInfo(mallOrderGoodsInfoQO);
}
@ApiOperation(value = "feign根据商品的行业规格id查询商品清单信息", hidden = true)
@PostMapping("feignListIndstGoodsSkuInfo") @ApiOperation(value = "feign根据商品的行业规格id查询商品清单信息", hidden = true)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = OrderGoodsProdDTO.class)}) @PostMapping("feignListIndstGoodsSkuInfo")
public List<OrderGoodsIndstDTO> feignListIndstGoodsSkuInfo( @ApiResponses({@ApiResponse(code = 200, message = "OK", response = OrderGoodsProdDTO.class)})
@RequestBody MallOrderGoodsInfoQO mallOrderGoodsInfoQO) { public List<OrderGoodsIndstDTO> feignListIndstGoodsSkuInfo(
return goodsInfoService.feignListIndstGoodsSkuInfo(mallOrderGoodsInfoQO); @RequestBody MallOrderGoodsInfoQO mallOrderGoodsInfoQO) {
} return goodsInfoService.feignListIndstGoodsSkuInfo(mallOrderGoodsInfoQO);
}
@ApiOperation(value = "商品列表-排序")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)}) @ApiOperation(value = "商品列表-排序")
@GetMapping("exchangeGoodsInfo") @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody exchangeGoodsInfo(@ApiParam(value = "第一个参数id", required = true) @RequestParam(value = "firstId") Integer firstId, @GetMapping("exchangeGoodsInfo")
@ApiParam(value = "第二个参数id", required = true) @RequestParam(value = "secondId") Integer secondId) { public ResultBody exchangeGoodsInfo(@ApiParam(value = "第一个参数id", required = true) @RequestParam(value = "firstId") Integer firstId,
return goodsInfoService.exchangeGoodsInfo(firstId, secondId); @ApiParam(value = "第二个参数id", required = true) @RequestParam(value = "secondId") Integer secondId) {
} return goodsInfoService.exchangeGoodsInfo(firstId, secondId);
}
} }
package com.mmc.pms.controller.category;
import com.mmc.pms.common.Page;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.category.dto.CategoryPrimaryDTO;
import com.mmc.pms.model.category.dto.CategorySubDTO;
import com.mmc.pms.model.category.qo.CategoryQO;
import com.mmc.pms.model.category.vo.CategoryPrimaryVO;
import com.mmc.pms.model.category.vo.CategorySubVO;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Others;
import com.mmc.pms.model.group.Update;
import com.mmc.pms.service.category.CategoryService;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @Author small
* @Date 2023/7/20 16:17
* @Version 1.0
* <p>
* 新版本分类管理
*/
@RestController
@RequestMapping("/category")
@Api(tags = {"后台-新版-分类管理"})
public class CategoryController {
@Autowired
private CategoryService categoryService;
@ApiOperation(value = "一级分类————新增")
@PostMapping("/addPrimaryCategory")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addPrimaryCategory(HttpServletRequest request, @RequestBody @Validated(value = {Create.class}) CategoryPrimaryVO primaryVO) {
return categoryService.addPrimaryCategory(primaryVO);
}
@ApiOperation(value = "一级分类————编辑")
@PostMapping("/updatePrimaryCategory")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody updatePrimaryCategory(HttpServletRequest request, @RequestBody @Validated(value = {Update.class}) CategoryPrimaryVO primaryVO) {
return categoryService.updatePrimaryCategory(primaryVO);
}
@ApiOperation(value = "一级分类————删除")
@GetMapping("/deletePrimaryCategory")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody deletePrimaryCategory(HttpServletRequest request, @RequestParam(value = "id", required = true) Integer id) {
return categoryService.deletePrimaryCategory(id);
}
@ApiOperation(value = "一级分类————列表/包含二级分类")
@PostMapping("/categoryList")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody<CategoryPrimaryDTO> categoryList(HttpServletRequest request, @Validated(value = {Page.class}) @ApiParam(value = "角色查询QO", required = true) @RequestBody CategoryQO param) {
return ResultBody.success(categoryService.categoryList(param));
}
@ApiOperation(value = "二级分类————新增")
@PostMapping("/addSubCategory")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addSubCategory(HttpServletRequest request, @RequestBody @Validated(value = {Create.class}) CategorySubVO subVO) {
return categoryService.addSubCategory(subVO);
}
@ApiOperation(value = "二级分类————编辑")
@PostMapping("/updateSubCategory")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody updateSubCategory(HttpServletRequest request, @RequestBody @Validated(value = {Update.class}) CategorySubVO subVO) {
return categoryService.updateSubCategory(subVO);
}
@ApiOperation(value = "二级分类————删除")
@GetMapping("/deleteSubCategory")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody deleteSubCategory(HttpServletRequest request, @RequestParam(value = "id", required = true) Integer id) {
return categoryService.deleteSubCategory(id);
}
@ApiOperation(value = "二级分类————详情")
@GetMapping("/detailSubCategory")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody<CategorySubDTO> detailSubCategory(HttpServletRequest request, @RequestParam(value = "id", required = true) Integer id) {
return categoryService.detailSubCategory(id);
}
@ApiOperation(value = "一级分类——排序交换")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("exchange")
public ResultBody exchangeBannerInfo(@Validated(Others.class) @RequestBody List<CategoryPrimaryVO> list) {
return categoryService.exchange(list);
}
@ApiOperation(value = "小程序分类信息--含一二级分类")
@GetMapping("/appCategoryInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CategoryPrimaryDTO.class)})
public ResultBody<CategoryPrimaryDTO> appCategoryInfo() {
return categoryService.appCategoryInfo();
}
}
package com.mmc.pms.controller.mall;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.controller.BaseController;
import com.mmc.pms.model.mall.MallGoodsVO;
import com.mmc.pms.service.mall.AppMallGoodsService;
import com.mmc.pms.service.mall.MallGoodsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @Author LW
* @date 2023/7/26 14:26
* 概要:
*/
@RestController
@RequestMapping("/app/goods")
@Api(tags = {"V1.0.3-小程序商城商品-相关接口"})
public class AppMallGoodsController extends BaseController {
@Resource
private MallGoodsService mallGoodsService;
@Resource
private AppMallGoodsService appMallGoodsService;
@ApiOperation(value = "小程序商品详情")
@GetMapping("appMallGoodsDetails")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsVO.class)})
public ResultBody<MallGoodsVO> appMallGoodsDetails(@RequestParam Integer id) {
return mallGoodsService.mallGoodsDetails(id);
}
@ApiOperation(value = "查询品牌方的商品")
@GetMapping("queryBrandGoods")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsVO.class)})
public ResultBody<MallGoodsVO> queryBrandGoods(@RequestParam Integer userAccountId) {
return appMallGoodsService.queryBrandGoods(userAccountId);
}
@ApiOperation(value = "根据子分类查询商品信息")
@PostMapping("queryGoodsInfoByCategorySub")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsVO.class)})
public ResultBody<MallGoodsVO> queryGoodsInfoByCategorySub(@RequestBody List<Integer> categorySubIds) {
return appMallGoodsService.queryGoodsInfoByCategorySub(categorySubIds);
}
}
package com.mmc.pms.controller.mall;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.controller.BaseController;
import com.mmc.pms.model.mall.MallGoodsVO;
import com.mmc.pms.model.sale.dto.SkuUnitDTO;
import com.mmc.pms.model.sale.qo.MallGoodsInfoQO;
import com.mmc.pms.service.mall.MallGoodsService;
import io.swagger.annotations.*;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
/**
* @Author LW
* @date 2023/7/24 16:56 概要:
*/
@RestController
@RequestMapping("/mall/goods")
@Api(tags = {"V1.0.3-商城商品-相关接口"})
public class MallGoodsController extends BaseController {
@Resource
private MallGoodsService mallGoodsService;
@ApiOperation(value = "新增商城商品")
@PostMapping("addMallGoods")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody addMallGoods(@RequestBody MallGoodsVO mallGoodsVO, HttpServletRequest request) {
return mallGoodsService.addMallGoods(mallGoodsVO, this.getUserLoginInfoFromRedis(request).getUserAccountId());
}
@ApiOperation(value = "商城商品详情")
@GetMapping("mallGoodsDetails")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsVO.class)})
public ResultBody<MallGoodsVO> mallGoodsDetails(@RequestParam Integer id) {
return mallGoodsService.mallGoodsDetails(id);
}
@ApiOperation(value = "编辑商城商品")
@PostMapping("editMallGoods")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
public ResultBody editMallGoods(@RequestBody MallGoodsVO mallGoodsVO, HttpServletRequest request) {
return mallGoodsService.editMallGoods(mallGoodsVO, this.getUserLoginInfoFromRedis(request).getUserAccountId());
}
@ApiOperation(value = "单位信息")
@GetMapping("getSkuUnit")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = SkuUnitDTO.class)})
public ResultBody getSkuUnit() {
return mallGoodsService.getSkuUnit();
}
@ApiOperation(value = "商品列表-分页")
@PostMapping("listPageGoodsInfo")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = MallGoodsVO.class)})
public ResultBody<MallGoodsVO> listPageGoodsInfo(@ApiParam("商品查询条件QO") @RequestBody MallGoodsInfoQO param, HttpServletRequest request) {
return ResultBody.success(mallGoodsService.listPageGoodsInfo(param, this.getUserLoginInfoFromRedis(request)));
}
@ApiOperation(value = "商品列表-排序")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("exchange")
public ResultBody exchange(@ApiParam(value = "第一个商品id", required = true) @RequestParam(value = "firstId") Integer firstId,
@ApiParam(value = "第二个商品id", required = true) @RequestParam(value = "secondId") Integer secondId) {
return mallGoodsService.exchange(firstId, secondId);
}
@ApiOperation(value = "商品列表-上架或下架")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("upOrDownShelf")
public ResultBody upOrDownShelf(@ApiParam(value = "商品id", required = true) @RequestParam(value = "id") Integer id,
@ApiParam(value = "状态 0:下架 1: 上架", required = true) @RequestParam(value = "status") Integer status) {
return mallGoodsService.upOrDownShelf(id, status);
}
@ApiOperation(value = "商品列表-删除")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("removeMallGoods")
public ResultBody removeMallGoods(@ApiParam(value = "商品id", required = true) @RequestParam(value = "id") Integer id) {
return mallGoodsService.removeMallGoods(id);
}
@ApiOperation(value = "删除用户时对应的商品也删除", hidden = true)
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("feignRemoveGoodsByBackUserAccountId")
public ResultBody feignRemoveGoodsByUserAccountId(@RequestParam(value = "id") Integer id) {
return mallGoodsService.feignRemoveGoodsByBackUserAccountId(id);
}
}
...@@ -18,102 +18,102 @@ import java.util.Set; ...@@ -18,102 +18,102 @@ import java.util.Set;
@Mapper @Mapper
public interface GoodsInfoDao { public interface GoodsInfoDao {
int countGoodsInfoByName(GoodsAddVO goodsAddVO); int countGoodsInfoByName(GoodsAddVO goodsAddVO);
void insertGoodsInfo(GoodsInfo goodsInfo); void insertGoodsInfo(GoodsInfo goodsInfo);
int countGoodsInfo(); int countGoodsInfo();
void insertGoodsImgInfo(List<GoodsImgDO> list); void insertGoodsImgInfo(List<GoodsImgDO> list);
void insertVideoInfo(GoodsVideoDO goodsVideoDO); void insertVideoInfo(GoodsVideoDO goodsVideoDO);
void insertGoodsDetail(GoodsDetailDO goodsDetailDO); void insertGoodsDetail(GoodsDetailDO goodsDetailDO);
void insertGoodsService(List<GoodsServiceDO> otherList); void insertGoodsService(List<GoodsServiceDO> otherList);
int countGoodsInfoById(Integer id); int countGoodsInfoById(Integer id);
void updateGoodsInfo(GoodsInfo goodsInfo); void updateGoodsInfo(GoodsInfo goodsInfo);
void updateGoodsDetail(GoodsDetailDO goodsDetailDO); void updateGoodsDetail(GoodsDetailDO goodsDetailDO);
List<GoodsImgDO> listGoodsInfoByGoodsId(Integer id); List<GoodsImgDO> listGoodsInfoByGoodsId(Integer id);
void deleteImgByIds(List<Integer> deleteIds); void deleteImgByIds(List<Integer> deleteIds);
void deleteGoodsVideoById(Integer id); void deleteGoodsVideoById(Integer id);
void deleteGoodsServiceByGoodsId(Integer id); void deleteGoodsServiceByGoodsId(Integer id);
void insertMallIndustrySkuInfo(MallIndustrySkuInfoDO mallIndustrySkuInfoDO); void insertMallIndustrySkuInfo(MallIndustrySkuInfoDO mallIndustrySkuInfoDO);
void insertMallIndustrySkuInfoSpec(MallIndustrySkuInfoSpecDO mallIndustrySkuInfoSpecDO); void insertMallIndustrySkuInfoSpec(MallIndustrySkuInfoSpecDO mallIndustrySkuInfoSpecDO);
List<MallProdInfoDO> getMallProSkuInfo(Integer id); List<MallProdInfoDO> getMallProSkuInfo(Integer id);
void batchUpdateMallProductSku(List<Integer> delIds); void batchUpdateMallProductSku(List<Integer> delIds);
void batchUpdateMallProdSkuInfo(List<MallProdInfoDO> list); void batchUpdateMallProdSkuInfo(List<MallProdInfoDO> list);
List<MallIndustrySkuInfoDO> getMallIndustrySkuInfo(Integer id); List<MallIndustrySkuInfoDO> getMallIndustrySkuInfo(Integer id);
GoodsInfo getGoodsSimpleInfo(Integer goodsInfoId); GoodsInfo getGoodsSimpleInfo(Integer goodsInfoId);
GoodsDetailDO getGoodsDetailByGoodsId(Integer goodsInfoId); GoodsDetailDO getGoodsDetailByGoodsId(Integer goodsInfoId);
List<GoodsServiceDO> listGoodsServiceByGoodsId(Integer goodsInfoId); List<GoodsServiceDO> listGoodsServiceByGoodsId(Integer goodsInfoId);
List<SkuUnitDO> getSkuUnit(); List<SkuUnitDO> getSkuUnit();
List<GoodsInfo> listSimpleGoodsInfoByIds(@Param("ids") Set<Integer> ids); List<GoodsInfo> listSimpleGoodsInfoByIds(@Param("ids") Set<Integer> ids);
void insertMallProdSkuInfoSpec(MallProdSkuInfoSpecDO mallProdSkuInfoSpecDO); void insertMallProdSkuInfoSpec(MallProdSkuInfoSpecDO mallProdSkuInfoSpecDO);
void batchUpdateMallProSpec(@Param("list") List<Integer> list, @Param("id") Integer id); void batchUpdateMallProSpec(@Param("list") List<Integer> list, @Param("id") Integer id);
List<MallProdSkuInfoSpecDO> listMallProdSpecInfo(List<Integer> mallSkuIds); List<MallProdSkuInfoSpecDO> listMallProdSpecInfo(List<Integer> mallSkuIds);
void batchUpdateMallProdSpec(List<Integer> delSpecId); void batchUpdateMallProdSpec(List<Integer> delSpecId);
List<MallGoodsSpecInfoDO> listProdSpecInfo(@Param("prodIds") Set<Integer> prodIds); List<MallGoodsSpecInfoDO> listProdSpecInfo(@Param("prodIds") Set<Integer> prodIds);
List<MallGoodsSpecInfoDO> listIndstSpecInfo(@Param("indstIds") Set<Integer> indstIds); List<MallGoodsSpecInfoDO> listIndstSpecInfo(@Param("indstIds") Set<Integer> indstIds);
List<GoodsServiceDO> listGoodsService(List<Integer> goodsIds); List<GoodsServiceDO> listGoodsService(List<Integer> goodsIds);
List<MallGoodsInfoSimpleDO> listMallGoodsIndstSimpleInfo( List<MallGoodsInfoSimpleDO> listMallGoodsIndstSimpleInfo(
@Param("indstSkuSpecIds") Set<Integer> indstSkuSpecIds); @Param("indstSkuSpecIds") Set<Integer> indstSkuSpecIds);
List<Integer> listIndustrySpecIds(Set<Integer> mallIndstSkuSpecIds); List<Integer> listIndustrySpecIds(Set<Integer> mallIndstSkuSpecIds);
List<MallGoodsProductDO> listIndustryProductList(List<Integer> industrySpecIds); List<MallGoodsProductDO> listIndustryProductList(List<Integer> industrySpecIds);
List<GoodsInfo> ListGoodsInfoByCategoryId(Integer pageNo,Integer pageSize,Integer id,int type); List<GoodsInfo> ListGoodsInfoByCategoryId(Integer pageNo, Integer pageSize, Integer id, int type);
List<MallProdSkuInfoSpecDO> getMallProSkuInfoSpec(Integer goodsInfoId); List<MallProdSkuInfoSpecDO> getMallProSkuInfoSpec(Integer goodsInfoId);
List<MallProdSkuInfoSpecDO> listMallprodSpecById(List<Integer> goodsIds); List<MallProdSkuInfoSpecDO> listMallprodSpecById(List<Integer> goodsIds);
List<SaleServiceDO> listSaleServiceInfo(); List<SaleServiceDO> listSaleServiceInfo();
int countListGoodsInfo(MallGoodsQO param); int countListGoodsInfo(MallGoodsQO param);
List<GoodsInfo> listGoodsInfo(MallGoodsQO param); List<GoodsInfo> listGoodsInfo(MallGoodsQO param);
void batchUpOrDownWare(@Param("ids") List<Integer> ids, @Param("status") Integer status); void batchUpOrDownWare(@Param("ids") List<Integer> ids, @Param("status") Integer status);
void removeWareInfo(List<Integer> ids); void removeWareInfo(List<Integer> ids);
List<SpecPriceVO> getPriceBySpecId(Integer productSpecId, Integer leaseTerm); List<SpecPriceVO> getPriceBySpecId(Integer productSpecId, Integer leaseTerm);
int countGoodsInfoByCategoryId(Integer id); int countGoodsInfoByCategoryId(Integer id);
void updateMallProdSkuInfo(MallProdInfoDO mallProdInfoDO); void updateMallProdSkuInfo(MallProdInfoDO mallProdInfoDO);
List<MallProdInfoDO> getAllMallProSkuInfo(Integer goodsInfoId); List<MallProdInfoDO> getAllMallProSkuInfo(Integer goodsInfoId);
int updateGoodsInfoSort(Integer id, Integer sort); int updateGoodsInfoSort(Integer id, Integer sort);
int countServiceByCategoryId(Integer id); int countServiceByCategoryId(Integer id);
} }
package com.mmc.pms.dao.category;
import com.mmc.pms.entity.ServiceDO;
import com.mmc.pms.entity.category.CategoryPrimaryDO;
import com.mmc.pms.entity.category.CategorySubDO;
import com.mmc.pms.model.category.qo.CategoryQO;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @Author small
* @Date 2023/7/21 10:20
* @Version 1.0
*/
@Mapper
public interface CategoryDao {
int getCountName(String name);
void addPrimaryCategory(CategoryPrimaryDO primaryDO);
void updateSort(Integer id);
void deletePrimaryCategory(Integer id);
Integer categoryCount(CategoryPrimaryDO primaryDO);
void updatePrimaryCategory(CategoryPrimaryDO primaryDO);
int getCountSubName(String name, Integer categoryPrimaryId);
void addSubCategory(CategorySubDO subDO);
Integer categorySubCount(CategorySubDO subDO);
void updateSubCategory(CategorySubDO subDO);
void deleteSubCategory(Integer id);
CategorySubDO detailSubCategory(Integer id);
List<CategoryPrimaryDO> categoryList(CategoryQO param);
List<CategorySubDO> selectSubList(Integer id);
int categoryListCount(CategoryQO param);
void exchange(ServiceDO serviceDO);
List<CategoryPrimaryDO> selectPrimaryList();
List<CategorySubDO> selectCategorySubList(List<Integer> ids);
Integer selectSubMallGoods(Integer id);
Integer selectPrimary(Integer id);
}
package com.mmc.pms.dao.mall;
import com.mmc.pms.entity.mall.MallGoodsDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Author LW
* @date 2023/7/26 14:57
* 概要:
*/
@Mapper
public interface AppMallGoodsDao {
List<MallGoodsDO> queryGoodsInfo(@Param("userAccountId") Integer userAccountId, @Param("categorySubIds") List<Integer> categorySubIds);
}
package com.mmc.pms.dao.mall;
import com.mmc.pms.entity.SkuUnitDO;
import com.mmc.pms.entity.mall.GoodsSpecDO;
import com.mmc.pms.entity.mall.GoodsSpecValuesDO;
import com.mmc.pms.entity.mall.MallGoodsDO;
import com.mmc.pms.entity.mall.MallGoodsResourcesDO;
import com.mmc.pms.model.mall.MallGoodsVO;
import com.mmc.pms.model.sale.qo.MallGoodsInfoQO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* @Author LW
* @date 2023/7/24 17:38 概要:
*/
@Mapper
public interface MallGoodsDao {
int countMallGoodsByName(@Param("mallGoodsVO") MallGoodsVO mallGoodsVO, @Param("userAccountId") Integer userAccountId);
int countMallGoods(Integer userAccountId);
void insertMallGoodsBaseInfo(MallGoodsDO mallGoodsDO);
void insertGoodsSpec(GoodsSpecDO goodsSpecDO);
void batchInsertSpecValues(List<GoodsSpecValuesDO> goodsSpecValuesList);
void batchInsertMallGoodsResources(List<MallGoodsResourcesDO> mallGoodsResourcesList);
MallGoodsDO getMallGoodsBaseInfo(Integer id);
List<MallGoodsResourcesDO> getMallGoodsResources(Integer id);
List<GoodsSpecDO> getMallGoodsSpec(Integer id);
List<GoodsSpecValuesDO> getMallGoodsSpecValues(List<Integer> ids);
void updateMallGoods(@Param("mallGoodsDO") MallGoodsDO mallGoodsDO);
void deleteMallGoodsResources(Integer id);
void deleteGoodsSpec(List<Integer> deleteSpec);
void updateGoodsSpec(GoodsSpecDO goodsSpecDO);
void deleteGoodsSpecValues(List<Integer> deleteSpecValueId);
void updateGoodsSpecValue(GoodsSpecValuesDO goodsSpecValuesDO);
List<SkuUnitDO> getSkuUnit();
int countListMallGoods(MallGoodsInfoQO param);
List<MallGoodsDO> listMallGoods(MallGoodsInfoQO param);
int updateMallGoodsSort(Integer id, Integer sort);
void updateMallGoodsByShelf(Integer id, Integer status);
void removeMallGoods(Integer id);
void feignRemoveGoodsByBackUserAccountId(Integer id);
}
package com.mmc.pms.entity.category;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.mmc.pms.model.category.dto.CategoryPrimaryDTO;
import com.mmc.pms.model.category.vo.CategoryPrimaryVO;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;
/**
* @Author small
* @Date 2023/7/21 10:15
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CategoryPrimaryDO {
@ApiModelProperty(value = "id")
@NotNull(message = "id不能为空", groups = {Update.class})
@Min(value = 1, groups = {Update.class})
@TableId(type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "分类名称", required = true, example = "无人机")
@Size(max = 15, message = "分类名称不能超过15个字", groups = {Update.class, Create.class})
@NotBlank(message = "分类名称不能为空或空字符", groups = {Update.class, Create.class})
private String name;
@ApiModelProperty(value = "描述")
@Size(max = 70, message = "分类描述不能超过70个字", groups = {Update.class, Create.class})
private String description;
@ApiModelProperty(value = "icon图标")
private String icon;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间", example = "2023-07-14 10:13:12", required = true)
private Date createTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间", example = "2023-07-14 10:13:12", required = true)
private Date updateTime;
@ApiModelProperty(value = "子分类")
private List<CategorySubDO> subDOList;
@ApiModelProperty(value = "顺序")
private Integer sort;
public CategoryPrimaryDO(CategoryPrimaryVO primaryVO) {
this.id = primaryVO.getId();
this.name = primaryVO.getName();
this.description = primaryVO.getDescription();
this.icon = primaryVO.getIcon();
}
public CategoryPrimaryDTO buildCategoryPrimaryDTO() {
return CategoryPrimaryDTO.builder()
.id(this.id)
.name(this.name)
.description(this.description)
.icon(this.icon)
.createTime(this.createTime)
.updateTime(this.updateTime)
.subDTOList(this.subDOList)
.sort(this.sort)
.build();
}
}
package com.mmc.pms.entity.category;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.mmc.pms.model.category.dto.CategorySubDTO;
import com.mmc.pms.model.category.vo.CategorySubVO;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/**
* @Author small
* @Date 2023/7/21 10:16
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CategorySubDO {
@ApiModelProperty(value = "id")
@NotNull(message = "id不能为空", groups = {Update.class})
@Min(value = 1, groups = {Update.class})
@TableId(type = IdType.AUTO)
private Integer id;
@ApiModelProperty(value = "分类名称", required = true, example = "无人机")
@Size(max = 15, message = "分类名称不能超过15个字", groups = {Update.class, Create.class})
@NotBlank(message = "分类名称不能为空或空字符", groups = {Update.class, Create.class})
private String name;
@ApiModelProperty(value = "描述")
@Size(max = 70, message = "分类描述不能超过70个字", groups = {Update.class, Create.class})
private String description;
@ApiModelProperty(value = "一级id不能为空", required = true, example = "1")
@NotNull(message = "一级id不能为空", groups = {Update.class, Create.class})
private Integer categoryPrimaryId;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间", example = "2023-07-14 10:13:12", required = true)
private Date createTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间", example = "2023-07-14 10:13:12", required = true)
private Date updateTime;
public CategorySubDO(CategorySubVO subVO) {
this.id = subVO.getId();
this.name = subVO.getName();
this.description = subVO.getDescription();
this.categoryPrimaryId = subVO.getCategoryPrimaryId();
}
public CategorySubDTO buildCategorySubDTO() {
return CategorySubDTO.builder()
.id(this.id)
.name(this.name)
.description(this.description)
.categoryPrimaryId(this.categoryPrimaryId)
.createTime(this.createTime)
.updateTime(this.updateTime)
.build();
}
}
package com.mmc.pms.entity.mall;
import com.mmc.pms.model.mall.GoodsSpecVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* (GoodsSpecDO)实体类
*
* @author makejava
* @since 2023-07-24 21:16:41
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GoodsSpecDO implements Serializable {
private static final long serialVersionUID = 381669128695968475L;
private Integer id;
/**
* 商品id
*/
private Integer mallGoodsId;
/**
* 规格名称
*/
private String specName;
/**
* 0单选,1多选
*/
private Integer chooseType;
/**
* 0 非必选 1 必选
*/
private Integer must;
/**
* 单位id
*/
private Integer skuUnitId;
private Date createTime;
private Date updateTime;
public GoodsSpecDO(GoodsSpecVO goodsSpecVO) {
this.id = goodsSpecVO.getId();
this.mallGoodsId = goodsSpecVO.getMallGoodsId();
this.specName = goodsSpecVO.getSpecName();
this.chooseType = goodsSpecVO.getChooseType();
this.must = goodsSpecVO.getMust();
this.skuUnitId = goodsSpecVO.getSkuUnitId();
}
public GoodsSpecVO buildGoodsSpecVO() {
return GoodsSpecVO.builder().id(id).mallGoodsId(mallGoodsId).specName(specName)
.chooseType(chooseType).must(must).skuUnitId(skuUnitId).build();
}
}
package com.mmc.pms.entity.mall;
import com.mmc.pms.model.mall.GoodsSpecValuesVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* (GoodsSpecValuesDO)实体类
*
* @author makejava
* @since 2023-07-24 21:18:28
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class GoodsSpecValuesDO implements Serializable {
private static final long serialVersionUID = -35192084826222973L;
private Integer id;
/**
* 规格id
*/
private Integer goodsSpecId;
/**
* 选项名称
*/
private String specValueName;
/**
* 料号
*/
private String partNo;
/**
* 规格图片
*/
private String specValueImage;
/**
* 销售价是否显示 0:否 1:是
*/
private Integer showPrice;
/**
* 库存
*/
private Integer stock;
/**
* 销售价格
*/
private BigDecimal salePrice;
/**
* 渠道价格
*/
private BigDecimal channelPrice;
private Date createTime;
private Date updateTime;
public GoodsSpecValuesDO(GoodsSpecValuesVO d) {
this.id = d.getId();
this.goodsSpecId = d.getGoodsSpecId();
this.specValueName = d.getSpecValueName();
this.partNo = d.getPartNo();
this.specValueImage = d.getSpecValueImage();
this.showPrice = d.getShowPrice();
this.channelPrice = d.getChannelPrice();
this.salePrice = d.getSalePrice();
this.stock = d.getStock();
}
public GoodsSpecValuesVO buildGoodsSpecValuesVO() {
return GoodsSpecValuesVO.builder().id(id).goodsSpecId(goodsSpecId)
.specValueName(specValueName).specValueImage(specValueImage)
.partNo(partNo).showPrice(showPrice).stock(stock)
.salePrice(salePrice).channelPrice(channelPrice).build();
}
}
package com.mmc.pms.entity.mall;
import com.mmc.pms.model.mall.GoodsResourcesVO;
import com.mmc.pms.model.mall.MallGoodsVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
* 商品基本信息(MallGoodsDO)实体类
*
* @author makejava
* @since 2023-07-24 21:10:02
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MallGoodsDO implements Serializable {
private static final long serialVersionUID = 709941898403563905L;
private Integer id;
/**
* 商品编号(ID12345678)
*/
private String goodsNo;
/**
* 商品名称
*/
private String tradeName;
/**
* 商品描述
*/
private String description;
/**
* 商品一级分类
*/
private Integer categoryPrimaryId;
/**
* 商品二级分类
*/
private Integer categorySubId;
/**
* 状态:0: 下架 1:上架
*/
private Integer shelfStatus;
/**
* 商品标签
*/
private String goodsLabel;
/**
* 标签是否显示0:否1:是
*/
private Integer labelShow;
/**
* 商品详情图 富文本
*/
private String goodsDetails;
/**
* 创建商品用户id
*/
private Integer userAccountId;
/**
* 排序字段
*/
private Integer sort;
private Date createTime;
private Date updateTime;
private Integer deleted;
private String url;
private Integer type;
private Integer imgId;
public MallGoodsDO(MallGoodsVO mallGoodsVO) {
this.id = mallGoodsVO.getId();
this.tradeName = mallGoodsVO.getTradeName();
this.description = mallGoodsVO.getDescription();
this.categoryPrimaryId = mallGoodsVO.getCategoryPrimaryId();
this.categorySubId = mallGoodsVO.getCategorySubId();
this.shelfStatus = mallGoodsVO.getShelfStatus();
this.goodsLabel = mallGoodsVO.getGoodsLabel();
this.labelShow = mallGoodsVO.getLabelShow();
this.goodsDetails = mallGoodsVO.getGoodsDetails();
}
public MallGoodsVO buildMallGoodsVO() {
return MallGoodsVO.builder().id(id).userAccountId(userAccountId).tradeName(tradeName).description(description)
.categoryPrimaryId(categoryPrimaryId).categorySubId(categorySubId).shelfStatus(shelfStatus)
.goodsLabel(goodsLabel).labelShow(labelShow).goodsDetails(goodsDetails).build();
}
public MallGoodsVO buildListMallGoodsVO() {
List<GoodsResourcesVO> resourcesList = new ArrayList<>();
GoodsResourcesVO goodsResourcesVO = new GoodsResourcesVO();
goodsResourcesVO.setId(imgId);
goodsResourcesVO.setUrl(url);
goodsResourcesVO.setType(type);
resourcesList.add(goodsResourcesVO);
return MallGoodsVO.builder().id(id).userAccountId(userAccountId).tradeName(tradeName).resourcesList(resourcesList)
.categoryPrimaryId(categoryPrimaryId).labelShow(labelShow).goodsLabel(goodsLabel).categorySubId(categorySubId)
.shelfStatus(shelfStatus).createTime(createTime).description(description).build();
}
}
package com.mmc.pms.entity.mall;
import com.mmc.pms.model.mall.GoodsResourcesVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.Date;
/**
* (MallGoodsResourcesDO)实体类
*
* @author makejava
* @since 2023-07-24 21:13:15
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MallGoodsResourcesDO implements Serializable {
private static final long serialVersionUID = -98370711703270379L;
private Integer id;
private Integer mallGoodsId;
/**
* 资源url
*/
private String url;
/**
* 类型:0主图 1副图 2视频
*/
private Integer type;
private Date createTime;
private Date updateTime;
public MallGoodsResourcesDO(GoodsResourcesVO d) {
this.type = d.getType();
this.id = d.getId();
this.url = d.getUrl();
}
public GoodsResourcesVO buildGoodsResourcesVO() {
return GoodsResourcesVO.builder().id(id).url(url).type(type).build();
}
}
package com.mmc.pms.model.category.dto;
import com.mmc.pms.entity.category.CategorySubDO;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
import java.util.List;
/**
* @Author small
* @Date 2023/7/20 16:35
* @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CategoryPrimaryDTO {
@ApiModelProperty(value = "id")
@NotNull(message = "id不能为空", groups = {Update.class})
@Min(value = 1, groups = {Update.class})
private Integer id;
@ApiModelProperty(value = "分类名称", required = true, example = "无人机")
@Size(max = 15, message = "分类名称不能超过15个字", groups = {Update.class, Create.class})
@NotBlank(message = "分类名称不能为空或空字符", groups = {Update.class, Create.class})
private String name;
@ApiModelProperty(value = "描述")
@Size(max = 70, message = "分类描述不能超过70个字", groups = {Update.class, Create.class})
private String description;
@ApiModelProperty(value = "icon图标")
private String icon;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间", example = "2023-07-14 10:13:12", required = true)
private Date createTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间", example = "2023-07-14 10:13:12", required = true)
private Date updateTime;
@ApiModelProperty(value = "二级分类")
private List<CategorySubDO> subDTOList;
@ApiModelProperty(value = "顺序")
private Integer sort;
}
package com.mmc.pms.model.category.dto;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Date;
/**
* @Author small
* @Date 2023/7/21 10:10
* @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class CategorySubDTO {
@ApiModelProperty(value = "id")
@NotNull(message = "id不能为空", groups = {Update.class})
@Min(value = 1, groups = {Update.class})
private Integer id;
@ApiModelProperty(value = "分类名称", required = true, example = "无人机")
@Size(max = 15, message = "分类名称不能超过15个字", groups = {Update.class, Create.class})
@NotBlank(message = "分类名称不能为空或空字符", groups = {Update.class, Create.class})
private String name;
@ApiModelProperty(value = "描述")
@Size(max = 70, message = "分类描述不能超过70个字", groups = {Update.class, Create.class})
private String description;
@ApiModelProperty(value = "一级id不能为空", required = true, example = "1")
@NotNull(message = "一级id不能为空", groups = {Update.class, Create.class})
private Integer categoryPrimaryId;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建时间", example = "2023-07-14 10:13:12", required = true)
private Date createTime;
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新时间", example = "2023-07-14 10:13:12", required = true)
private Date updateTime;
}
package com.mmc.pms.model.category.qo;
import com.mmc.pms.common.Page;
import com.mmc.pms.model.group.Freeze;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @Author small
* @Date 2023/7/21 15:22
* @Version 1.0
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CategoryQO {
private static final long serialVersionUID = -3729786590325257669L;
@ApiModelProperty(value = "一级分类id", required = false, example = "1")
private Integer id;
@ApiModelProperty(value = "当前页", required = true, example = "1")
@NotNull(message = "当前页不能为空", groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "页大小", required = true, example = "10")
@NotNull(message = "页大小不能为空", groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
}
package com.mmc.pms.model.category.vo;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Others;
import com.mmc.pms.model.group.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* @Author small
* @Date 2023/7/20 16:34
* @Version 1.0
*/
@Data
public class CategoryPrimaryVO {
@ApiModelProperty(value = "id", example = "1")
@NotNull(message = "id不能为空", groups = {Update.class, Others.class})
@Min(value = 1, groups = {Update.class})
private Integer id;
@ApiModelProperty(value = "分类名称", required = true, example = "无人机")
@Size(max = 15, message = "分类名称不能超过15个字", groups = {Update.class, Create.class})
@NotBlank(message = "分类名称不能为空或空字符", groups = {Update.class, Create.class})
private String name;
@ApiModelProperty(value = "描述", example = "描述一下")
@Size(max = 70, message = "分类描述不能超过70个字", groups = {Update.class, Create.class})
private String description;
@ApiModelProperty(value = "icon图标", example = "http://")
private String icon;
@ApiModelProperty(value = "顺序")
@NotNull(message = "sort不能为空", groups = {Others.class})
private Integer sort;
}
package com.mmc.pms.model.category.vo;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
/**
* @Author small
* @Date 2023/7/21 10:10
* @Version 1.0
*/
@Data
public class CategorySubVO {
@ApiModelProperty(value = "id", example = "1")
@NotNull(message = "id不能为空", groups = {Update.class})
@Min(value = 1, groups = {Update.class})
private Integer id;
@ApiModelProperty(value = "分类名称", required = true, example = "无人机")
@Size(max = 15, message = "分类名称不能超过15个字", groups = {Update.class, Create.class})
@NotBlank(message = "分类名称不能为空或空字符", groups = {Update.class, Create.class})
private String name;
@ApiModelProperty(value = "描述", example = "描述001")
@Size(max = 70, message = "分类描述不能超过70个字", groups = {Update.class, Create.class})
private String description;
@ApiModelProperty(value = "一级分类id不能为空", required = true, example = "1")
@NotNull(message = "一级分类id不能为空", groups = {Update.class, Create.class})
private Integer categoryPrimaryId;
}
package com.mmc.pms.model.mall;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* @Author LW
* @date 2023/7/24 17:57
* 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class GoodsResourcesVO {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "url")
private String url;
@ApiModelProperty(value = "类型:0主图 1副图 2视频")
private Integer type;
}
package com.mmc.pms.model.mall;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @Author LW
* @date 2023/7/24 20:16
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class GoodsSpecVO {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "商品id")
private Integer mallGoodsId;
@ApiModelProperty(value = "规格名称", example = "规格名称", required = true)
private String specName;
@ApiModelProperty(value = "选择方式 :0单选,1多选", example = "1", required = true)
private Integer chooseType;
@ApiModelProperty(value = "是否必选 : 0 非必选 1 必选", example = "0", required = true)
private Integer must;
@ApiModelProperty(value = "单位id", example = "1", required = true)
private Integer skuUnitId;
@ApiModelProperty(value = "规格值信息", required = true)
private List<GoodsSpecValuesVO> goodsSpecValuesList;
}
package com.mmc.pms.model.mall;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
/**
* @Author LW
* @date 2023/7/24 20:26
* 概要:
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class GoodsSpecValuesVO {
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "规格id", example = "1")
private Integer goodsSpecId;
@ApiModelProperty(value = "选项名称", example = "规格值名称", required = true)
private String specValueName;
@ApiModelProperty(value = "料号", example = "料号", required = true)
private String partNo;
@ApiModelProperty(value = "规格值图片url", example = "1.jpg", required = true)
private String specValueImage;
@ApiModelProperty(value = "是否展示销售价格 0:否 1:是", example = "1", required = true)
private Integer showPrice;
@ApiModelProperty(value = "库存数量", example = "100")
private Integer stock;
@ApiModelProperty(value = "销售价格", example = "100.00", required = true)
private BigDecimal salePrice;
@ApiModelProperty(value = "渠道价格", example = "50.00")
private BigDecimal channelPrice;
}
package com.mmc.pms.model.mall;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.group.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
/**
* @Author LW
* @date 2023/7/24 17:44
* 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class MallGoodsVO {
@ApiModelProperty(value = "id", example = "1")
@NotNull(message = "id不能为空", groups = {Update.class})
private Integer id;
@ApiModelProperty(value = "商品名称", example = "这是商品名称", required = true)
@NotBlank(message = "商品名称不能为空", groups = {Update.class, Create.class})
private String tradeName;
@ApiModelProperty(value = "商品描述", example = "商品描述", required = true)
@NotBlank(message = "商品描述不能为空", groups = {Update.class, Create.class})
private String description;
@ApiModelProperty(value = "商品资源:图片or视频及其他")
@NotEmpty(message = "图片不能为空")
private List<GoodsResourcesVO> resourcesList;
@ApiModelProperty(value = "一级分类id", example = "1", required = true)
@NotNull(message = "一级分类id不能为空", groups = {Update.class, Create.class})
private Integer categoryPrimaryId;
@ApiModelProperty(value = "二级分类id", example = "2", required = true)
@NotNull(message = "二级分类id不能为空", groups = {Update.class, Create.class})
private Integer categorySubId;
@ApiModelProperty(value = "商品状态", example = "1", required = true)
@NotNull(message = "商品状态不能为空", groups = {Update.class, Create.class})
private Integer shelfStatus;
@ApiModelProperty(value = "商品标签")
private String goodsLabel;
@ApiModelProperty(value = "标签是否显示 0否 1是")
private Integer labelShow;
@ApiModelProperty(value = "规格")
@NotEmpty(message = "规格不能为空", groups = {Update.class, Create.class})
private List<GoodsSpecVO> goodsSpecList;
@ApiModelProperty(value = "商品详情 富文本")
private String goodsDetails;
@ApiModelProperty(value = "创建时间 用作列表回显")
private Date createTime;
@ApiModelProperty(value = "店铺id 小程序用")
private Integer userAccountId;
}
package com.mmc.pms.model.other.dto; package com.mmc.pms.model.other.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
...@@ -10,40 +9,27 @@ import lombok.NoArgsConstructor; ...@@ -10,40 +9,27 @@ import lombok.NoArgsConstructor;
import java.io.Serializable; import java.io.Serializable;
/** /**
* @Author small @Date 2023/5/25 9:57 @Version 1.0 * @Author small
* @Date 2023/7/10 16:03
* @Version 1.0
*/ */
@Builder @Builder
@Data @Data
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
@ApiModel(description = "角色信息DTO")
public class RoleInfoDTO implements Serializable { public class RoleInfoDTO implements Serializable {
private static final long serialVersionUID = -4791023169682602298L; private static final long serialVersionUID = -4791023169682602298L;
@ApiModelProperty(value = "角色ID")
private Integer id;
@ApiModelProperty(value = "角色编号")
private String roleNo;
@ApiModelProperty(value = "角色名称/权限角色")
private String roleName;
@ApiModelProperty(value = "备注")
private String remark;
@ApiModelProperty(value = "账号名称/创建人")
private String userName;
@ApiModelProperty(value = "0不是超级管理员 1是超级管理员")
private Integer superAdmin;
@ApiModelProperty(value = "角色ID")
private Integer id;
@ApiModelProperty(value = "角色编号")
private String roleNo;
@ApiModelProperty(value = "角色名称")
private String roleName;
@ApiModelProperty(value = "是否为管理角色:0否 1是")
private Integer admin; // 是否为管理角色
@ApiModelProperty(value = "是否为运营角色:0否 1是")
private Integer operate;
@ApiModelProperty(value = "是否为系统角色:0否 1是")
private Integer system;
@ApiModelProperty(value = "是否为PMC发货角色:0否 1是")
private Integer pmc; // PMC发货角色
@ApiModelProperty(value = "是否可用:0否 1是")
private Integer roleStatus;
@ApiModelProperty(value = "备注")
private String remark;
} }
package com.mmc.pms.model.sale.qo;
import com.mmc.pms.common.Page;
import com.mmc.pms.model.group.Freeze;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
/**
* @Author LW
* @date 2022/3/22 9:44 概要:商品列表查询QO
*/
@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MallGoodsInfoQO {
@ApiModelProperty(value = "商品名称", example = "商品名称")
private String tradeName;
@ApiModelProperty(value = "商品一级分类", example = "1")
private Integer categoryPrimaryId;
@ApiModelProperty(value = "用户id", hidden = true)
private Integer userAccountId;
@ApiModelProperty(value = "商品状态 0:下架 1:上架")
private Integer shelfStatus;
@ApiModelProperty(value = "页码", required = true, example = "1")
@NotNull(
message = "页码不能为空",
groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true, example = "10")
@NotNull(
message = "每页显示数不能为空",
groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class)
private Integer pageSize;
public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize;
}
}
...@@ -13,7 +13,6 @@ import javax.validation.constraints.NotNull; ...@@ -13,7 +13,6 @@ import javax.validation.constraints.NotNull;
/** /**
* @Author LW * @Author LW
*
* @date 2022/3/22 9:44 概要:商品列表查询QO * @date 2022/3/22 9:44 概要:商品列表查询QO
*/ */
@Builder @Builder
...@@ -21,39 +20,39 @@ import javax.validation.constraints.NotNull; ...@@ -21,39 +20,39 @@ import javax.validation.constraints.NotNull;
@AllArgsConstructor @AllArgsConstructor
@NoArgsConstructor @NoArgsConstructor
public class MallGoodsQO { public class MallGoodsQO {
@ApiModelProperty(value = "商品名称", example = "商品名称") @ApiModelProperty(value = "商品名称", example = "商品名称")
private String goodsName; private String goodsName;
@ApiModelProperty(value = "商品类型 0:销售 1:租赁", example = "0") @ApiModelProperty(value = "商品类型 0:销售 1:租赁", example = "0")
private Integer goodsType; private Integer goodsType;
@ApiModelProperty(value = "开始时间", example = "2023-06-09 00:00:00") @ApiModelProperty(value = "开始时间", example = "2023-06-09 00:00:00")
private String startTime; private String startTime;
@ApiModelProperty(value = "结束时间", example = "2023-06-11 23:59:59") @ApiModelProperty(value = "结束时间", example = "2023-06-11 23:59:59")
private String endTime; private String endTime;
@ApiModelProperty(value = "状态 0:下架(仓库中)1:上架", example = "1") @ApiModelProperty(value = "状态 0:下架(仓库中)1:上架", example = "1")
private Integer status; private Integer status;
@ApiModelProperty(value = "目录id", example = "1") @ApiModelProperty(value = "目录id", example = "1")
private Integer directoryId; private Integer directoryId;
@ApiModelProperty(value = "页码", required = true, example = "1") @ApiModelProperty(value = "页码", required = true, example = "1")
@NotNull( @NotNull(
message = "页码不能为空", message = "页码不能为空",
groups = {Page.class, Freeze.class}) groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class) @Min(value = 1, groups = Page.class)
private Integer pageNo; private Integer pageNo;
@ApiModelProperty(value = "每页显示数", required = true, example = "10") @ApiModelProperty(value = "每页显示数", required = true, example = "10")
@NotNull( @NotNull(
message = "每页显示数不能为空", message = "每页显示数不能为空",
groups = {Page.class, Freeze.class}) groups = {Page.class, Freeze.class})
@Min(value = 1, groups = Page.class) @Min(value = 1, groups = Page.class)
private Integer pageSize; private Integer pageSize;
public void buildCurrentPage() { public void buildCurrentPage() {
this.pageNo = (pageNo - 1) * pageSize; this.pageNo = (pageNo - 1) * pageSize;
} }
} }
package com.mmc.pms.model.sale.vo;
import com.mmc.pms.model.sale.dto.ProductSpecVO;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Author small @Date 2023/5/16 15:27 @Version 1.0
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class GoodsSpecVO implements Serializable {
private static final long serialVersionUID = -8681372139970849591L;
@ApiModelProperty(value = "id")
private Integer id;
@ApiModelProperty(value = "规格名称")
private String goodsSpecName;
@ApiModelProperty(value = "产品类型")
private Integer goodsTypeId;
@ApiModelProperty(value = "产品:自定义时此字段可不用填写")
private Integer skuId;
@ApiModelProperty(value = "规格来源 0:获取 1:自定义")
private Integer flag;
@ApiModelProperty(value = "产品名称(自定义的时候才需要传值)")
private String productName;
@ApiModelProperty(value = "选项来源")
private List<MallProductSpecVO> specIds;
@ApiModelProperty(value = "选择方式")
private Integer chooseType;
@ApiModelProperty(value = "规格单位")
private Integer skuUnitId;
@ApiModelProperty(value = "是否必选")
private Integer must;
@ApiModelProperty(value = "自定义的信息填充")
private List<ProductSpecVO> customizeInfo;
@ApiModelProperty(value = "删除的自定义规格id")
private List<Integer> delProductSpecId;
}
...@@ -21,31 +21,31 @@ import java.util.List; ...@@ -21,31 +21,31 @@ import java.util.List;
*/ */
public interface GoodsInfoService { public interface GoodsInfoService {
ResultBody addGoods(GoodsAddVO goodsAddVO, Integer userAccountId); ResultBody addGoods(GoodsAddVO goodsAddVO, Integer userAccountId);
ResultBody editGoodsInfo(GoodsAddVO goodsAddVO); ResultBody editGoodsInfo(GoodsAddVO goodsAddVO);
ResultBody getGoodsInfoDetail(Integer goodsInfoId, Integer type, Integer leaseTerm); ResultBody getGoodsInfoDetail(Integer goodsInfoId, Integer type, Integer leaseTerm);
ResultBody getSkuUnit(); ResultBody getSkuUnit();
ResultBody getSaleServiceInfoToList(); ResultBody getSaleServiceInfoToList();
List<MallGoodsShopCarDTO> fillGoodsInfo(List<MallGoodsShopCarDTO> param); List<MallGoodsShopCarDTO> fillGoodsInfo(List<MallGoodsShopCarDTO> param);
List<MallProductSpecPriceDTO> feignListProductSpecPrice(ProductSpecPriceQO productSpecPriceQO); List<MallProductSpecPriceDTO> feignListProductSpecPrice(ProductSpecPriceQO productSpecPriceQO);
ProductSpecPriceDTO feignGetUnitPriceByTag(Integer specId, Integer tagId); ProductSpecPriceDTO feignGetUnitPriceByTag(Integer specId, Integer tagId);
List<OrderGoodsProdDTO> feignListProdGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO); List<OrderGoodsProdDTO> feignListProdGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO);
List<OrderGoodsIndstDTO> feignListIndstGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO); List<OrderGoodsIndstDTO> feignListIndstGoodsSkuInfo(MallOrderGoodsInfoQO mallOrderGoodsInfoQO);
PageResult listPageGoodsInfo(MallGoodsQO param); PageResult listPageGoodsInfo(MallGoodsQO param);
ResultBody batchOnShelfOrTakeDown(List<Integer> goodsIds, Integer status); ResultBody batchOnShelfOrTakeDown(List<Integer> goodsIds, Integer status);
ResultBody batchRemoveWareInfo(List<Integer> ids); ResultBody batchRemoveWareInfo(List<Integer> ids);
ResultBody exchangeGoodsInfo(Integer firstId, Integer secondId); ResultBody exchangeGoodsInfo(Integer firstId, Integer secondId);
} }
package com.mmc.pms.service.category;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.category.dto.CategoryPrimaryDTO;
import com.mmc.pms.model.category.qo.CategoryQO;
import com.mmc.pms.model.category.vo.CategoryPrimaryVO;
import com.mmc.pms.model.category.vo.CategorySubVO;
import com.mmc.pms.page.PageResult;
import java.util.List;
/**
* @Author small
* @Date 2023/7/20 16:26
* @Version 1.0
*/
public interface CategoryService {
ResultBody addPrimaryCategory(CategoryPrimaryVO primaryVO);
ResultBody deletePrimaryCategory(Integer id);
ResultBody updatePrimaryCategory(CategoryPrimaryVO primaryVO);
ResultBody addSubCategory(CategorySubVO subVO);
ResultBody updateSubCategory(CategorySubVO subVO);
ResultBody deleteSubCategory(Integer id);
ResultBody detailSubCategory(Integer id);
PageResult<CategoryPrimaryDTO> categoryList(CategoryQO param);
ResultBody exchange(List<CategoryPrimaryVO> list);
ResultBody<CategoryPrimaryDTO> appCategoryInfo();
}
package com.mmc.pms.service.category.impl;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.dao.category.CategoryDao;
import com.mmc.pms.entity.ServiceDO;
import com.mmc.pms.entity.category.CategoryPrimaryDO;
import com.mmc.pms.entity.category.CategorySubDO;
import com.mmc.pms.model.category.dto.CategoryPrimaryDTO;
import com.mmc.pms.model.category.dto.CategorySubDTO;
import com.mmc.pms.model.category.qo.CategoryQO;
import com.mmc.pms.model.category.vo.CategoryPrimaryVO;
import com.mmc.pms.model.category.vo.CategorySubVO;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.category.CategoryService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author small
* @Date 2023/7/20 16:26
* @Version 1.0
*/
@Service
public class CategoryServiceImpl implements CategoryService {
@Autowired
private CategoryDao categoryDao;
@Override
public ResultBody addPrimaryCategory(CategoryPrimaryVO primaryVO) {
int count = categoryDao.getCountName(primaryVO.getName());
if (count > 0) {
return ResultBody.error(ResultEnum.THE_NAME_OF_A_CLASS_MUST_BE_UNIQUE);
}
CategoryPrimaryDO primaryDO = new CategoryPrimaryDO(primaryVO);
categoryDao.addPrimaryCategory(primaryDO);
Integer id = primaryDO.getId();
categoryDao.updateSort(id);
return ResultBody.success();
}
@Override
public ResultBody deletePrimaryCategory(Integer id) {
Integer integer = categoryDao.selectPrimary(id);
if (integer != 0) {
return ResultBody.error(ResultEnum.THE_CURRENT_CATEGORY_IS_ASSOCIATED_WITH_GOODS);
}
categoryDao.deletePrimaryCategory(id);
return ResultBody.success();
}
@Override
public ResultBody updatePrimaryCategory(CategoryPrimaryVO primaryVO) {
CategoryPrimaryDO primaryDO = new CategoryPrimaryDO(primaryVO);
Integer count = categoryDao.categoryCount(primaryDO);
if (count > 0) {
return ResultBody.error(ResultEnum.THE_NAME_OF_A_CLASS_MUST_BE_UNIQUE);
}
categoryDao.updatePrimaryCategory(primaryDO);
return ResultBody.success();
}
@Override
public ResultBody addSubCategory(CategorySubVO subVO) {
int count = categoryDao.getCountSubName(subVO.getName(), subVO.getCategoryPrimaryId());
if (count > 0) {
return ResultBody.error(ResultEnum.THE_NAME_OF_THE_SECONDARY_CLASS_MUST_BE_UNIQUE);
}
CategorySubDO subDO = new CategorySubDO(subVO);
int number = (int) (Math.random() * 90 + 10);
subDO.setId(subVO.getCategoryPrimaryId() + 1 + number);
categoryDao.addSubCategory(subDO);
return ResultBody.success();
}
@Override
public ResultBody updateSubCategory(CategorySubVO subVO) {
CategorySubDO subDO = new CategorySubDO(subVO);
Integer count = categoryDao.categorySubCount(subDO);
if (count > 0) {
return ResultBody.error(ResultEnum.THE_NAME_OF_THE_SECONDARY_CLASS_MUST_BE_UNIQUE);
}
categoryDao.updateSubCategory(subDO);
return ResultBody.success();
}
@Override
public ResultBody deleteSubCategory(Integer id) {
Integer integer = categoryDao.selectSubMallGoods(id);
if (integer != 0) {
return ResultBody.error(ResultEnum.THE_CURRENT_CATEGORY_IS_ASSOCIATED_WITH_GOODS);
}
categoryDao.deleteSubCategory(id);
return ResultBody.success();
}
@Override
public ResultBody<CategorySubDTO> detailSubCategory(Integer id) {
CategorySubDO subDO = categoryDao.detailSubCategory(id);
CategorySubDTO categorySubDTO = null;
if (subDO != null) {
categorySubDTO = subDO.buildCategorySubDTO();
}
return ResultBody.success(categorySubDTO);
}
@Override
public PageResult<CategoryPrimaryDTO> categoryList(CategoryQO param) {
int count = categoryDao.categoryListCount(param);
if (count == 0) {
return PageResult.buildPage(param.getPageNo(), param.getPageSize(), count);
}
param.buildCurrentPage();
List<CategoryPrimaryDO> categoryPrimaryDOS = categoryDao.categoryList(param);
List<CategoryPrimaryDTO> collect = categoryPrimaryDOS.stream().map(t -> t.buildCategoryPrimaryDTO()).collect(Collectors.toList());
return PageResult.buildPage(param.getPageNo(), param.getPageSize(), count, collect);
}
@Transactional
@Override
public ResultBody exchange(List<CategoryPrimaryVO> list) {
Integer sort = list.get(0).getSort();
ServiceDO serviceDO = new ServiceDO();
serviceDO.setId(list.get(0).getId());
serviceDO.setSort(list.get(1).getSort());
categoryDao.exchange(serviceDO);
ServiceDO serviceDO1 = new ServiceDO();
serviceDO1.setId(list.get(1).getId());
serviceDO1.setSort(sort);
categoryDao.exchange(serviceDO1);
return ResultBody.success();
}
@Override
public ResultBody<CategoryPrimaryDTO> appCategoryInfo() {
// 获取所有以及分类
List<CategoryPrimaryDO> categoryPrimaryList = categoryDao.selectPrimaryList();
if (CollectionUtils.isEmpty(categoryPrimaryList)) {
return ResultBody.success();
}
List<CategoryPrimaryDTO> primaryList = categoryPrimaryList.stream()
.map(CategoryPrimaryDO::buildCategoryPrimaryDTO).collect(Collectors.toList());
List<Integer> ids = primaryList.stream().map(CategoryPrimaryDTO::getId).collect(Collectors.toList());
// 批量查找二级分类
List<CategorySubDO> categorySubList = categoryDao.selectCategorySubList(ids);
if (CollectionUtils.isNotEmpty(categorySubList)) {
Map<Integer, List<CategorySubDO>> subMap = categorySubList.stream().collect(Collectors.groupingBy(CategorySubDO::getCategoryPrimaryId));
for (CategoryPrimaryDTO categoryPrimaryDTO : primaryList) {
List<CategorySubDO> categorySubDOList = subMap.get(categoryPrimaryDTO.getId());
categoryPrimaryDTO.setSubDTOList(categorySubDOList);
}
}
return ResultBody.success(primaryList);
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
package com.mmc.pms.service.mall;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.mall.MallGoodsVO;
import java.util.List;
/**
* @Author LW
* @date 2023/7/26 14:55
* 概要:
*/
public interface AppMallGoodsService {
ResultBody<MallGoodsVO> queryBrandGoods(Integer userAccountId);
ResultBody<MallGoodsVO> queryGoodsInfoByCategorySub(List<Integer> categorySubIds);
}
package com.mmc.pms.service.mall;
import com.mmc.pms.auth.dto.LoginSuccessDTO;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.mall.MallGoodsVO;
import com.mmc.pms.model.sale.qo.MallGoodsInfoQO;
import com.mmc.pms.page.PageResult;
/**
* @Author LW
* @date 2023/7/24 17:37 概要:
*/
public interface MallGoodsService {
ResultBody addMallGoods(MallGoodsVO mallGoodsVO, Integer userAccountId);
ResultBody<MallGoodsVO> mallGoodsDetails(Integer id);
ResultBody editMallGoods(MallGoodsVO mallGoodsVO, Integer userAccountId);
ResultBody getSkuUnit();
PageResult listPageGoodsInfo(MallGoodsInfoQO param, LoginSuccessDTO loginSuccessDTO);
ResultBody exchange(Integer firstId, Integer secondId);
ResultBody upOrDownShelf(Integer id, Integer status);
ResultBody removeMallGoods(Integer id);
ResultBody feignRemoveGoodsByBackUserAccountId(Integer id);
}
package com.mmc.pms.service.mall.impl;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.dao.mall.AppMallGoodsDao;
import com.mmc.pms.entity.mall.MallGoodsDO;
import com.mmc.pms.model.mall.MallGoodsVO;
import com.mmc.pms.service.mall.AppMallGoodsService;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Author LW
* @date 2023/7/26 14:55
* 概要:
*/
@Service
public class AppMallGoodsServiceImpl implements AppMallGoodsService {
@Resource
private AppMallGoodsDao appMallGoodsDao;
@Override
public ResultBody<MallGoodsVO> queryBrandGoods(Integer userAccountId) {
List<MallGoodsDO> mallGoodsList = appMallGoodsDao.queryGoodsInfo(userAccountId, null);
return checkGoodsInfo(mallGoodsList);
}
@Override
public ResultBody<MallGoodsVO> queryGoodsInfoByCategorySub(List<Integer> categorySubIds) {
List<MallGoodsDO> mallGoodsList = appMallGoodsDao.queryGoodsInfo(null, categorySubIds);
return checkGoodsInfo(mallGoodsList);
}
private ResultBody<MallGoodsVO> checkGoodsInfo(List<MallGoodsDO> mallGoodsList) {
if (CollectionUtils.isNotEmpty(mallGoodsList)) {
return ResultBody.success(mallGoodsList.stream().map(MallGoodsDO::buildListMallGoodsVO).collect(Collectors.toList()));
}
return ResultBody.success();
}
}
package com.mmc.pms.service.mall.impl;
import com.mmc.pms.auth.dto.LoginSuccessDTO;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.common.ResultEnum;
import com.mmc.pms.dao.mall.MallGoodsDao;
import com.mmc.pms.entity.SkuUnitDO;
import com.mmc.pms.entity.mall.GoodsSpecDO;
import com.mmc.pms.entity.mall.GoodsSpecValuesDO;
import com.mmc.pms.entity.mall.MallGoodsDO;
import com.mmc.pms.entity.mall.MallGoodsResourcesDO;
import com.mmc.pms.model.mall.GoodsResourcesVO;
import com.mmc.pms.model.mall.GoodsSpecVO;
import com.mmc.pms.model.mall.GoodsSpecValuesVO;
import com.mmc.pms.model.mall.MallGoodsVO;
import com.mmc.pms.model.sale.dto.SkuUnitDTO;
import com.mmc.pms.model.sale.qo.MallGoodsInfoQO;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.mall.MallGoodsService;
import com.mmc.pms.util.CodeUtil;
import com.mmc.pms.util.TDateUtil;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import javax.annotation.Resource;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @Author LW
* @date 2023/7/24 17:37 概要:
*/
@Service
public class MallGoodsServiceImpl implements MallGoodsService {
@Resource
private MallGoodsDao mallGoodsDao;
@Override
@Transactional(rollbackFor = Exception.class)
public ResultBody addMallGoods(MallGoodsVO mallGoodsVO, Integer userAccountId) {
ResultBody resultError = checkInformation(mallGoodsVO, userAccountId);
if (resultError != null) return resultError;
int count = mallGoodsDao.countMallGoods(userAccountId);
MallGoodsDO mallGoodsDO = new MallGoodsDO(mallGoodsVO);
mallGoodsDO.setGoodsNo("MG" + TDateUtil.getDateStr(new Date(), "yyyyMMddHHmmss") + CodeUtil.getRandomNum(4));
mallGoodsDO.setUserAccountId(userAccountId);
mallGoodsDO.setSort(count + 1);
// 将基础信息存储入库
mallGoodsDao.insertMallGoodsBaseInfo(mallGoodsDO);
// 将商品图片等资源存入数据库中
insertMallGoodsResources(mallGoodsVO, mallGoodsDO.getId());
// 将商品规格存入数据库
insertMallGoodsSpec(mallGoodsVO.getGoodsSpecList(), mallGoodsDO.getId());
return ResultBody.success();
}
@Transactional(rollbackFor = Exception.class)
public void insertMallGoodsSpec(List<GoodsSpecVO> goodsSpecList, Integer id) {
// 获取输入的规格信息
for (GoodsSpecVO goodsSpecVO : goodsSpecList) {
goodsSpecVO.setMallGoodsId(id);
GoodsSpecDO goodsSpecDO = new GoodsSpecDO(goodsSpecVO);
// 插入规格信息
mallGoodsDao.insertGoodsSpec(goodsSpecDO);
List<GoodsSpecValuesDO> goodsSpecValuesList = goodsSpecVO.getGoodsSpecValuesList().stream().map(d -> {
d.setGoodsSpecId(goodsSpecDO.getId());
return new GoodsSpecValuesDO(d);
}).collect(Collectors.toList());
// 批量插入规格值的信息
mallGoodsDao.batchInsertSpecValues(goodsSpecValuesList);
}
}
@Transactional(rollbackFor = Exception.class)
public void insertMallGoodsResources(MallGoodsVO mallGoodsVO, Integer id) {
List<MallGoodsResourcesDO> mallGoodsResourcesList = mallGoodsVO.getResourcesList().stream().map(d -> {
MallGoodsResourcesDO mallGoodsResourcesDO = new MallGoodsResourcesDO(d);
mallGoodsResourcesDO.setMallGoodsId(id);
return mallGoodsResourcesDO;
}).collect(Collectors.toList());
mallGoodsDao.batchInsertMallGoodsResources(mallGoodsResourcesList);
}
private ResultBody checkInformation(MallGoodsVO mallGoodsVO, Integer userAccountId) {
// 查询该账账号下是否有相同的商品名称存在
if (mallGoodsDao.countMallGoodsByName(mallGoodsVO, userAccountId) > 0) {
return ResultBody.error(ResultEnum.GOODS_CATEGORY_NAME_EXIST_ERROR);
}
// 判断主图是否为空
List<GoodsResourcesVO> resourcesList = mallGoodsVO.getResourcesList()
.stream().filter(d -> d.getType().equals(0))
.collect(Collectors.toList());
if (resourcesList.size() == 0) {
return ResultBody.error(ResultEnum.GOODS_PIC_IS_NOT_NULL);
}
return null;
}
@Override
public ResultBody<MallGoodsVO> mallGoodsDetails(Integer id) {
MallGoodsDO mallGoodsDO = mallGoodsDao.getMallGoodsBaseInfo(id);
if (mallGoodsDO == null) {
return ResultBody.error("商品不存在或已删除!");
}
MallGoodsVO mallGoodsVO = mallGoodsDO.buildMallGoodsVO();
// 获取图片及其他资源信息
List<MallGoodsResourcesDO> mallGoodsResourcesList = mallGoodsDao.getMallGoodsResources(id);
mallGoodsVO.setResourcesList(mallGoodsResourcesList.stream()
.map(MallGoodsResourcesDO::buildGoodsResourcesVO).collect(Collectors.toList()));
// 获取规格信息
List<GoodsSpecDO> goodsSpecList = mallGoodsDao.getMallGoodsSpec(id);
List<GoodsSpecVO> goodsSpec = goodsSpecList.stream().map(GoodsSpecDO::buildGoodsSpecVO)
.collect(Collectors.toList());
// 获取规格值信息
List<GoodsSpecValuesDO> goodsSpecValuesList = mallGoodsDao.getMallGoodsSpecValues(goodsSpec.stream().map(GoodsSpecVO::getId).collect(Collectors.toList()));
List<GoodsSpecValuesVO> goodsSpecValues = goodsSpecValuesList.stream().map(GoodsSpecValuesDO::buildGoodsSpecValuesVO).collect(Collectors.toList());
Map<Integer, List<GoodsSpecValuesVO>> goodsSpecValuesVO = goodsSpecValues.stream().collect(Collectors.groupingBy(GoodsSpecValuesVO::getGoodsSpecId));
for (GoodsSpecVO goodsSpecVO : goodsSpec) {
goodsSpecVO.setGoodsSpecValuesList(goodsSpecValuesVO.get(goodsSpecVO.getId()));
}
mallGoodsVO.setGoodsSpecList(goodsSpec);
return ResultBody.success(mallGoodsVO);
}
@Override
@Transactional(rollbackFor = Exception.class)
public ResultBody editMallGoods(MallGoodsVO mallGoodsVO, Integer userAccountId) {
ResultBody resultError = checkInformation(mallGoodsVO, userAccountId);
if (resultError != null) return resultError;
MallGoodsDO mallGoodsDO = new MallGoodsDO(mallGoodsVO);
// 修改商城商品的基本信息
mallGoodsDao.updateMallGoods(mallGoodsDO);
// 修改商城商品的图片等资源信息,先删除后新增
mallGoodsDao.deleteMallGoodsResources(mallGoodsVO.getId());
this.insertMallGoodsResources(mallGoodsVO, mallGoodsVO.getId());
// 从数据库获取商品规格信息
List<GoodsSpecDO> dbGoodsSpec = mallGoodsDao.getMallGoodsSpec(mallGoodsVO.getId());
List<Integer> specIds = mallGoodsVO.getGoodsSpecList().stream().map(GoodsSpecVO::getId).filter(Objects::nonNull).collect(Collectors.toList());
// 对比要删除的规格
List<Integer> deleteSpec = dbGoodsSpec.stream().map(GoodsSpecDO::getId).filter(id -> !specIds.contains(id)).collect(Collectors.toList());
if (deleteSpec.size() != 0) {
mallGoodsDao.deleteGoodsSpec(deleteSpec);
}
// 获取规格值信息
Map<Integer, List<GoodsSpecValuesDO>> specValuesMap = mallGoodsDao.getMallGoodsSpecValues(specIds).stream()
.collect(Collectors.groupingBy(GoodsSpecValuesDO::getGoodsSpecId));
// 修改规格信息
for (GoodsSpecVO goodsSpecVO : mallGoodsVO.getGoodsSpecList()) {
if (goodsSpecVO.getId() != null) {
GoodsSpecDO goodsSpecDO = new GoodsSpecDO(goodsSpecVO);
mallGoodsDao.updateGoodsSpec(goodsSpecDO);
// 数据库获取到的规格值信息
List<GoodsSpecValuesDO> dbSpecValues = specValuesMap.get(goodsSpecVO.getId());
List<Integer> specValuesId = goodsSpecVO.getGoodsSpecValuesList().stream().map(GoodsSpecValuesVO::getId).filter(Objects::nonNull).collect(Collectors.toList());
List<Integer> deleteSpecValueId = dbSpecValues.stream().map(GoodsSpecValuesDO::getId).filter(id -> !specValuesId.contains(id)).collect(Collectors.toList());
if (deleteSpecValueId.size() != 0) {
mallGoodsDao.deleteGoodsSpecValues(deleteSpecValueId);
}
// 修改规格值的信息
List<GoodsSpecValuesVO> updateSpecValue = goodsSpecVO.getGoodsSpecValuesList().stream().filter(d -> d.getId() != null).collect(Collectors.toList());
for (GoodsSpecValuesVO goodsSpecValuesVO : updateSpecValue) {
GoodsSpecValuesDO goodsSpecValuesDO = new GoodsSpecValuesDO(goodsSpecValuesVO);
goodsSpecValuesDO.setGoodsSpecId(goodsSpecVO.getId());
mallGoodsDao.updateGoodsSpecValue(goodsSpecValuesDO);
}
// 新增id为空的规格值
List<GoodsSpecValuesVO> newGoodsSpecValues = goodsSpecVO.getGoodsSpecValuesList().stream().filter(d -> d.getId() == null).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(newGoodsSpecValues)) {
List<GoodsSpecValuesDO> goodsSpecValuesList = newGoodsSpecValues.stream().map(d -> {
d.setGoodsSpecId(goodsSpecVO.getId());
return new GoodsSpecValuesDO(d);
}).collect(Collectors.toList());
// 批量插入规格值的信息
mallGoodsDao.batchInsertSpecValues(goodsSpecValuesList);
}
}
}
// 新增id为空的规格
List<GoodsSpecVO> newGoodsSpec = mallGoodsVO.getGoodsSpecList().stream().filter(d -> d.getId() == null).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(newGoodsSpec)) {
this.insertMallGoodsSpec(newGoodsSpec, mallGoodsVO.getId());
}
return ResultBody.success();
}
@Override
public ResultBody getSkuUnit() {
List<SkuUnitDO> skuUnitList = mallGoodsDao.getSkuUnit();
List<SkuUnitDTO> list =
skuUnitList.stream().map(SkuUnitDO::buildSkuUnitDTO).collect(Collectors.toList());
return ResultBody.success(list);
}
@Override
public PageResult listPageGoodsInfo(MallGoodsInfoQO param, LoginSuccessDTO loginSuccessDTO) {
if (loginSuccessDTO.getRoleInfo().getSuperAdmin().equals(1)) {
// 超级管理员获取所有商品信息
return getMallGoodsInfo(param);
} else {
// 非超级管理员获取自家的商品信息
param.setUserAccountId(loginSuccessDTO.getUserAccountId());
return getMallGoodsInfo(param);
}
}
private PageResult getMallGoodsInfo(MallGoodsInfoQO param) {
int count;
List<MallGoodsDO> mallGoodsList;
count = mallGoodsDao.countListMallGoods(param);
if (count == 0) {
return PageResult.buildPage(param.getPageNo(), param.getPageSize(), count);
}
Integer pageNo = param.getPageNo();
param.buildCurrentPage();
mallGoodsList = mallGoodsDao.listMallGoods(param);
List<MallGoodsVO> pageList = mallGoodsList.stream().map(MallGoodsDO::buildListMallGoodsVO).collect(Collectors.toList());
return PageResult.buildPage(pageNo, param.getPageSize(), count, pageList);
}
@Override
@Transactional(rollbackFor = Exception.class)
public ResultBody exchange(Integer firstId, Integer secondId) {
MallGoodsDO firstMallGoodsBaseInfo = mallGoodsDao.getMallGoodsBaseInfo(firstId);
MallGoodsDO secondMallGoodsBaseInfo = mallGoodsDao.getMallGoodsBaseInfo(secondId);
int updateCount1 = mallGoodsDao.updateMallGoodsSort(firstId, secondMallGoodsBaseInfo.getSort());
int updateCount2 = mallGoodsDao.updateMallGoodsSort(secondId, firstMallGoodsBaseInfo.getSort());
if (updateCount1 == updateCount2) {
return ResultBody.success();
} else {
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
return ResultBody.error("排序失败");
}
}
@Override
public ResultBody upOrDownShelf(Integer id, Integer status) {
mallGoodsDao.updateMallGoodsByShelf(id, status);
return ResultBody.success();
}
@Override
public ResultBody removeMallGoods(Integer id) {
mallGoodsDao.removeMallGoods(id);
return ResultBody.success();
}
@Override
public ResultBody feignRemoveGoodsByBackUserAccountId(Integer id) {
mallGoodsDao.feignRemoveGoodsByBackUserAccountId(id);
return ResultBody.success();
}
}
package com.mmc.pms.util;
/**
* @author 作者 geDuo
* @version 创建时间:2022年2月21日 下午3:55:10
* https://www.cnblogs.com/sgh1023/p/14094592.html
* @explain 雪花算法-分布式id
*/
public class SnowFlake {
/**
* 起始的时间戳
*/
private final static long START_STMP = 1480166465631L;
/**
* 每一部分占用的位数
*/
private final static long SEQUENCE_BIT = 12; // 序列号占用的位数
private final static long MACHINE_BIT = 5; // 机器标识占用的位数
private final static long DATACENTER_BIT = 5;// 数据中心占用的位数
/**
* 每一部分的最大值
*/
private final static long MAX_DATACENTER_NUM = -1L ^ (-1L << DATACENTER_BIT);
private final static long MAX_MACHINE_NUM = -1L ^ (-1L << MACHINE_BIT);
private final static long MAX_SEQUENCE = -1L ^ (-1L << SEQUENCE_BIT);
/**
* 每一部分向左的位移
*/
private final static long MACHINE_LEFT = SEQUENCE_BIT;
private final static long DATACENTER_LEFT = SEQUENCE_BIT + MACHINE_BIT;
private final static long TIMESTMP_LEFT = DATACENTER_LEFT + DATACENTER_BIT;
private long datacenterId; // 数据中心
private long machineId; // 机器标识
private long sequence = 0L; // 序列号
private long lastStmp = -1L;// 上一次时间戳
public SnowFlake(long datacenterId, long machineId) {
if (datacenterId > MAX_DATACENTER_NUM || datacenterId < 0) {
throw new IllegalArgumentException("datacenterId can't be greater than MAX_DATACENTER_NUM or less than 0");
}
if (machineId > MAX_MACHINE_NUM || machineId < 0) {
throw new IllegalArgumentException("machineId can't be greater than MAX_MACHINE_NUM or less than 0");
}
this.datacenterId = datacenterId;
this.machineId = machineId;
}
/**
* 产生下一个ID
*
* @return
*/
public synchronized long nextId() {
long currStmp = getNewstmp();
if (currStmp < lastStmp) {
throw new RuntimeException("Clock moved backwards. Refusing to generate id");
}
if (currStmp == lastStmp) {
// 相同毫秒内,序列号自增
sequence = (sequence + 1) & MAX_SEQUENCE;
// 同一毫秒的序列数已经达到最大
if (sequence == 0L) {
currStmp = getNextMill();
}
} else {
// 不同毫秒内,序列号置为0
sequence = 0L;
}
lastStmp = currStmp;
return (currStmp - START_STMP) << TIMESTMP_LEFT // 时间戳部分
| datacenterId << DATACENTER_LEFT // 数据中心部分
| machineId << MACHINE_LEFT // 机器标识部分
| sequence; // 序列号部分
}
private long getNextMill() {
long mill = getNewstmp();
while (mill <= lastStmp) {
mill = getNewstmp();
}
return mill;
}
private long getNewstmp() {
return System.currentTimeMillis();
}
public static void main(String[] args) {
SnowFlake snowFlake = new SnowFlake(2, 3);
for (int i = 0; i < (1 << 12); i++) {
System.out.println(snowFlake.nextId());
}
}
}
<?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.mmc.pms.dao.category.CategoryDao">
<resultMap id="CategoryList" type="com.mmc.pms.entity.category.CategoryPrimaryDO">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="description" column="description"/>
<result property="icon" column="icon"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<collection property="subDOList" ofType="com.mmc.pms.entity.category.CategorySubDO"
select="selectSubList"
column="{categoryPrimaryId=id}">
</collection>
</resultMap>
<select id="selectSubList" resultType="com.mmc.pms.entity.category.CategorySubDO">
select id,
`name`,
description,
category_primary_id AS categoryPrimaryId,
create_time AS createTime,
update_time AS updateTime
from category_sub
where category_primary_id = #{categoryPrimaryId}
order by create_time desc
</select>
<select id="categoryListCount" resultType="int" parameterType="com.mmc.pms.model.category.qo.CategoryQO">
SELECT count(*)
FROM
category_primary
WHERE 1=1
<if test=" id != null and id != '' ">
and id=#{id}
</if>
</select>
<select id="getCountName" resultType="java.lang.Integer">
select count(*)
from category_primary
where 1=1
<if test=" name != null and name != '' ">
and `name` = #{name}
</if>
</select>
<update id="exchange" parameterType="com.mmc.pms.entity.ServiceDO">
update category_primary
<set>
<if test=" sort != null ">
sort = #{sort}
</if>
</set>
where id = #{id}
</update>
<insert id="addPrimaryCategory" useGeneratedKeys="true"
keyProperty="id" parameterType="com.mmc.pms.entity.category.CategoryPrimaryDO">
insert into category_primary(`name`, description, create_time, update_time, icon)
values (#{name}, #{description}, NOW(), NOW(), #{icon})
</insert>
<update id="updateSort">
update category_primary
<set>
<if test="id!=null">
sort = #{id}
</if>
</set>
where id=#{id}
</update>
<delete id="deletePrimaryCategory">
delete
from category_primary
where id = #{id}
</delete>
<select id="categoryCount" resultType="java.lang.Integer">
select count(*)
from category_primary
where 1=1
<if test=" name != null and name != '' ">
and `name` = #{name}
</if>
<if test=" id != null and id != '' ">
and id != #{id}
</if>
</select>
<update id="updatePrimaryCategory"
parameterType="com.mmc.pms.entity.category.CategoryPrimaryDO">
UPDATE category_primary
<set>
<if test=" name != null and name != '' ">
`name` = #{name},
</if>
<if test=" description != null and description != '' ">
description = #{description},
</if>
<if test=" icon != null and icon != '' ">
icon = #{icon},
</if>
update_time=NOW()
</set>
where id = #{id}
</update>
<select id="getCountSubName" resultType="java.lang.Integer">
select count(*)
from category_sub
where 1=1
<if test=" name != null and name != '' ">
and `name` = #{name}
</if>
<if test=" categoryPrimaryId != null and categoryPrimaryId != '' ">
and category_primary_id = #{categoryPrimaryId}
</if>
</select>
<insert id="addSubCategory" useGeneratedKeys="true"
keyProperty="id" parameterType="com.mmc.pms.entity.category.CategorySubDO">
insert into category_sub(id, `name`, description, create_time, update_time, category_primary_id)
values (#{id}, #{name}, #{description}, NOW(), NOW(), #{categoryPrimaryId})
</insert>
<select id="categorySubCount" resultType="java.lang.Integer">
select count(*)
from category_sub
where 1=1
<if test=" name != null and name != '' ">
and `name` = #{name}
</if>
<if test=" id != null and id != '' ">
and id != #{id}
</if>
<if test=" categoryPrimaryId != null and categoryPrimaryId != '' ">
and category_primary_id != #{categoryPrimaryId}
</if>
</select>
<update id="updateSubCategory"
parameterType="com.mmc.pms.entity.category.CategorySubDO">
UPDATE category_sub
<set>
<if test=" name != null and name != '' ">
`name` = #{name},
</if>
<if test=" description != null and description != '' ">
description = #{description},
</if>
update_time=NOW()
</set>
where id = #{id}
</update>
<delete id="deleteSubCategory">
delete
from category_sub
where id = #{id}
</delete>
<select id="detailSubCategory" resultType="com.mmc.pms.entity.category.CategorySubDO">
select id,
`name`,
description,
create_time AS createTime,
update_time AS updateTime,
category_primary_id AS categoryPrimaryId
from category_sub
where id = #{id}
</select>
<select id="categoryList" resultMap="CategoryList">
select id, `name`, description, create_time, update_time, icon,sort
from category_primary where 1=1
<if test=" id != null and id != '' ">
and id =#{id}
</if>
order by sort desc, update_time desc, create_time desc
limit #{pageNo},#{pageSize}
</select>
<select id="selectPrimaryList" resultType="com.mmc.pms.entity.category.CategoryPrimaryDO">
select id,
`name`,
description,
create_time,
icon,
sort
from category_primary
order by sort desc, update_time desc, create_time desc
</select>
<select id="selectCategorySubList" resultType="com.mmc.pms.entity.category.CategorySubDO">
select id,
`name`,
description,
create_time,
update_time,
category_primary_id
from category_sub
<where>
<foreach collection="list" separator="," item="item" open="category_primary_id in (" close=")">
#{item}
</foreach>
</where>
</select>
<select id="selectSubMallGoods" resultType="java.lang.Integer">
select count(*)
from mall_goods
where category_sub_id = #{id}
</select>
<select id="selectPrimary" resultType="java.lang.Integer">
select count(*)
from mall_goods
where category_primary_id = #{id}
</select>
</mapper>
<?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.mmc.pms.dao.mall.AppMallGoodsDao">
<select id="queryGoodsInfo" resultType="com.mmc.pms.entity.mall.MallGoodsDO">
SELECT mg.id,
mg.trade_name,
mg.shelf_status,
mg.create_time,
mg.description,
mg.category_primary_id,
mg.user_account_id,
mg.goods_label,
mg.label_show,
mg.category_sub_id,
mg.goods_label,
img.id as imgId, img.url,
img.type
FROM mall_goods mg
INNER JOIN mall_goods_resources img ON mg.id = img.mall_goods_id
AND img.type = 0
<where>
mg.is_deleted = 0 and mg.shelf_status = 1
<if test="userAccountId != null">
and mg.user_account_id = #{userAccountId}
</if>
<if test="categorySubIds != null">
<foreach collection="categorySubIds" item="item" open="and mg.category_sub_id in (" close=")"
separator=",">
#{item}
</foreach>
</if>
</where>
ORDER BY
mg.sort DESC,mg.create_time DESC
</select>
</mapper>
\ No newline at end of file
<?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.mmc.pms.dao.mall.MallGoodsDao">
<insert id="insertMallGoodsBaseInfo" keyProperty="id"
useGeneratedKeys="true" parameterType="com.mmc.pms.entity.mall.MallGoodsDO">
insert into mall_goods(goods_no,
trade_name,
description,
category_primary_id,
category_sub_id,
shelf_status,
goods_label,
label_show,
goods_details,
user_account_id,
sort)
values ( #{goodsNo}, #{tradeName}, #{description}, #{categoryPrimaryId}, #{categorySubId}
, #{shelfStatus}, #{goodsLabel}, #{labelShow}, #{goodsDetails}, #{userAccountId}, #{sort})
</insert>
<insert id="insertGoodsSpec" parameterType="com.mmc.pms.entity.mall.GoodsSpecDO"
keyProperty="id" useGeneratedKeys="true">
insert into goods_spec (mall_goods_id,
spec_name,
choose_type,
must,
sku_unit_id)
values (#{mallGoodsId}, #{specName}, #{chooseType}, #{must}, #{skuUnitId})
</insert>
<insert id="batchInsertSpecValues" parameterType="list">
insert into goods_spec_values (goods_spec_id,
spec_value_name,
part_no,
spec_value_image,
show_price,
stock,
sale_price,
channel_price)
values
<foreach collection="list" item="item" separator=",">
(#{item.goodsSpecId},#{item.specValueName},#{item.partNo},#{item.specValueImage}
,#{item.showPrice},#{item.stock},#{item.salePrice},#{item.channelPrice})
</foreach>
</insert>
<insert id="batchInsertMallGoodsResources">
insert into mall_goods_resources (mall_goods_id,
url,
`type`
)
values
<foreach collection="list" item="item" separator=",">
(#{item.mallGoodsId},#{item.url},#{item.type})
</foreach>
</insert>
<update id="updateMallGoods">
UPDATE mall_goods
SET trade_name = #{mallGoodsDO.tradeName},
description = #{mallGoodsDO.description},
category_primary_id = #{mallGoodsDO.categoryPrimaryId},
category_sub_id = #{mallGoodsDO.categorySubId},
shelf_status = #{mallGoodsDO.shelfStatus},
goods_label = #{mallGoodsDO.goodsLabel},
label_show = #{mallGoodsDO.labelShow},
goods_details = #{mallGoodsDO.goodsDetails}
WHERE id = #{mallGoodsDO.id}
</update>
<update id="updateGoodsSpec">
update goods_spec
set spec_name = #{specName},
choose_type = #{chooseType},
must = #{must},
sku_unit_id = #{skuUnitId}
where id = #{id}
</update>
<update id="updateGoodsSpecValue">
update goods_spec_values
set goods_spec_id = #{goodsSpecId},
spec_value_name = #{specValueName},
part_no =#{partNo},
spec_value_image = #{specValueImage},
show_price = #{showPrice},
stock = #{stock},
sale_price = #{salePrice},
channel_price =#{channelPrice}
where id = #{id}
</update>
<update id="updateMallGoodsSort">
update mall_goods
set sort = #{sort}
where id = #{id}
</update>
<update id="updateMallGoodsByShelf">
update mall_goods
set shelf_status = #{status}
where id = #{id}
</update>
<update id="removeMallGoods">
update mall_goods
set is_deleted = 1
where id = #{id}
</update>
<update id="feignRemoveGoodsByBackUserAccountId">
update mall_goods
set is_deleted = 1
where user_account_id = #{id}
</update>
<delete id="deleteMallGoodsResources">
delete
from mall_goods_resources
where mall_goods_id = #{id}
</delete>
<delete id="deleteGoodsSpec">
delete
from goods_spec
<where>
<foreach collection="list" open="id in (" close=")" item="item" separator=",">
#{item}
</foreach>
</where>
</delete>
<delete id="deleteGoodsSpecValues">
delete
from goods_spec_values
<where>
<foreach collection="list" open="id in (" close=")" item="item" separator=",">
#{item}
</foreach>
</where>
</delete>
<select id="countMallGoodsByName" resultType="java.lang.Integer">
select count(*)
from mall_goods
where is_deleted = 0
and trade_name = #{mallGoodsVO.tradeName}
and user_account_id = #{userAccountId}
<if test="mallGoodsVO.id!=null">
and id <![CDATA[<>]]> #{mallGoodsVO.id}
</if>
</select>
<select id="countMallGoods" resultType="java.lang.Integer">
select count(*)
from mall_goods
where user_account_id = #{userAccountId}
</select>
<select id="getMallGoodsBaseInfo" resultType="com.mmc.pms.entity.mall.MallGoodsDO">
SELECT id,
goods_no,
trade_name,
description,
category_primary_id,
category_sub_id,
shelf_status,
goods_label,
label_show,
goods_details,
user_account_id,
sort
FROM mall_goods
WHERE id = #{id}
and is_deleted = 0
</select>
<select id="getMallGoodsResources" resultType="com.mmc.pms.entity.mall.MallGoodsResourcesDO">
SELECT id,
mall_goods_id,
url,
`type`
from mall_goods_resources
where mall_goods_id = #{id}
</select>
<select id="getMallGoodsSpec" resultType="com.mmc.pms.entity.mall.GoodsSpecDO">
select id,
mall_goods_id,
spec_name,
choose_type,
must,
sku_unit_id
from goods_spec
where mall_goods_id = #{id}
</select>
<select id="getMallGoodsSpecValues" resultType="com.mmc.pms.entity.mall.GoodsSpecValuesDO">
select id,
goods_spec_id,
spec_value_name,
part_no,
spec_value_image,
show_price,
stock,
sale_price,
channel_price
from goods_spec_values
<where>
<foreach collection="list" separator="," item="item" open="goods_spec_id in (" close=")">
#{item}
</foreach>
</where>
</select>
<select id="getSkuUnit" resultType="com.mmc.pms.entity.SkuUnitDO">
SELECT id,
unit_name unitName,
create_time createTime
FROM sku_unit
WHERE is_deleted = 0
</select>
<select id="countListMallGoods" resultType="java.lang.Integer">
SELECT
count(*)
FROM
mall_goods
<where>
is_deleted = 0
<if test="tradeName != null and tradeName !=''">
AND (trade_name LIKE CONCAT('%',#{tradeName},'%'))
</if>
<if test="categoryPrimaryId != null">
and category_primary_id = #{categoryPrimaryId}
</if>
<if test="userAccountId != null">
and user_account_id = #{userAccountId}
</if>
<if test="shelfStatus != null">
and shelf_status = #{shelfStatus}
</if>
</where>
</select>
<select id="listMallGoods" resultType="com.mmc.pms.entity.mall.MallGoodsDO">
SELECT
mg.id,
mg.trade_name,
mg.shelf_status,
mg.create_time,
mg.category_primary_id,
mg.category_sub_id,
mg.user_account_id,
mg.description,
img.id as imgId,
img.url,
img.type
FROM
mall_goods mg
INNER JOIN mall_goods_resources img ON mg.id = img.mall_goods_id
AND img.type = 0
<where>
mg.is_deleted = 0
<if test="tradeName != null and tradeName !=''">
AND (mg.trade_name LIKE CONCAT('%',#{tradeName},'%'))
</if>
<if test="categoryPrimaryId != null">
and mg.category_primary_id = #{categoryPrimaryId}
</if>
<if test="userAccountId != null">
and mg.user_account_id = #{userAccountId}
</if>
<if test="shelfStatus != null">
and mg.shelf_status = #{shelfStatus}
</if>
</where>
ORDER BY
mg.shelf_status DESC , mg.sort DESC,mg.create_time DESC
limit #{pageNo},#{pageSize}
</select>
</mapper>
...@@ -18,3 +18,8 @@ data-filter: ...@@ -18,3 +18,8 @@ data-filter:
- /pms/webDevice/getSecondDistrictInfo - /pms/webDevice/getSecondDistrictInfo
- /pms/webDevice/ad - /pms/webDevice/ad
- /pms/actuator/health/readiness - /pms/actuator/health/readiness
- /pms/app/goods/appMallGoodsDetails
- /pms/category/appCategoryInfo
- /pms/app/goods/queryBrandGoods
- /pms/app/goods/queryGoodsInfoByCategorySub
- /pms/mall/goods/feignRemoveGoodsByBackUserAccountId
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论