优化小程序,后台bug
parent
27d2203d2d
commit
fad3648345
|
|
@ -68,7 +68,8 @@ public class AlbumsServiceImpl implements IAlbumsService {
|
|||
|
||||
albumMapper.setSearch(queryWrapper, searchValidate, new String[]{
|
||||
"=:type:int",
|
||||
"like:keyword@name:str"
|
||||
"like:keyword@name:str",
|
||||
"like:name@name:str"
|
||||
});
|
||||
|
||||
IPage<Album> iPage = albumMapper.selectPage(new Page<>(page, limit), queryWrapper);
|
||||
|
|
|
|||
|
|
@ -152,6 +152,10 @@ public class ExperimentServiceImpl implements IExperimentService {
|
|||
model.setSort(createValidate.getSort());
|
||||
model.setIsShow(createValidate.getIsShow());
|
||||
model.setClassId(createValidate.getClassId());
|
||||
ClassInfo classInfo = classInfoMapper.selectById(createValidate.getClassId());
|
||||
if (classInfo!=null){
|
||||
model.setPid(classInfo.getPid());
|
||||
}
|
||||
model.setContent(createValidate.getContent());
|
||||
int insert = experimentMapper.insert(model);
|
||||
if (insert>0) {
|
||||
|
|
@ -195,6 +199,16 @@ public class ExperimentServiceImpl implements IExperimentService {
|
|||
model.setClassId(updateValidate.getClassId());
|
||||
model.setContent(updateValidate.getContent());
|
||||
experimentMapper.updateById(model);
|
||||
if (updateValidate.getGoodsIds() != null) {
|
||||
goodsExperimentMapper.delete(Wrappers.<GoodsExperiment>lambdaQuery().eq(GoodsExperiment::
|
||||
getExperimentId, model.getId()));
|
||||
for (Integer goodsId : updateValidate.getGoodsIds()) {
|
||||
GoodsExperiment goodsExperiment = new GoodsExperiment();
|
||||
goodsExperiment.setExperimentId(model.getId());
|
||||
goodsExperiment.setGoodsId(goodsId);
|
||||
goodsExperimentMapper.insert(goodsExperiment);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -20,5 +20,7 @@ public class AlbumSearchValidate implements Serializable {
|
|||
|
||||
@ApiModelProperty(value = "关键词")
|
||||
private String keyword;
|
||||
@ApiModelProperty(value = "文件名称")
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,4 +51,7 @@ public class Experiment implements Serializable {
|
|||
@ApiModelProperty(value = "实验内容")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "分类pid")
|
||||
private Integer pid;
|
||||
|
||||
}
|
||||
|
|
@ -21,7 +21,10 @@ public enum NoticeEnum {
|
|||
BIND_MOBILE_CODE(102, "绑定手机验证码"),
|
||||
CHANGE_MOBILE_CODE(103, "变更手机验证码"),
|
||||
FORGOT_PASSWORD_CODE(104, "找回登录密码验证码"),
|
||||
REGISTER_CODE(105, "登录验证码");
|
||||
REGISTER_CODE(105, "注册验证码"),
|
||||
|
||||
SALESMAN_CODE(106, "业务员通知"),
|
||||
SEND_USER_CODE(107, "用户下单通知");
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
|
|
|
|||
|
|
@ -1,13 +1,19 @@
|
|||
package com.wyh.common.plugin.notice.engine;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.wyh.common.entity.notice.NoticeRecord;
|
||||
import com.wyh.common.entity.notice.NoticeSetting;
|
||||
import com.wyh.common.enums.NoticeEnum;
|
||||
import com.wyh.common.exception.OperateException;
|
||||
import com.wyh.common.mapper.notice.NoticeRecordMapper;
|
||||
import com.wyh.common.mapper.notice.NoticeSettingMapper;
|
||||
import com.wyh.common.plugin.notice.vo.NoticeSmsVo;
|
||||
import com.wyh.common.plugin.notice.template.SmsTemplate;
|
||||
import com.wyh.common.plugin.sms.SmsDriver;
|
||||
import com.wyh.common.plugin.sms.engine.AliSms;
|
||||
import com.wyh.common.util.ConfigUtils;
|
||||
import com.wyh.common.util.MapUtils;
|
||||
import com.wyh.common.util.SpringUtils;
|
||||
import com.wyh.common.util.StringUtils;
|
||||
|
||||
|
|
@ -21,9 +27,9 @@ public class SmsNoticeHandle {
|
|||
/**
|
||||
* 发送短信通知
|
||||
*
|
||||
* @author wyh
|
||||
* @param noticeSmsVo 基础配置
|
||||
* @param smsTemplate 短信模板
|
||||
* @author wyh
|
||||
*/
|
||||
public void send(NoticeSmsVo noticeSmsVo, SmsTemplate smsTemplate) {
|
||||
// 基础参数
|
||||
|
|
@ -84,10 +90,10 @@ public class SmsNoticeHandle {
|
|||
/**
|
||||
* 获取短信内容
|
||||
*
|
||||
* @author wyh
|
||||
* @param params 短信参数
|
||||
* @param content 短信模板
|
||||
* @return String 短信内容
|
||||
* @author wyh
|
||||
*/
|
||||
private String getContent(Map<String, String> params, String content) {
|
||||
for (Map.Entry<String, String> entry : params.entrySet()) {
|
||||
|
|
@ -101,10 +107,10 @@ public class SmsNoticeHandle {
|
|||
/**
|
||||
* 腾讯云参数处理
|
||||
*
|
||||
* @author wyh
|
||||
* @param params 短信参数
|
||||
* @param content 短信内容
|
||||
* @return Map<String, String>
|
||||
* @author wyh
|
||||
*/
|
||||
private Map<String, String> getSmsParams(Map<String, String> params, String content) {
|
||||
String engine = ConfigUtils.get("sms", "default", "");
|
||||
|
|
@ -125,7 +131,7 @@ public class SmsNoticeHandle {
|
|||
List<Integer> arrIndex = new LinkedList<>();
|
||||
Map<Integer, String> arr2 = new LinkedHashMap<>();
|
||||
if (arr.size() > 0) {
|
||||
for (String v: arr) {
|
||||
for (String v : arr) {
|
||||
int k = content.indexOf(v);
|
||||
arrIndex.add(k);
|
||||
arr2.put(k, v);
|
||||
|
|
@ -150,4 +156,153 @@ public class SmsNoticeHandle {
|
|||
return arr4;
|
||||
}
|
||||
|
||||
/**
|
||||
* 发送短信通知(通知类型)
|
||||
*
|
||||
* @param mobile 发送人
|
||||
* @param name 名称
|
||||
* @param order 地址
|
||||
* @author wyh
|
||||
*/
|
||||
public void sendUserMessage(
|
||||
String mobile,
|
||||
String name,
|
||||
String order
|
||||
) {
|
||||
NoticeSmsVo params = new NoticeSmsVo()
|
||||
.setScene(NoticeEnum.SALESMAN_CODE.getCode())
|
||||
.setMobile(mobile)
|
||||
.setExpire(900)
|
||||
.setParams(new String[]{
|
||||
"order:" + order,
|
||||
"name:" + name
|
||||
});
|
||||
NoticeSettingMapper noticeSettingMapper = SpringUtils.getBean(NoticeSettingMapper.class);
|
||||
NoticeSetting noticeSetting = noticeSettingMapper.selectOne(
|
||||
new QueryWrapper<NoticeSetting>()
|
||||
.eq("scene", NoticeEnum.SEND_USER_CODE.getCode())
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
|
||||
if (StringUtils.isNull(noticeSetting)) {
|
||||
throw new OperateException("消息场景不存在!");
|
||||
}
|
||||
SmsTemplate smsTemplate = new SmsTemplate();
|
||||
smsTemplate.setName(noticeSetting.getName());
|
||||
smsTemplate.setType(noticeSetting.getType());
|
||||
smsTemplate.setParams(noticeSetting.getSmsNotice());
|
||||
if (StringUtils.isNotNull(smsTemplate.getStatus()) && smsTemplate.getStatus().equals(1)) {
|
||||
(new SmsNoticeHandle()).send(params, smsTemplate);
|
||||
|
||||
Map<String, String> sendParams = new LinkedHashMap<>();
|
||||
if (StringUtils.isNotNull(params.getParams())) {
|
||||
for (String s : params.getParams()) {
|
||||
String[] arr = s.split(":");
|
||||
String key = arr[0].trim();
|
||||
String val = arr[1].trim();
|
||||
sendParams.put(key, val);
|
||||
}
|
||||
}
|
||||
Map<String, String> sendConfig = new HashMap<>();
|
||||
sendConfig.put("secretKey", "cY7fbU0hvGvUl16ywGn4RUAoiu4zNO");
|
||||
sendConfig.put("name", "阿里云短信");
|
||||
sendConfig.put("sign", "上海中将科教设备");
|
||||
sendConfig.put("alias", "aliyun");
|
||||
sendConfig.put("appKey", "LTAI5tAxZbqdxWnf15651D4C");
|
||||
Integer sendResult = 0;
|
||||
String results = "";
|
||||
String templateParam = JSON.toJSONString(MapUtils.getSmsParams(sendParams, smsTemplate.getContent()));
|
||||
|
||||
AliSms aliSms = new AliSms(sendConfig);
|
||||
results = aliSms.setMobile(mobile)
|
||||
.setTemplateId("SMS_473495009")
|
||||
.setTemplateParams(templateParam)
|
||||
.send();
|
||||
|
||||
sendResult = aliSms.getSendResult();
|
||||
|
||||
if (sendResult == 2) {
|
||||
throw new OperateException(results);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 发送短信通知(通知类型)
|
||||
*
|
||||
* @param mobile 发送人
|
||||
* @param name 名称
|
||||
* @param address 地址
|
||||
* @param phone 联系人电话
|
||||
* @author wyh
|
||||
*/
|
||||
public void sendMessage(
|
||||
String mobile,
|
||||
String name,
|
||||
String address,
|
||||
String phone
|
||||
) {
|
||||
NoticeSmsVo params = new NoticeSmsVo()
|
||||
.setScene(NoticeEnum.SALESMAN_CODE.getCode())
|
||||
.setMobile(mobile)
|
||||
.setExpire(900)
|
||||
.setParams(new String[]{
|
||||
"address:" + address,
|
||||
"name:" + name,
|
||||
"phone:" + phone
|
||||
});
|
||||
NoticeSettingMapper noticeSettingMapper = SpringUtils.getBean(NoticeSettingMapper.class);
|
||||
NoticeSetting noticeSetting = noticeSettingMapper.selectOne(
|
||||
new QueryWrapper<NoticeSetting>()
|
||||
.eq("scene", NoticeEnum.SALESMAN_CODE.getCode())
|
||||
.eq("is_delete", 0)
|
||||
.last("limit 1"));
|
||||
|
||||
if (StringUtils.isNull(noticeSetting)) {
|
||||
throw new OperateException("消息场景不存在!");
|
||||
}
|
||||
SmsTemplate smsTemplate = new SmsTemplate();
|
||||
smsTemplate.setName(noticeSetting.getName());
|
||||
smsTemplate.setType(noticeSetting.getType());
|
||||
smsTemplate.setParams(noticeSetting.getSmsNotice());
|
||||
if (StringUtils.isNotNull(smsTemplate.getStatus()) && smsTemplate.getStatus().equals(1)) {
|
||||
(new SmsNoticeHandle()).send(params, smsTemplate);
|
||||
|
||||
Map<String, String> sendParams = new LinkedHashMap<>();
|
||||
if (StringUtils.isNotNull(params.getParams())) {
|
||||
for (String s : params.getParams()) {
|
||||
String[] arr = s.split(":");
|
||||
String key = arr[0].trim();
|
||||
String val = arr[1].trim();
|
||||
sendParams.put(key, val);
|
||||
}
|
||||
}
|
||||
Map<String, String> sendConfig = new HashMap<>();
|
||||
sendConfig.put("secretKey", "cY7fbU0hvGvUl16ywGn4RUAoiu4zNO");
|
||||
sendConfig.put("name", "阿里云短信");
|
||||
sendConfig.put("sign", "上海中将科教设备");
|
||||
sendConfig.put("alias", "aliyun");
|
||||
sendConfig.put("appKey", "LTAI5tAxZbqdxWnf15651D4C");
|
||||
Integer sendResult = 0;
|
||||
String results = "";
|
||||
String templateParam = JSON.toJSONString(MapUtils.getSmsParams(sendParams, smsTemplate.getContent()));
|
||||
|
||||
AliSms aliSms = new AliSms(sendConfig);
|
||||
results = aliSms.setMobile(mobile)
|
||||
.setTemplateId("SMS_472995029")
|
||||
.setTemplateParams(templateParam)
|
||||
.send();
|
||||
|
||||
sendResult = aliSms.getSendResult();
|
||||
|
||||
if (sendResult == 2) {
|
||||
throw new OperateException(results);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ import com.alibaba.fastjson2.JSONObject;
|
|||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Map工具类
|
||||
|
|
@ -79,4 +78,60 @@ public class MapUtils {
|
|||
return map2;
|
||||
}
|
||||
|
||||
|
||||
public static Map<String, String> getSmsParams(Map<String, String> params, String content) {
|
||||
String engine = ConfigUtils.get("sms", "default", "");
|
||||
if (!engine.equals("tencent")) {
|
||||
return params;
|
||||
}
|
||||
|
||||
// 获取内容变量
|
||||
List<String> arr = new LinkedList<>();
|
||||
for (Map.Entry<String, String> entry : params.entrySet()) {
|
||||
String search = "\\$\\{" + entry.getKey() + "}";
|
||||
if (content.indexOf(search) != 1 && !arr.contains(entry.getKey())) {
|
||||
arr.add(entry.getKey());
|
||||
}
|
||||
}
|
||||
|
||||
// 获取变量名称
|
||||
List<Integer> arrIndex = new LinkedList<>();
|
||||
Map<Integer, String> arr2 = new LinkedHashMap<>();
|
||||
if (arr.size() > 0) {
|
||||
for (String v: arr) {
|
||||
int k = content.indexOf(v);
|
||||
arrIndex.add(k);
|
||||
arr2.put(k, v);
|
||||
}
|
||||
}
|
||||
|
||||
// 从小到大排序
|
||||
List<String> arr3 = new LinkedList<>();
|
||||
Collections.sort(arrIndex);
|
||||
for (Integer i : arrIndex) {
|
||||
arr3.add(arr2.get(i));
|
||||
}
|
||||
|
||||
// 取变量对应值
|
||||
Map<String, String> arr4 = new LinkedHashMap<>();
|
||||
for (String v : arr3) {
|
||||
if (StringUtils.isNotNull(params.get(v))) {
|
||||
arr4.put(params.get(v), "");
|
||||
}
|
||||
}
|
||||
|
||||
return arr4;
|
||||
}
|
||||
|
||||
public static String getContent(Map<String, String> params, String content) {
|
||||
for (Map.Entry<String, String> entry : params.entrySet()) {
|
||||
String searchReplace = "\\$\\{" + entry.getKey() + "}";
|
||||
content = content.replaceAll(searchReplace, entry.getValue());
|
||||
}
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@ public class ExperimentSearchValidate implements Serializable {
|
|||
|
||||
@ApiModelProperty(value = "分类id")
|
||||
private Integer classId;
|
||||
@ApiModelProperty(value = "分类pId")
|
||||
private Integer pId;
|
||||
|
||||
@ApiModelProperty(value = "实验内容")
|
||||
private String content;
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import lombok.Data;
|
|||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 实验信息参数
|
||||
|
|
@ -50,4 +51,7 @@ public class ExperimentUpdateValidate implements Serializable {
|
|||
@ApiModelProperty(value = "实验内容")
|
||||
private String content;
|
||||
|
||||
@ApiModelProperty(value = "分类ids")
|
||||
private List<Integer> goodsIds ;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
package com.wyh.common.validator;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
@ApiModel("搜索参数")
|
||||
public class SearchVO {
|
||||
|
||||
@ApiModelProperty("实验id")
|
||||
private Integer id;
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
package com.wyh.common.validator;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
@Data
|
||||
@ApiModel("用户商品信息创建参数")
|
||||
public class UserGoodsNumUpdateValidate implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@NotNull(message = "goodsId参数缺失")
|
||||
@ApiModelProperty(value = "商品id")
|
||||
private Integer goodsId;
|
||||
|
||||
@NotNull(message = "num参数缺失")
|
||||
@ApiModelProperty(value = "商品数量")
|
||||
private Integer num;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.wyh.common.vo;
|
||||
|
||||
|
||||
import com.wyh.common.entity.user.UserAddress;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
|
@ -16,7 +17,7 @@ public class OrderDetailResponseVo {
|
|||
@ApiModelProperty(value = "订单编号")
|
||||
private String sn;
|
||||
@ApiModelProperty(value = "收货地址")
|
||||
private String address;
|
||||
private UserAddress address;
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private String createTime;
|
||||
@ApiModelProperty(value = "用户id")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
package com.wyh.common.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class OrderSnDto {
|
||||
|
||||
private String orderSn;
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +1,12 @@
|
|||
package com.wyh.common.vo.info;
|
||||
|
||||
import com.wyh.common.entity.Experiment;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@ApiModel("班级信息列表Vo")
|
||||
|
|
@ -30,5 +32,7 @@ public class ClassInfoListedVo implements Serializable {
|
|||
@ApiModelProperty(value = "排序编号")
|
||||
private Integer sort;
|
||||
|
||||
private List<Experiment> experimentList;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package com.wyh.front.controller;
|
|||
|
||||
import com.wyh.common.core.AjaxResult;
|
||||
import com.wyh.common.validator.UserGoodsCreateValidate;
|
||||
import com.wyh.common.validator.UserGoodsNumUpdateValidate;
|
||||
import com.wyh.common.vo.CartVo;
|
||||
import com.wyh.front.ZJFrontThreadLocal;
|
||||
import com.wyh.front.service.CartService;
|
||||
|
|
@ -54,4 +55,22 @@ public class CartController {
|
|||
}
|
||||
|
||||
|
||||
@GetMapping("updateCheckOne")
|
||||
@ApiOperation(value = "修改单个商品选中状态")
|
||||
|
||||
public AjaxResult<Object> updateCheckOne(@RequestParam(name = "goodsId" ) @ApiParam(value = "商品id") Integer goodsId) {
|
||||
Integer userId = ZJFrontThreadLocal.getUserId();
|
||||
CartVo cartVo = cartService.updateCheckOne(userId, goodsId);
|
||||
return AjaxResult.success(cartVo);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("updateNum")
|
||||
@ApiOperation(value = "修改购物车中商品数量")
|
||||
public AjaxResult<Object> updateNum(@RequestBody @Validated UserGoodsNumUpdateValidate updateValidate) {
|
||||
Integer userId = ZJFrontThreadLocal.getUserId();
|
||||
CartVo cartVo = cartService.updateNum(updateValidate , userId);
|
||||
return AjaxResult.success(cartVo);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.wyh.common.validator.ExperimentSearchValidate;
|
|||
import com.wyh.common.validator.annotation.IDMust;
|
||||
import com.wyh.common.vo.ExperimentDetailVo;
|
||||
import com.wyh.common.vo.ExperimentListedVo;
|
||||
import com.wyh.front.service.IClassInfoService;
|
||||
import com.wyh.front.service.IExperimentService;
|
||||
import com.wyh.front.validate.common.PageValidate;
|
||||
import io.swagger.annotations.Api;
|
||||
|
|
@ -29,6 +30,9 @@ public class ExperimentController {
|
|||
|
||||
|
||||
|
||||
@Resource
|
||||
IClassInfoService iClassInfoService;
|
||||
|
||||
@NotLogin
|
||||
@GetMapping("/list")
|
||||
@ApiOperation(value="实验信息列表")
|
||||
|
|
@ -46,4 +50,9 @@ public class ExperimentController {
|
|||
return AjaxResult.success(detail);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,59 @@
|
|||
package com.wyh.front.controller;
|
||||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.wyh.common.core.AjaxResult;
|
||||
import com.wyh.common.validator.SearchVO;
|
||||
import com.wyh.common.validator.info.ClassInfoSearchValidate;
|
||||
import com.wyh.front.service.IClassInfoService;
|
||||
import com.wyh.front.service.IExperimentService;
|
||||
import com.wyh.front.validate.common.PageValidate;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@RestController
|
||||
@RequestMapping("front/")
|
||||
@Api(tags = "(PC端)实验信息")
|
||||
public class ExperimentPcController {
|
||||
|
||||
|
||||
@Resource
|
||||
IExperimentService iExperimentService;
|
||||
|
||||
|
||||
@Resource
|
||||
IClassInfoService iClassInfoService;
|
||||
|
||||
|
||||
@GetMapping("experiment/pc/treeList")
|
||||
@ApiOperation(value="(pc)实验树状列表")
|
||||
public AjaxResult<JSONArray> list(@Validated PageValidate pageValidate,
|
||||
@Validated ClassInfoSearchValidate searchValidate) {
|
||||
JSONArray list = iClassInfoService.listTree(pageValidate, searchValidate);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
JSONObject obj = list.getJSONObject(i);
|
||||
System.out.println("obj = " + obj);
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
@GetMapping("experiment/pc/getGoods")
|
||||
@ApiOperation(value="(pc)点击获取实验商品")
|
||||
public AjaxResult<Object> getGoods(@Validated PageValidate pageValidate,
|
||||
@Validated SearchVO searchVO) {
|
||||
return iExperimentService.getGoods(pageValidate,searchVO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -9,8 +9,8 @@ import com.wyh.common.enums.NoticeEnum;
|
|||
import com.wyh.common.exception.OperateException;
|
||||
import com.wyh.common.mapper.notice.NoticeRecordMapper;
|
||||
import com.wyh.common.plugin.notice.NoticeDriver;
|
||||
import com.wyh.common.plugin.notice.engine.SmsNoticeHandle;
|
||||
import com.wyh.common.plugin.notice.vo.NoticeSmsVo;
|
||||
import com.wyh.common.util.HttpUtils;
|
||||
import com.wyh.common.util.StringUtils;
|
||||
import com.wyh.common.util.ToolUtils;
|
||||
import com.wyh.front.ZJFrontThreadLocal;
|
||||
|
|
@ -187,11 +187,14 @@ public class LoginController {
|
|||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
ZJFrontThreadLocal.getUserId();
|
||||
String s = HttpUtils.sendGet("https://github.com/modood/Administrative-divisions-of-China/blob/master/dist/pca-code.json");
|
||||
System.out.println(s);
|
||||
@NotLogin
|
||||
@GetMapping("/putsms")
|
||||
@ApiOperation(value="ceshi")
|
||||
public AjaxResult<Object> putsms() {
|
||||
|
||||
new SmsNoticeHandle().sendUserMessage("17647557909","张三","12345678901");
|
||||
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,13 @@ package com.wyh.front.controller;
|
|||
|
||||
|
||||
import com.wyh.common.core.AjaxResult;
|
||||
import com.wyh.common.core.PageResult;
|
||||
import com.wyh.common.entity.Order;
|
||||
import com.wyh.common.validator.OrderSearchValidate;
|
||||
import com.wyh.common.vo.OrderResponseVo;
|
||||
import com.wyh.front.service.OrderService;
|
||||
import com.wyh.front.validate.OrderCreateDto;
|
||||
import com.wyh.front.validate.common.PageValidate;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
|
@ -25,15 +29,16 @@ public class OrderController {
|
|||
@PostMapping("add")
|
||||
@ApiOperation("添加订单")
|
||||
public AjaxResult<Object> add(@Validated @RequestBody OrderCreateDto orderCreateDto){
|
||||
orderService.add(orderCreateDto);
|
||||
return AjaxResult.success();
|
||||
Order add = orderService.add(orderCreateDto);
|
||||
return AjaxResult.success(add);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("get")
|
||||
@ApiOperation("获取订单")
|
||||
public AjaxResult<Object> get(@Validated OrderSearchValidate validate){
|
||||
return AjaxResult.success(orderService.get(validate));
|
||||
public AjaxResult<PageResult<OrderResponseVo>> get(@Validated PageValidate pageValidate,
|
||||
@Validated OrderSearchValidate validate){
|
||||
return AjaxResult.success(orderService.get(pageValidate,validate));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import com.wyh.common.enums.PaymentEnum;
|
|||
import com.wyh.common.exception.OperateException;
|
||||
import com.wyh.common.mapper.RechargeOrderMapper;
|
||||
import com.wyh.common.plugin.wechat.WxPayDriver;
|
||||
import com.wyh.common.vo.OrderSnDto;
|
||||
import com.wyh.front.ZJFrontThreadLocal;
|
||||
import com.wyh.front.service.IPayService;
|
||||
import com.wyh.front.validate.PaymentValidate;
|
||||
|
|
@ -30,8 +31,7 @@ import javax.validation.constraints.NotNull;
|
|||
|
||||
@RestController
|
||||
@RequestMapping("/front/pay")
|
||||
//@Api(tags = "支付管理")
|
||||
@ApiIgnore
|
||||
@Api(tags = "支付管理")
|
||||
public class PayController {
|
||||
|
||||
@Resource
|
||||
|
|
@ -41,6 +41,7 @@ public class PayController {
|
|||
IPayService iPayService;
|
||||
|
||||
@GetMapping("/payWay")
|
||||
@ApiIgnore
|
||||
@ApiOperation("支付方式")
|
||||
public AjaxResult<PayWayListVo> payWay(@Validated @NotNull(message = "from参数丢失") @RequestParam String from,
|
||||
@Validated @NotNull(message = "orderId参数丢失") @RequestParam Integer orderId) {
|
||||
|
|
@ -51,6 +52,7 @@ public class PayController {
|
|||
}
|
||||
|
||||
@GetMapping("/payStatus")
|
||||
@ApiIgnore
|
||||
@ApiOperation(("支付状态"))
|
||||
public AjaxResult<PayStatusVo> payStatus(@Validated @NotNull(message = "from参数丢失") @RequestParam String from,
|
||||
@Validated @NotNull(message = "orderId参数丢失") @RequestParam Integer orderId) {
|
||||
|
|
@ -59,6 +61,7 @@ public class PayController {
|
|||
}
|
||||
|
||||
@PostMapping("/prepay")
|
||||
@ApiIgnore
|
||||
@ApiOperation("发起支付")
|
||||
public AjaxResult<Object> prepay(@Validated @RequestBody PaymentValidate requestObj) {
|
||||
// 接收参数
|
||||
|
|
@ -102,6 +105,7 @@ public class PayController {
|
|||
|
||||
@NotLogin
|
||||
@PostMapping("/notifyMnp")
|
||||
@ApiIgnore
|
||||
@ApiOperation("微信支付回调")
|
||||
public AjaxResult<Object> notifyMnp(@RequestBody String jsonData, HttpServletRequest request) throws WxPayException {
|
||||
// 构建签名
|
||||
|
|
@ -125,4 +129,16 @@ public class PayController {
|
|||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/deductPoints")
|
||||
@ApiOperation("扣除积分")
|
||||
public AjaxResult deductPoints(@RequestBody OrderSnDto orderSnDto){
|
||||
Integer userId = ZJFrontThreadLocal.getUserId();
|
||||
|
||||
iPayService.deductPoints(orderSnDto,userId);
|
||||
return AjaxResult.success();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.wyh.front.service;
|
||||
|
||||
import com.wyh.common.validator.UserGoodsCreateValidate;
|
||||
import com.wyh.common.validator.UserGoodsNumUpdateValidate;
|
||||
import com.wyh.common.vo.CartVo;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -15,4 +16,8 @@ public interface CartService {
|
|||
void remove(Integer[] ids);
|
||||
|
||||
void remove(List<Integer> ids);
|
||||
|
||||
CartVo updateCheckOne(Integer userId, Integer goodsId);
|
||||
|
||||
CartVo updateNum(UserGoodsNumUpdateValidate updateValidate , Integer userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,4 +56,5 @@ public interface IClassInfoService {
|
|||
*/
|
||||
void del(Integer id);
|
||||
|
||||
JSONArray listTree(PageValidate pageValidate, ClassInfoSearchValidate searchValidate);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
package com.wyh.front.service;
|
||||
|
||||
import com.wyh.common.core.AjaxResult;
|
||||
import com.wyh.common.core.PageResult;
|
||||
import com.wyh.common.validator.ExperimentCreateValidate;
|
||||
import com.wyh.common.validator.ExperimentSearchValidate;
|
||||
import com.wyh.common.validator.ExperimentUpdateValidate;
|
||||
import com.wyh.common.validator.SearchVO;
|
||||
import com.wyh.common.vo.ExperimentDetailVo;
|
||||
import com.wyh.common.vo.ExperimentListedVo;
|
||||
import com.wyh.front.validate.common.PageValidate;
|
||||
|
|
@ -57,4 +59,5 @@ public interface IExperimentService {
|
|||
*/
|
||||
void del(Integer id);
|
||||
|
||||
AjaxResult<Object> getGoods(PageValidate pageValidate, SearchVO searchVO);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.wyh.front.service;
|
||||
|
||||
import com.github.binarywang.wxpay.exception.WxPayException;
|
||||
import com.wyh.common.vo.OrderSnDto;
|
||||
import com.wyh.front.validate.PaymentValidate;
|
||||
import com.wyh.front.vo.pay.PayStatusVo;
|
||||
import com.wyh.front.vo.pay.PayWayListVo;
|
||||
|
|
@ -49,4 +50,5 @@ public interface IPayService {
|
|||
*/
|
||||
void handlePaidNotify(String attach, String outTradeNo, String transactionId) throws WxPayException;
|
||||
|
||||
void deductPoints(OrderSnDto orderSnDto, Integer userId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,17 @@
|
|||
package com.wyh.front.service;
|
||||
|
||||
import com.wyh.common.core.PageResult;
|
||||
import com.wyh.common.entity.Order;
|
||||
import com.wyh.common.validator.OrderSearchValidate;
|
||||
import com.wyh.common.vo.OrderDetailResponseVo;
|
||||
import com.wyh.common.vo.OrderResponseVo;
|
||||
import com.wyh.front.validate.OrderCreateDto;
|
||||
|
||||
import java.util.List;
|
||||
import com.wyh.front.validate.common.PageValidate;
|
||||
|
||||
public interface OrderService {
|
||||
void add(OrderCreateDto orderCreateDto);
|
||||
Order add(OrderCreateDto orderCreateDto);
|
||||
|
||||
List<OrderResponseVo> get(OrderSearchValidate validate);
|
||||
PageResult<OrderResponseVo> get(PageValidate pageValidate, OrderSearchValidate validate);
|
||||
|
||||
OrderDetailResponseVo getDetail(OrderSearchValidate validate);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.wyh.common.entity.goods.Goods;
|
|||
import com.wyh.common.mapper.UserGoodsMapper;
|
||||
import com.wyh.common.mapper.goods.GoodsMapper;
|
||||
import com.wyh.common.validator.UserGoodsCreateValidate;
|
||||
import com.wyh.common.validator.UserGoodsNumUpdateValidate;
|
||||
import com.wyh.common.vo.CartVo;
|
||||
import com.wyh.common.vo.GoodsUserVo;
|
||||
import com.wyh.front.ZJFrontThreadLocal;
|
||||
|
|
@ -33,11 +34,19 @@ public class CartServiceImpl implements CartService {
|
|||
@Override
|
||||
public void addCart( List<UserGoodsCreateValidate> cartCreateValited) {
|
||||
Integer userId = ZJFrontThreadLocal.getUserId();
|
||||
|
||||
for (UserGoodsCreateValidate userGoodsCreateValidate : cartCreateValited) {
|
||||
Integer goodsId = userGoodsCreateValidate.getGoodsId();
|
||||
Goods goods = goodsMapper.selectById(goodsId);
|
||||
|
||||
Integer num = userGoodsCreateValidate.getNum();
|
||||
Integer isCheck = userGoodsCreateValidate.getIsCheck();
|
||||
UserGoods selectOne = userGoodsMapper.selectOne(Wrappers.<UserGoods>lambdaQuery().eq(UserGoods::getUserId, userId).eq(UserGoods::getGoodsId, goodsId));
|
||||
if (selectOne != null) {
|
||||
selectOne.setNum(selectOne.getNum() + num);
|
||||
userGoodsMapper.updateById(selectOne);
|
||||
continue;
|
||||
}
|
||||
UserGoods userGoods = new UserGoods();
|
||||
userGoods.setUserId(userId);
|
||||
userGoods.setGoodsId(goodsId);
|
||||
|
|
@ -89,8 +98,7 @@ public class CartServiceImpl implements CartService {
|
|||
|
||||
//获取选中商品数量
|
||||
Integer checkNum = collect.stream()
|
||||
.filter(obj -> obj.getIsCheck() == 1)
|
||||
.map(UserGoods::getNum)
|
||||
.map(UserGoods::getIsCheck)
|
||||
.reduce(Integer::sum)
|
||||
.orElse(0);
|
||||
int totalNum = userGoodsList.stream()
|
||||
|
|
@ -128,6 +136,27 @@ public class CartServiceImpl implements CartService {
|
|||
userGoodsMapper.deleteBatchIds(ids);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CartVo updateCheckOne(Integer userId, Integer goodsId) {
|
||||
|
||||
UserGoods userGoods = userGoodsMapper.selectOne(Wrappers.<UserGoods>lambdaQuery().eq(UserGoods::getUserId, userId).eq(UserGoods::getGoodsId, goodsId));
|
||||
if (userGoods.getIsCheck().equals(1)) {
|
||||
userGoods.setIsCheck(0);
|
||||
} else {
|
||||
userGoods.setIsCheck(1);
|
||||
}
|
||||
userGoodsMapper.updateById(userGoods);
|
||||
return getCart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public CartVo updateNum(UserGoodsNumUpdateValidate updateValidate, Integer userId) {
|
||||
UserGoods userGoods = userGoodsMapper.selectOne(Wrappers.<UserGoods>lambdaQuery().eq(UserGoods::getUserId, userId).eq(UserGoods::getGoodsId, updateValidate.getGoodsId()));
|
||||
userGoods.setNum(updateValidate.getNum());
|
||||
userGoodsMapper.updateById(userGoods);
|
||||
return getCart();
|
||||
}
|
||||
|
||||
private void updateCheckDown(Integer userId) {
|
||||
userGoodsMapper.update(null, Wrappers.<UserGoods>lambdaUpdate()
|
||||
.set(UserGoods::getIsCheck, 0)
|
||||
|
|
|
|||
|
|
@ -2,8 +2,11 @@ package com.wyh.front.service.impl;
|
|||
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.github.yulichang.query.MPJQueryWrapper;
|
||||
import com.wyh.common.entity.Experiment;
|
||||
import com.wyh.common.entity.info.ClassInfo;
|
||||
import com.wyh.common.mapper.ExperimentMapper;
|
||||
import com.wyh.common.mapper.info.ClassInfoMapper;
|
||||
import com.wyh.common.util.ListUtils;
|
||||
import com.wyh.common.util.TimeUtils;
|
||||
|
|
@ -32,6 +35,9 @@ public class ClassInfoServiceImpl implements IClassInfoService {
|
|||
@Resource
|
||||
ClassInfoMapper classInfoMapper;
|
||||
|
||||
@Resource
|
||||
ExperimentMapper experimentMapper;
|
||||
|
||||
/**
|
||||
* 班级信息列表
|
||||
*
|
||||
|
|
@ -150,4 +156,32 @@ public class ClassInfoServiceImpl implements IClassInfoService {
|
|||
classInfoMapper.updateById(model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray listTree(PageValidate pageValidate, ClassInfoSearchValidate searchValidate) {
|
||||
MPJQueryWrapper<ClassInfo> mpjQueryWrapper = new MPJQueryWrapper<>();
|
||||
mpjQueryWrapper.selectAll(ClassInfo.class);
|
||||
mpjQueryWrapper.eq("is_delete", 0);
|
||||
mpjQueryWrapper.orderByDesc(Arrays.asList("sort", "id"));
|
||||
|
||||
classInfoMapper.setSearch(mpjQueryWrapper, searchValidate, new String[]{
|
||||
"like:name:str",
|
||||
"=:pid:str",
|
||||
"=:sort:str",
|
||||
});
|
||||
|
||||
List<ClassInfoListedVo> array = classInfoMapper.selectJoinList(
|
||||
ClassInfoListedVo.class,
|
||||
mpjQueryWrapper);
|
||||
|
||||
for (ClassInfoListedVo item : array) {
|
||||
item.setCreateTime(TimeUtils.timestampToDate(item.getCreateTime()));
|
||||
item.setUpdateTime(TimeUtils.timestampToDate(item.getUpdateTime()));
|
||||
List<Experiment> experiments = experimentMapper.selectList(Wrappers.<Experiment>lambdaQuery().eq(Experiment::getClassId, item.getId()).eq(Experiment::getIsDelete, 0).eq(Experiment::getPid, item.getPid()));
|
||||
item.setExperimentList(experiments);
|
||||
|
||||
}
|
||||
JSONArray jsonArray = JSONArray.parseArray(JSONArray.toJSONString(array));
|
||||
|
||||
return ListUtils.listToTree(jsonArray, "id", "pid", "children");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@ package com.wyh.front.service.impl;
|
|||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wyh.common.core.AjaxResult;
|
||||
import com.wyh.common.core.PageResult;
|
||||
import com.wyh.common.entity.Experiment;
|
||||
import com.wyh.common.entity.GoodsExperiment;
|
||||
|
|
@ -17,6 +19,7 @@ import com.wyh.common.util.TimeUtils;
|
|||
import com.wyh.common.validator.ExperimentCreateValidate;
|
||||
import com.wyh.common.validator.ExperimentSearchValidate;
|
||||
import com.wyh.common.validator.ExperimentUpdateValidate;
|
||||
import com.wyh.common.validator.SearchVO;
|
||||
import com.wyh.common.vo.ExperimentDetailVo;
|
||||
import com.wyh.common.vo.ExperimentListedVo;
|
||||
import com.wyh.common.vo.goods.GoodsListedVo;
|
||||
|
|
@ -76,6 +79,7 @@ public class ExperimentServiceImpl implements IExperimentService {
|
|||
"=:sort:int",
|
||||
"=:isShow@is_show:int",
|
||||
"=:classId@class_id:int",
|
||||
"=:PId@pid:int",
|
||||
"=:content:str",
|
||||
});
|
||||
|
||||
|
|
@ -151,6 +155,10 @@ public class ExperimentServiceImpl implements IExperimentService {
|
|||
model.setExperimentVideo(createValidate.getExperimentVideo());
|
||||
model.setSort(createValidate.getSort());
|
||||
model.setIsShow(createValidate.getIsShow());
|
||||
ClassInfo classInfo = classInfoMapper.selectById(createValidate.getClassId());
|
||||
if (classInfo!=null){
|
||||
model.setPid(classInfo.getPid());
|
||||
}
|
||||
model.setClassId(createValidate.getClassId());
|
||||
model.setContent(createValidate.getContent());
|
||||
experimentMapper.insert(model);
|
||||
|
|
@ -205,4 +213,28 @@ public class ExperimentServiceImpl implements IExperimentService {
|
|||
experimentMapper.updateById(model);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult<Object> getGoods(PageValidate pageValidate, SearchVO searchVO) {
|
||||
Integer page = pageValidate.getPageNo();
|
||||
Integer limit = pageValidate.getPageSize();
|
||||
QueryWrapper<GoodsExperiment> queryWrapper = new QueryWrapper<>();
|
||||
if (searchVO.getId() != null) {
|
||||
queryWrapper.like("id", searchVO.getId());
|
||||
}
|
||||
List<GoodsExperiment> goodsExperiments = goodsExperimentMapper.selectList(queryWrapper);
|
||||
if (CollectionUtils.isNotEmpty(goodsExperiments)) {
|
||||
List<Integer> collect = goodsExperiments.stream().map(GoodsExperiment::getGoodsId).collect(Collectors.toList());
|
||||
QueryWrapper<Goods> queryWrapper1 = new QueryWrapper<>();
|
||||
queryWrapper1.in("id", collect);
|
||||
Page<Goods> page1 = new Page<>(page, limit);
|
||||
IPage<Goods> iPage = goodsMapper.selectPage(page1, queryWrapper1);
|
||||
return AjaxResult.success(iPage);
|
||||
}
|
||||
// goodsMapper.selectPage(new Page<>(page, limit), queryWrapper);
|
||||
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,23 @@
|
|||
package com.wyh.front.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.wyh.common.core.PageResult;
|
||||
import com.wyh.common.entity.GoodsOrder;
|
||||
import com.wyh.common.entity.Order;
|
||||
import com.wyh.common.entity.Salesman;
|
||||
import com.wyh.common.entity.goods.Goods;
|
||||
import com.wyh.common.entity.user.User;
|
||||
import com.wyh.common.entity.user.UserAddress;
|
||||
import com.wyh.common.mapper.GoodsOrderMapper;
|
||||
import com.wyh.common.mapper.OrderMapper;
|
||||
import com.wyh.common.mapper.SalesmanMapper;
|
||||
import com.wyh.common.mapper.goods.GoodsMapper;
|
||||
import com.wyh.common.mapper.user.UserAddressMapper;
|
||||
import com.wyh.common.mapper.user.UserMapper;
|
||||
import com.wyh.common.plugin.notice.engine.SmsNoticeHandle;
|
||||
import com.wyh.common.util.TimeUtils;
|
||||
import com.wyh.common.util.ToolUtils;
|
||||
import com.wyh.common.validator.OrderSearchValidate;
|
||||
|
|
@ -22,6 +28,7 @@ import com.wyh.front.ZJFrontThreadLocal;
|
|||
import com.wyh.front.service.OrderService;
|
||||
import com.wyh.front.validate.OrderCreateDto;
|
||||
import com.wyh.front.validate.OrderGoodsDto;
|
||||
import com.wyh.front.validate.common.PageValidate;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
|
@ -52,8 +59,13 @@ public class OrderServiceImpl implements OrderService {
|
|||
@Resource
|
||||
private GoodsOrderMapper goodsOrderMapper;
|
||||
|
||||
|
||||
@Resource
|
||||
private SalesmanMapper salesmanMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public void add(OrderCreateDto orderCreateDto) {
|
||||
public Order add(OrderCreateDto orderCreateDto) {
|
||||
Integer userId = ZJFrontThreadLocal.getUserId();
|
||||
Integer source = orderCreateDto.getSource();
|
||||
String sn = "order" + ToolUtils.randomString(16);
|
||||
|
|
@ -84,7 +96,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
}
|
||||
User user = userMapper.selectById(userId);
|
||||
Assert.isTrue(user != null, "用户不存在");
|
||||
Assert.isTrue(user.getMoney().compareTo(totalPrice) >= 0, "余额不足");
|
||||
// Assert.isTrue(user.getMoney().compareTo(totalPrice) >= 0, "余额不足");
|
||||
Order order = new Order();
|
||||
order.setSn(sn);
|
||||
order.setUserId(userId);
|
||||
|
|
@ -95,22 +107,65 @@ public class OrderServiceImpl implements OrderService {
|
|||
order.setTotalPrice(totalPrice);
|
||||
order.setAdId(orderCreateDto.getAdId());
|
||||
|
||||
orderMapper.insert(order);
|
||||
int insert = orderMapper.insert(order);
|
||||
if (insert <= 0) {
|
||||
throw new RuntimeException("创建订单失败");
|
||||
}
|
||||
new SmsNoticeHandle().sendUserMessage(user.getMobile(),user.getNickname(),sn);
|
||||
|
||||
Assert.isTrue(insert > 0, "创建订单失败");
|
||||
String mobile = "";
|
||||
String name = "";
|
||||
String address = "";
|
||||
List<Salesman> salesmen = salesmanMapper.selectList(null);
|
||||
UserAddress userAddress = addressMapper.selectById(orderCreateDto.getAdId());
|
||||
for (Salesman salesman : salesmen) {
|
||||
if(salesman.getAddress().contains(userAddress.getCity()) || salesman.getAddress().contains(userAddress.getProvince())) {
|
||||
mobile = salesman.getMobile();
|
||||
name = salesman.getName();
|
||||
address = userAddress.getArea() + userAddress.getAddress();
|
||||
}
|
||||
}
|
||||
|
||||
// 发送短信给业务员
|
||||
new SmsNoticeHandle().sendMessage(mobile, name , address , user.getMobile());
|
||||
|
||||
|
||||
// NoticeRecord noticeRecord = noticeRecordMapper.selectOne(new QueryWrapper<NoticeRecord>()
|
||||
// .eq("account", smsValidate.getMobile())
|
||||
// .eq("scene", smsValidate.getScene())
|
||||
// .eq("status", Arrays.asList(NoticeEnum.STATUS_WAIT, NoticeEnum.STATUS_OK))
|
||||
// .orderByDesc("id")
|
||||
// .last("limit 1"));
|
||||
//
|
||||
// if (StringUtils.isNotNull(noticeRecord)) {
|
||||
// if (noticeRecord.getCreateTime() >= (System.currentTimeMillis() / 1000 - 60)){
|
||||
// throw new OperateException("操作频繁,请稍后再试!");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
return order;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OrderResponseVo> get(OrderSearchValidate validate) {
|
||||
public PageResult<OrderResponseVo> get(PageValidate pageValidate, OrderSearchValidate validate) {
|
||||
Integer pageNo = pageValidate.getPageNo();
|
||||
Integer pageSize = pageValidate.getPageSize();
|
||||
|
||||
LambdaQueryWrapper<Order> orderLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
if (validate.getStatus() != null && validate.getStatus() != 0) {
|
||||
orderLambdaQueryWrapper.eq(Order::getStatus, validate.getStatus());
|
||||
}
|
||||
Integer userId = ZJFrontThreadLocal.getUserId();
|
||||
orderLambdaQueryWrapper.eq(Order::getUserId, userId);
|
||||
List<Order> orders = orderMapper.selectList(orderLambdaQueryWrapper);
|
||||
orderLambdaQueryWrapper.orderByDesc(Order::getCreateTime);
|
||||
IPage<Order> iPage = orderMapper.selectPage( new Page<>(pageNo, pageSize), orderLambdaQueryWrapper);
|
||||
|
||||
List<Order> orders = iPage.getRecords();
|
||||
List<OrderResponseVo> orderResponseVos = new ArrayList<>();
|
||||
if (CollectionUtils.isEmpty(orders)) {
|
||||
return orderResponseVos;
|
||||
return new PageResult<>();
|
||||
}
|
||||
List<String> orderSns = orders.stream().map(Order::getSn).collect(Collectors.toList());
|
||||
List<GoodsOrder> goodsOrders = goodsOrderMapper.selectList(Wrappers.<GoodsOrder>lambdaQuery().in(GoodsOrder::getOrderSn, orderSns));
|
||||
|
|
@ -134,7 +189,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
}
|
||||
orderResponseVos.add(orderResponseVo) ;
|
||||
}
|
||||
return orderResponseVos;
|
||||
return PageResult.iPageHandle(iPage.getTotal(), iPage.getCurrent(), iPage.getSize(), orderResponseVos);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -154,7 +209,7 @@ public class OrderServiceImpl implements OrderService {
|
|||
orderDetailResponseVo.setStatus(order.getStatus());
|
||||
orderDetailResponseVo.setUserId(order.getUserId());
|
||||
orderDetailResponseVo.setCreateTime(TimeUtils.timestampToDate(order.getCreateTime()));
|
||||
orderDetailResponseVo.setAddress(userAddresses.getAddress());
|
||||
orderDetailResponseVo.setAddress(userAddresses);
|
||||
orderDetailResponseVo.setMobile(user.getMobile());
|
||||
orderDetailResponseVo.setNickName(user.getNickname());
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
package com.wyh.front.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.wyh.common.entity.GoodsOrder;
|
||||
import com.wyh.common.entity.Order;
|
||||
import com.wyh.common.entity.RechargeOrder;
|
||||
import com.wyh.common.entity.UserGoods;
|
||||
import com.wyh.common.entity.setting.DevPayConfig;
|
||||
import com.wyh.common.entity.setting.DevPayWay;
|
||||
import com.wyh.common.entity.user.User;
|
||||
|
|
@ -11,34 +15,49 @@ import com.wyh.common.enums.LogMoneyEnum;
|
|||
import com.wyh.common.enums.PaymentEnum;
|
||||
import com.wyh.common.exception.OperateException;
|
||||
import com.wyh.common.exception.PaymentException;
|
||||
import com.wyh.common.mapper.log.LogMoneyMapper;
|
||||
import com.wyh.common.mapper.GoodsOrderMapper;
|
||||
import com.wyh.common.mapper.OrderMapper;
|
||||
import com.wyh.common.mapper.RechargeOrderMapper;
|
||||
import com.wyh.common.mapper.UserGoodsMapper;
|
||||
import com.wyh.common.mapper.log.LogMoneyMapper;
|
||||
import com.wyh.common.mapper.setting.DevPayConfigMapper;
|
||||
import com.wyh.common.mapper.setting.DevPayWayMapper;
|
||||
import com.wyh.common.mapper.user.UserAuthMapper;
|
||||
import com.wyh.common.mapper.user.UserMapper;
|
||||
import com.wyh.common.plugin.wechat.WxPayDriver;
|
||||
import com.wyh.common.plugin.wechat.request.PaymentRequestV3;
|
||||
import com.wyh.common.util.StringUtils;
|
||||
import com.wyh.common.util.TimeUtils;
|
||||
import com.wyh.common.util.UrlUtils;
|
||||
import com.wyh.common.vo.OrderSnDto;
|
||||
import com.wyh.front.service.IPayService;
|
||||
import com.wyh.front.validate.PaymentValidate;
|
||||
import com.wyh.front.vo.pay.PayStatusVo;
|
||||
import com.wyh.front.vo.pay.PayWayInfoVo;
|
||||
import com.wyh.front.vo.pay.PayWayListVo;
|
||||
import com.wyh.common.util.StringUtils;
|
||||
import com.wyh.common.util.TimeUtils;
|
||||
import com.wyh.common.util.UrlUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class PayServiceImpl implements IPayService {
|
||||
|
||||
|
||||
@Resource
|
||||
OrderMapper orderMapper;
|
||||
|
||||
@Resource
|
||||
GoodsOrderMapper goodsOrderMapper;
|
||||
|
||||
@Resource
|
||||
UserGoodsMapper userGoodsMapper;
|
||||
|
||||
@Resource
|
||||
UserMapper userMapper;
|
||||
|
||||
|
|
@ -206,6 +225,31 @@ public class PayServiceImpl implements IPayService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deductPoints(OrderSnDto orderSnDto, Integer userId) {
|
||||
Order order = orderMapper.selectOne(new QueryWrapper<Order>().eq("sn", orderSnDto.getOrderSn()).eq("user_id", userId));
|
||||
Assert.notNull(order, "订单不存在");
|
||||
User user = userMapper.selectById(userId);
|
||||
Assert.notNull(user, "用户不存在");
|
||||
|
||||
BigDecimal money = user.getMoney();
|
||||
Assert.isTrue(money.compareTo(order.getTotalPrice()) >= 0, "余额不足");
|
||||
|
||||
|
||||
user.setMoney(money.subtract(order.getTotalPrice()));
|
||||
|
||||
userMapper.updateById(user);
|
||||
|
||||
List<GoodsOrder> goodsOrders = goodsOrderMapper.selectList(Wrappers.<GoodsOrder>lambdaQuery().eq(GoodsOrder::getOrderSn, order.getSn()));
|
||||
for (GoodsOrder goodsOrder : goodsOrders) {
|
||||
userGoodsMapper.delete(Wrappers.<UserGoods>lambdaQuery().eq(UserGoods::getUserId, userId).eq(UserGoods::getGoodsId, goodsOrder.getGoodsId()));
|
||||
}
|
||||
|
||||
|
||||
//Todo:修改订单支付状态
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 余额充值回调
|
||||
*
|
||||
|
|
@ -250,4 +294,11 @@ public class PayServiceImpl implements IPayService {
|
|||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
BigDecimal totalScope = new BigDecimal("1000");
|
||||
Assert.isTrue(totalScope.compareTo(new BigDecimal("1001")) >= 0, "余额不足");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ public class SignServiceImpl implements SignService {
|
|||
}
|
||||
result.sort((a, b) -> a.getDate().compareTo(b.getDate()));
|
||||
signLogVo.setSignDateList(result);
|
||||
int asInt = signLogs.stream().mapToInt(SignLog::getContinueNums).max().getAsInt();
|
||||
int asInt = signLogs.stream().mapToInt(SignLog::getContinueNums).max() .orElse(0);
|
||||
signLogVo.setContinuousDays(asInt);
|
||||
return signLogVo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,14 +7,11 @@ declare module '@vue/runtime-core' {
|
|||
export interface GlobalComponents {
|
||||
AppLink: typeof import('./src/components/app-link/index.vue')['default']
|
||||
ColorPicker: typeof import('./src/components/color-picker/index.vue')['default']
|
||||
CustomLink: typeof import('./src/components/link/custom-link.vue')['default']
|
||||
DaterangePicker: typeof import('./src/components/daterange-picker/index.vue')['default']
|
||||
DelWrap: typeof import('./src/components/del-wrap/index.vue')['default']
|
||||
DictValue: typeof import('./src/components/dict-value/index.vue')['default']
|
||||
Editor: typeof import('./src/components/editor/index.vue')['default']
|
||||
ElAlert: typeof import('element-plus/es')['ElAlert']
|
||||
ElAmap: typeof import('element-plus/es')['ElAmap']
|
||||
ElAmapMarker: typeof import('element-plus/es')['ElAmapMarker']
|
||||
ElAutocomplete: typeof import('element-plus/es')['ElAutocomplete']
|
||||
ElAvatar: typeof import('element-plus/es')['ElAvatar']
|
||||
ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb']
|
||||
|
|
@ -52,7 +49,6 @@ declare module '@vue/runtime-core' {
|
|||
ElRow: typeof import('element-plus/es')['ElRow']
|
||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||
ElStatistic: typeof import('element-plus/es')['ElStatistic']
|
||||
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
|
||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||
ElTable: typeof import('element-plus/es')['ElTable']
|
||||
|
|
@ -64,7 +60,6 @@ declare module '@vue/runtime-core' {
|
|||
ElTree: typeof import('element-plus/es')['ElTree']
|
||||
ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
|
||||
ElUpload: typeof import('element-plus/es')['ElUpload']
|
||||
File: typeof import('./src/components/material/file.vue')['default']
|
||||
FooterBtns: typeof import('./src/components/footer-btns/index.vue')['default']
|
||||
Icon: typeof import('./src/components/icon/index.vue')['default']
|
||||
IconPicker: typeof import('./src/components/icon/picker.vue')['default']
|
||||
|
|
@ -75,7 +70,6 @@ declare module '@vue/runtime-core' {
|
|||
LinkPicker: typeof import('./src/components/link/picker.vue')['default']
|
||||
LinkShopPages: typeof import('./src/components/link/shop-pages.vue')['default']
|
||||
Loading: typeof import('element-plus/es')['ElLoadingDirective']
|
||||
MapContainer: typeof import('./src/components/map/MapContainer.vue')['default']
|
||||
MapMapContainer: typeof import('./src/components/map/MapContainer.vue')['default']
|
||||
Material: typeof import('./src/components/material/index.vue')['default']
|
||||
MaterialFile: typeof import('./src/components/material/file.vue')['default']
|
||||
|
|
@ -83,14 +77,10 @@ declare module '@vue/runtime-core' {
|
|||
MaterialPreview: typeof import('./src/components/material/preview.vue')['default']
|
||||
OverflowTooltip: typeof import('./src/components/overflow-tooltip/index.vue')['default']
|
||||
Pagination: typeof import('./src/components/pagination/index.vue')['default']
|
||||
Picker: typeof import('./src/components/icon/picker.vue')['default']
|
||||
PopoverInput: typeof import('./src/components/popover-input/index.vue')['default']
|
||||
Popup: typeof import('./src/components/popup/index.vue')['default']
|
||||
Preview: typeof import('./src/components/material/preview.vue')['default']
|
||||
RouterLink: typeof import('vue-router')['RouterLink']
|
||||
RouterView: typeof import('vue-router')['RouterView']
|
||||
ShopPages: typeof import('./src/components/link/shop-pages.vue')['default']
|
||||
SvgIcon: typeof import('./src/components/icon/svg-icon.vue')['default']
|
||||
Upload: typeof import('./src/components/upload/index.vue')['default']
|
||||
VideoPlayer: typeof import('./src/components/video-player/index.vue')['default']
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="banner图" prop="img">
|
||||
<material-picker size="100px" v-model="formData.img" type="video" />
|
||||
<material-picker size="100px" v-model="formData.img" />
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="menuSort">
|
||||
<div>
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="banner图" prop="img" min-width="100">
|
||||
<template #default="{ row }">
|
||||
<file-item :uri="row.img" file-size="80px" type="video"></file-item>
|
||||
<file-item :uri="row.img" file-size="80px" type="image"></file-item>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" min-width="100" />
|
||||
|
|
|
|||
|
|
@ -11,17 +11,17 @@
|
|||
>
|
||||
<el-form ref="formRef" :model="formData" label-width="110px" :rules="formRules">
|
||||
<el-form-item label="实验标题" prop="title">
|
||||
<el-input v-model="formData.title" placeholder="请输入实验标题" />
|
||||
<el-input v-model="formData.title" placeholder="请输入实验标题"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="实验主图" prop="experimentImg">
|
||||
<material-picker size="300px" v-model="formData.experimentImg" />
|
||||
<material-picker size="300px" v-model="formData.experimentImg"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="实验视频" prop="experimentVideo">
|
||||
<material-picker size="300px" v-model="formData.experimentVideo" type="video" />
|
||||
<material-picker size="300px" v-model="formData.experimentVideo" type="video"/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="sort">
|
||||
<div>
|
||||
<el-input-number v-model="formData.sort" :max="9999" />
|
||||
<el-input-number v-model="formData.sort" :max="9999"/>
|
||||
<div class="form-tips">数值越大越排前</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
|
@ -29,24 +29,27 @@
|
|||
<el-select
|
||||
v-model="formData.goodsIds"
|
||||
multiple
|
||||
collapse-tags
|
||||
placeholder="Select"
|
||||
style="width: 240px"
|
||||
> <el-option
|
||||
v-for="item in goodsOption"
|
||||
:key="item.id"
|
||||
:label="item.goodsName"
|
||||
:value="item.id"
|
||||
remote
|
||||
:remote-method="getGoodsOption"
|
||||
filterable
|
||||
placeholder="请选择产品"
|
||||
style="width: 400px"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in goodsFilterOption"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否展示" prop="isShow">
|
||||
<el-radio-group v-model="formData.isShow" >
|
||||
<el-radio-group v-model="formData.isShow">
|
||||
<el-radio :label="1">是</el-radio>
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="分类id" prop="classId">
|
||||
<el-form-item label="分类" prop="classId">
|
||||
<el-tree-select
|
||||
class="flex-1"
|
||||
v-model="formData.classId"
|
||||
|
|
@ -62,35 +65,47 @@
|
|||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="实验内容" prop="content">
|
||||
<editor v-model="formData.content" :height="500" />
|
||||
<editor v-model="formData.content" :height="500"/>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</popup>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import type { FormInstance } from 'element-plus'
|
||||
import { experimentEdit, experimentAdd, experimentDetail } from '@/api/experiment'
|
||||
import type {FormInstance} from 'element-plus'
|
||||
import {experimentEdit, experimentAdd, experimentDetail} from '@/api/experiment'
|
||||
import Popup from '@/components/popup/index.vue'
|
||||
import feedback from '@/utils/feedback'
|
||||
import type { PropType } from 'vue'
|
||||
import type {PropType} from 'vue'
|
||||
import {useDictOptions} from "@/hooks/useDictOptions";
|
||||
import {cateLists} from "@/api/cate";
|
||||
import {infoLists} from "@/api/info"
|
||||
import { goodsAll} from "@/api/goods"
|
||||
import {goodsAll} from "@/api/goods"
|
||||
import {listAll} from "@/api/newscate";
|
||||
|
||||
defineProps({
|
||||
dictData: {
|
||||
type: Object as PropType<Record<string, any[]>>,
|
||||
default: () => ({})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
||||
interface ListItem {
|
||||
value: string
|
||||
label: string
|
||||
}
|
||||
|
||||
const loading = ref(false)
|
||||
const emit = defineEmits(['success', 'close'])
|
||||
const formRef = shallowRef<FormInstance>()
|
||||
const popupRef = shallowRef<InstanceType<typeof Popup>>()
|
||||
const mode = ref('add')
|
||||
const goodsOption = ref<any[]>([])
|
||||
const { optionsData } = useDictOptions<{
|
||||
const list = ref<ListItem[]>([])
|
||||
const goodsFilterOption = ref<ListItem[]>([])
|
||||
const {optionsData} = useDictOptions<{
|
||||
class: any[]
|
||||
}>({
|
||||
class: {
|
||||
|
|
@ -113,6 +128,7 @@ const formData = reactive({
|
|||
goodsIds: []
|
||||
})
|
||||
|
||||
|
||||
const formRules = {
|
||||
id: [
|
||||
{
|
||||
|
|
@ -172,9 +188,31 @@ const formRules = {
|
|||
],
|
||||
}
|
||||
|
||||
|
||||
const getGoodsOption = async (query:string) => {
|
||||
if (query) {
|
||||
loading.value = true;
|
||||
try {
|
||||
|
||||
console.log("远程搜索参数---------》:", query);
|
||||
console.log("数据搜索前集合------------->:", list.value);
|
||||
|
||||
goodsFilterOption.value = list.value.filter((item) => item.label && item.label.includes(query));
|
||||
|
||||
console.log("数据搜索后集合---------》:", goodsFilterOption.value);
|
||||
} catch (error) {
|
||||
console.error("Error performing remote search:", error);
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
} else {
|
||||
goodsFilterOption.value = [];
|
||||
}
|
||||
};
|
||||
|
||||
const handleSubmit = async () => {
|
||||
await formRef.value?.validate()
|
||||
const data: any = { ...formData }
|
||||
const data: any = {...formData}
|
||||
mode.value == 'edit' ? await experimentEdit(data) : await experimentAdd(data)
|
||||
popupRef.value?.close()
|
||||
feedback.msgSuccess('操作成功')
|
||||
|
|
@ -193,6 +231,7 @@ const setFormData = async (data: Record<string, any>) => {
|
|||
formData[key] = data[key]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
const getDetail = async (row: Record<string, any>) => {
|
||||
|
|
@ -210,6 +249,13 @@ const handleClose = () => {
|
|||
const getGoodsAllList = async () => {
|
||||
const res: any = await goodsAll()
|
||||
goodsOption.value = res || []
|
||||
for (let i = 0; i <goodsOption.value.length; i++) {
|
||||
list.value.push({
|
||||
value: goodsOption.value[i].id,
|
||||
label: goodsOption.value[i].goodsName
|
||||
})
|
||||
goodsFilterOption.value = list.value
|
||||
}
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
|
|
|
|||
|
|
@ -241,7 +241,7 @@ const inputs = ref([]);
|
|||
|
||||
function addInput() {
|
||||
inputs.value.push({ name: '' });
|
||||
|
||||
formData.goodsExpand = inputs.value;
|
||||
}
|
||||
|
||||
function removeInput(index) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue