init commit

This commit is contained in:
quantulr
2024-05-09 17:33:31 +08:00
parent 8becba4807
commit b60722603e
212 changed files with 917 additions and 3257 deletions

View File

@ -14,6 +14,7 @@ public class PhoneUtils {
/**
* 大陆号码或香港号码都可以
*
* @param str
* @return 符合规则返回true
* @throws PatternSyntaxException
@ -23,7 +24,6 @@ public class PhoneUtils {
}
/**
*
* 大陆手机号码11位数匹配格式前三位固定格式+后8位任意数
* 此方法中前三位格式有:
* 13+任意数
@ -33,6 +33,7 @@ public class PhoneUtils {
* 17+3,5,6,7,8
* 18+任意数
* 198,199
*
* @param str
* @return 正确返回true
* @throws PatternSyntaxException
@ -41,8 +42,7 @@ public class PhoneUtils {
// ^ 匹配输入字符串开始的位置
// \d 匹配一个或多个数字,其中 \ 要转义,所以是 \\d
// $ 匹配输入字符串结尾的位置
String regExp = "^((13[0-9])|(14[5,7,9])|(15[0-3,5-9])|(166)|(17[3,5,6,7,8])" +
"|(18[0-9])|(19[8,9]))\\d{8}$";
String regExp = "^[1][3,4,5,6,7,8,9][0-9]{9}$";
Pattern p = Pattern.compile(regExp);
Matcher m = p.matcher(str);
return m.matches();
@ -50,6 +50,7 @@ public class PhoneUtils {
/**
* 香港手机号码8位数5|6|8|9开头+7位任意数
*
* @param str
* @return 正确返回true
* @throws PatternSyntaxException

View File

@ -1,17 +1,15 @@
package com.wisdo.mmining.api;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wisdo.mmining.api.dto.AmountDto;
import com.wisdo.mmining.api.dto.EditOrderAddressDto;
import com.wisdo.mmining.api.dto.GoodsDto;
import com.wisdo.mmining.entity.*;
import com.wisdo.mmining.result.Result;
import com.wisdo.mmining.result.ResultUtil;
import com.wisdo.mmining.service.*;
import com.wisdo.mmining.utils.Tools;
import com.wisdo.mmining.utils.WxPayUtil;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
@ -20,7 +18,6 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
/**
@ -70,12 +67,12 @@ public class OrderApi {
@ApiOperation(value = "订单金额计算")
@PostMapping("amountCalculation")
public Result amountCalculation(@RequestBody AmountDto amountDto) {
BigDecimal priceSum=new BigDecimal(0);
WisdWxuser wisdWxuser=wxuserService.getById(amountDto.getUserId());
Map<String,Object> map=new HashMap<>();
for (GoodsDto goodsDto:amountDto.getGoods()){
WisdGoodsSpec wisdGoodsSpec=goodsSpecService.getInfoById(goodsDto.getSpecId());
if (wisdWxuser.getUserIscompany()==1) {
BigDecimal priceSum = new BigDecimal(0);
WisdWxuser wisdWxuser = wxuserService.getById(amountDto.getUserId());
Map<String, Object> map = new HashMap<>();
for (GoodsDto goodsDto : amountDto.getGoods()) {
WisdGoodsSpec wisdGoodsSpec = goodsSpecService.getInfoById(goodsDto.getSpecId());
if (wisdWxuser.getUserIscompany() == 1) {
// WisdUser wisdUser=wisdUserService.getByUserId(wisdWxuser.getCompanyUserId());
// QueryWrapper<WisdBulk> queryWrapper3 = new QueryWrapper<>();
// queryWrapper3.eq("goods_id", goodsDto.getGoodsId());
@ -86,44 +83,44 @@ public class OrderApi {
// BigDecimal numPrice=wisdBulk.getGoodsBulkPrice().multiply(new BigDecimal(goodsDto.getNum()));
// priceSum=priceSum.add(numPrice);
// }else {
BigDecimal numPrice=wisdGoodsSpec.getSpecPrice().multiply(new BigDecimal(goodsDto.getNum()));
priceSum=priceSum.add(numPrice);
BigDecimal numPrice = wisdGoodsSpec.getSpecPrice().multiply(new BigDecimal(goodsDto.getNum()));
priceSum = priceSum.add(numPrice);
//}
}
}
if (amountDto.getVolumeType()==1){
if (wisdWxuser.getUserVolumeBalance().compareTo(priceSum)==1){
map.put("volumeBalance",priceSum);
map.put("priceSum",priceSum);
return new Result(ResultUtil.SUCCESS,ResultUtil.SUCCESS_MSG,map);
}else {
map.put("volumeBalance",wisdWxuser.getUserVolumeBalance());
map.put("priceSum",wisdWxuser.getUserVolumeBalance());
return new Result(ResultUtil.SUCCESS,ResultUtil.SUCCESS_MSG,map);
if (amountDto.getVolumeType() == 1) {
if (wisdWxuser.getUserVolumeBalance().compareTo(priceSum) == 1) {
map.put("volumeBalance", priceSum);
map.put("priceSum", priceSum);
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG, map);
} else {
map.put("volumeBalance", wisdWxuser.getUserVolumeBalance());
map.put("priceSum", wisdWxuser.getUserVolumeBalance());
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG, map);
}
}else {
BigDecimal userDiscount=new BigDecimal(new Double(wisdWxuser.getUserDiscount())/100);
BigDecimal discount=userDiscount.setScale(2,BigDecimal.ROUND_HALF_DOWN);
if (wisdWxuser.getUserDiscountBalance().compareTo(priceSum)==1){
BigDecimal newprice=priceSum.multiply(discount).setScale(2,BigDecimal.ROUND_HALF_DOWN);
map.put("volumeBalance",priceSum);
map.put("priceSum",newprice);
return new Result(ResultUtil.SUCCESS,ResultUtil.SUCCESS_MSG,map);
}else {
BigDecimal newprice=priceSum.multiply(discount).setScale(2,BigDecimal.ROUND_HALF_DOWN);
if (wisdWxuser.getUserDiscountBalance().compareTo(newprice)==1){
map.put("volumeBalance",priceSum);
map.put("priceSum",newprice);
return new Result(ResultUtil.SUCCESS,ResultUtil.SUCCESS_MSG,map);
}else if (wisdWxuser.getUserDiscountBalance().compareTo(newprice)==-1){
BigDecimal discountPrice= wisdWxuser.getUserDiscountBalance().divide(discount,2,BigDecimal.ROUND_DOWN);
map.put("volumeBalance",discountPrice);
map.put("priceSum",wisdWxuser.getUserDiscountBalance());
return new Result(ResultUtil.SUCCESS,ResultUtil.SUCCESS_MSG,map);
}else {
map.put("volumeBalance",priceSum);
map.put("priceSum",newprice);
return new Result(ResultUtil.SUCCESS,ResultUtil.SUCCESS_MSG,map);
} else {
BigDecimal userDiscount = new BigDecimal(new Double(wisdWxuser.getUserDiscount()) / 100);
BigDecimal discount = userDiscount.setScale(2, BigDecimal.ROUND_HALF_DOWN);
if (wisdWxuser.getUserDiscountBalance().compareTo(priceSum) == 1) {
BigDecimal newprice = priceSum.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_DOWN);
map.put("volumeBalance", priceSum);
map.put("priceSum", newprice);
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG, map);
} else {
BigDecimal newprice = priceSum.multiply(discount).setScale(2, BigDecimal.ROUND_HALF_DOWN);
if (wisdWxuser.getUserDiscountBalance().compareTo(newprice) == 1) {
map.put("volumeBalance", priceSum);
map.put("priceSum", newprice);
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG, map);
} else if (wisdWxuser.getUserDiscountBalance().compareTo(newprice) == -1) {
BigDecimal discountPrice = wisdWxuser.getUserDiscountBalance().divide(discount, 2, BigDecimal.ROUND_DOWN);
map.put("volumeBalance", discountPrice);
map.put("priceSum", wisdWxuser.getUserDiscountBalance());
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG, map);
} else {
map.put("volumeBalance", priceSum);
map.put("priceSum", newprice);
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG, map);
}
}
}
@ -131,19 +128,19 @@ public class OrderApi {
@ApiOperation(value = "运费获取")
@GetMapping("getFreight")
public Result getFreight(String freightAddress,BigDecimal price){
public Result getFreight(String freightAddress, BigDecimal price) {
QueryWrapper<WisdFreight> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("freight_state",1);
WisdFreight wisdFreight=freightService.getOne(queryWrapper);
if (wisdFreight.getFreightPrice().compareTo(price)==-1 || wisdFreight.getFreightPrice().compareTo(price)==0){
return new Result(ResultUtil.SUCCESS,"该订单不用支付运费",0);
}else {
queryWrapper.eq("freight_state", 1);
WisdFreight wisdFreight = freightService.getOne(queryWrapper);
if (wisdFreight.getFreightPrice().compareTo(price) == -1 || wisdFreight.getFreightPrice().compareTo(price) == 0) {
return new Result(ResultUtil.SUCCESS, "该订单不用支付运费", 0);
} else {
QueryWrapper<WisdFreight> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("freight_address",freightAddress);
WisdFreight wisdFreight1=freightService.getOne(queryWrapper1);
if (wisdFreight1==null) {
queryWrapper1.eq("freight_address", freightAddress);
WisdFreight wisdFreight1 = freightService.getOne(queryWrapper1);
if (wisdFreight1 == null) {
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG, 0);
}else {
} else {
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG, wisdFreight1.getFreightPrice());
}
}
@ -152,17 +149,17 @@ public class OrderApi {
@ApiOperation(value = "订单个人信息获取")
@GetMapping("getUserInfo")
public Result getUserInfo(Long userId){
WisdWxuser wisdWxuser=wxuserService.getById(userId);
public Result getUserInfo(Long userId) {
WisdWxuser wisdWxuser = wxuserService.getById(userId);
QueryWrapper<WisdVip> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("vip_name",wisdWxuser.getUserVip());
WisdVip wisdVip=vipService.getOne(queryWrapper);
queryWrapper.eq("vip_name", wisdWxuser.getUserVip());
WisdVip wisdVip = vipService.getOne(queryWrapper);
wisdWxuser.setUserVipDiscount(wisdVip.getVipBalance());
QueryWrapper<WisdUserAddress> queryWrapper1 = new QueryWrapper<>();
queryWrapper1.eq("wxuser_id",userId);
queryWrapper1.eq("address_default",1);
WisdUserAddress wisdUserAddress=userAddressService.getOne(queryWrapper1);
if (wisdUserAddress!=null){
queryWrapper1.eq("wxuser_id", userId);
queryWrapper1.eq("address_default", 1);
WisdUserAddress wisdUserAddress = userAddressService.getOne(queryWrapper1);
if (wisdUserAddress != null) {
wisdWxuser.setWisdUserAddress(wisdUserAddress);
}
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG, wisdWxuser);
@ -170,38 +167,37 @@ public class OrderApi {
@ApiOperation(value = "提交订单")
@PostMapping("addOrder")
public Result addOrder(@RequestBody WisdOeder wisdOeder, HttpServletRequest request){
return orderService.addOrder(wisdOeder,request);
public Result addOrder(@RequestBody WisdOeder wisdOeder, HttpServletRequest request) {
return orderService.addOrder(wisdOeder, request);
}
@ApiOperation(value = "删除订单")
@PostMapping("delOrder")
public Result delOrder(Long orderId){
public Result delOrder(Long orderId) {
// WisdOeder wisdOeder=orderService.getById(orderId);
// wisdOeder.setIsDeleted(1);
Boolean flag=orderService.removeById(orderId);
if (flag){
Boolean flag = orderService.removeById(orderId);
if (flag) {
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG);
}else{
} else {
return new Result(ResultUtil.ERROR, ResultUtil.ERROR_MSG);
}
}
@ApiOperation(value = "申请退换货")
@PostMapping("afterSales")
public Result afterSales(Long orderId,String orderRefund,String orderRefundImg,Integer status){
WisdOeder wisdOeder=orderService.getById(orderId);
Long orderNumber=(new Date()).getTime();
wisdOeder.setOrderRefundNum("T"+orderNumber);
if (wisdOeder.getOrderPayWay()==3){
WisdPackage wisdPackage=packageService.getWisdPackageById(wisdOeder.getPackageId());
if (wisdPackage.getPackageEndTime().getTime()<System.currentTimeMillis()){
public Result afterSales(Long orderId, String orderRefund, String orderRefundImg, Integer status) {
WisdOeder wisdOeder = orderService.getById(orderId);
Long orderNumber = (new Date()).getTime();
wisdOeder.setOrderRefundNum("T" + orderNumber);
if (wisdOeder.getOrderPayWay() == 3) {
WisdPackage wisdPackage = packageService.getWisdPackageById(wisdOeder.getPackageId());
if (wisdPackage.getPackageEndTime().getTime() < System.currentTimeMillis()) {
return new Result(ResultUtil.ERROR, "套餐券已过期,无法申请退换货");
}
}
if (wisdOeder.getStatus()==2){
if (wisdOeder.getStatus() == 2) {
wisdOeder.setStatus(62);
wisdOeder.setOrderRefundType(3);
// if (wisdOeder.getOrderPayWay()==2){
@ -274,7 +270,7 @@ public class OrderApi {
// } else {
// return new Result(ResultUtil.ERROR, ResultUtil.ERROR_MSG);
// }
}else {
} else {
wisdOeder.setStatus(status);
if (status == 61) {
wisdOeder.setOrderRefundType(1);
@ -285,66 +281,110 @@ public class OrderApi {
wisdOeder.setOrderRefund(orderRefund);
wisdOeder.setOrderRefundImg(orderRefundImg);
wisdOeder.setOrderRefundTime(new Date());
Boolean flag=orderService.updateById(wisdOeder);
if (flag){
Boolean flag = orderService.updateById(wisdOeder);
if (flag) {
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG);
}else{
} else {
return new Result(ResultUtil.ERROR, ResultUtil.ERROR_MSG);
}
}
@ApiOperation(value = "退换货订单信息提交")
@PostMapping("submitSales")
public Result submitSales(Long orderId,String orderRefundNumber,String orderRefundImage,String orderRefundInstructions,String orderRefundName){
WisdOeder wisdOeder=orderService.getById(orderId);
public Result submitSales(Long orderId, String orderRefundNumber, String orderRefundImage, String orderRefundInstructions, String orderRefundName) {
WisdOeder wisdOeder = orderService.getById(orderId);
wisdOeder.setStatus(64);
wisdOeder.setOrderRefundImage(orderRefundImage);
wisdOeder.setOrderRefundInstructions(orderRefundInstructions);
wisdOeder.setOrderRefundNumber(orderRefundNumber);
wisdOeder.setOrderRefundName(orderRefundName);
Boolean flag=orderService.updateById(wisdOeder);
if (flag){
Boolean flag = orderService.updateById(wisdOeder);
if (flag) {
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG);
}else{
} else {
return new Result(ResultUtil.ERROR, ResultUtil.ERROR_MSG);
}
}
@ApiOperation(value = "确认收货")
@PostMapping("confirmOrder")
public Result confirmOrder(Long orderId){
WisdOeder wisdOeder=orderService.getById(orderId);
Integer flag=orderService.completeOrder(wisdOeder.getOrderNumber());
if (flag==1){
public Result confirmOrder(Long orderId) {
WisdOeder wisdOeder = orderService.getById(orderId);
Integer flag = orderService.completeOrder(wisdOeder.getOrderNumber());
if (flag == 1) {
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG);
}else{
} else {
return new Result(ResultUtil.ERROR, ResultUtil.ERROR_MSG);
}
}
//申请修改发货地址
@RequestMapping(value = "requestUpdateAddress")
@ResponseBody
public Result requestUpdateAddress(Long orderId, Long addressId) {
WisdOeder order = orderService.getById(orderId);
WisdUserAddress address = userAddressService.getById(addressId);
if (order.getStatus().equals(1) || order.getStatus().equals(2)) {
order.setAddressId(addressId);
order.setOrderAddress(address.getAddressProvince() + address.getAddressCity() + address.getAddressArea() + address.getAddressDetailed());
return ResultUtil.success("地址修改成功");
}
order.setPendingApprovalAddressId(addressId);
order.setPendingApprovalOrderAddress(address.getAddressProvince() + address.getAddressCity() + address.getAddressArea() + address.getAddressDetailed());
orderService.updateById(order);
return ResultUtil.success("已申请修改地址");
}
@PostMapping(value = "editAddress")
@ResponseBody
public Result editAddress(@RequestBody EditOrderAddressDto address) {
return ResultUtil.success("地址修改成功");
}
// 处理修改地址申请
@RequestMapping(value = "approvalUpdateAddress")
@ResponseBody
public Result approvalUpdateAddress(Long orderId, Integer type, String logisticsNo /*1 同意, 0 拒绝*/) {
WisdOeder order = orderService.getById(orderId);
if (type.equals(1)) {
order.setOrderAddress(order.getPendingApprovalOrderAddress());
order.setAddressId(order.getPendingApprovalAddressId());
order.setLogisticsNum(logisticsNo);
order.setPendingApprovalAddressId(null);
order.setPendingApprovalOrderAddress(null);
orderService.updateById(order);
return ResultUtil.success("收货地址已更新");
} else if (type.equals(0)) {
order.setPendingApprovalAddressId(null);
order.setPendingApprovalOrderAddress(null);
return ResultUtil.success("已拒绝修改地址");
} else {
return ResultUtil.error("参数错误");
}
}
@ApiOperation(value = "订单列表")
@ApiImplicitParams({
@ApiImplicitParam(name="userId",value="用户id", paramType = "userId"),
@ApiImplicitParam(name="status",value="1待支付 2代发货/待核销 3待收货 4已完成/已核销 5已取消 6退换货 ", paramType = "status")})
@ApiImplicitParams({@ApiImplicitParam(name = "userId", value = "用户id", paramType = "userId"), @ApiImplicitParam(name = "status", value = "1待支付 2代发货/待核销 3待收货 4已完成/已核销 5已取消 6退换货 ", paramType = "status")})
@GetMapping("getOrderList")
public Result getOrderList(Long userId,Integer status,int page, int num){
public Result getOrderList(Long userId, Integer status, int page, int num) {
QueryWrapper<WisdOeder> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("user_id",userId);
queryWrapper.eq("is_deleted",0);
if (status!=0) {
if (status==6){
queryWrapper.eq("user_id", userId);
queryWrapper.eq("is_deleted", 0);
if (status != 0) {
if (status == 6) {
queryWrapper.and(wrapper -> wrapper.eq("status", status).or().eq("status", 61).or().eq("status", 62).or().eq("status", 63).or().eq("status", 64).or().eq("status", 65).or().eq("status", 66));
queryWrapper.orderByDesc("create_time");
}else {
} else {
queryWrapper.eq("status", status);
queryWrapper.orderByDesc("create_time");
}
}else {
} else {
queryWrapper.orderByDesc("create_time");
}
IPage<WisdOeder> wisdOederList=orderService.listPage(page,num,queryWrapper);
// WisdIntegrlRoles wisdIntegrlRoles=integralRolesService.getById(1);
for (WisdOeder wisdOeder:wisdOederList.getRecords()){
IPage<WisdOeder> wisdOederList = orderService.listPage(page, num, queryWrapper);
// WisdIntegrlRoles wisdIntegrlRoles=integralRolesService.getById(1);
for (WisdOeder wisdOeder : wisdOederList.getRecords()) {
// if (wisdOeder.getStatus()==63){
// Calendar calendar2 = Calendar.getInstance();
// SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@ -353,26 +393,26 @@ public class OrderApi {
// wisdOeder.setOrderRefundTimes(three_days_after);
// }
QueryWrapper<WisdOrderDetail> queryWrapper2 = new QueryWrapper<>();
queryWrapper2.eq("order_id",wisdOeder.getId());
List<WisdOrderDetail> wisdOrderDetailList=orderDetailService.list(queryWrapper2);
List<WisdGoods> wisdGoodsList=new ArrayList<>();
for (WisdOrderDetail wisdOrderDetail:wisdOrderDetailList){
WisdGoods wisdGoods=goodsService.getInfoById(wisdOrderDetail.getGoodsId());
WisdGoodsSpec wisdGoodsSpec=goodsSpecService.getInfoById(wisdOrderDetail.getSpecId());
WisdWxuser wisdWxuser=wxuserService.getById(userId);
if (wisdWxuser.getUserIscompany()==1&&wisdOeder.getOrderPayWay()!=3&&wisdOeder.getOrderPayWay()!=4&&wisdOeder.getOrderPayWay()!=5) {
WisdUser wisdUser=wisdUserService.getByUserId(wisdWxuser.getUserId());
queryWrapper2.eq("order_id", wisdOeder.getId());
List<WisdOrderDetail> wisdOrderDetailList = orderDetailService.list(queryWrapper2);
List<WisdGoods> wisdGoodsList = new ArrayList<>();
for (WisdOrderDetail wisdOrderDetail : wisdOrderDetailList) {
WisdGoods wisdGoods = goodsService.getInfoById(wisdOrderDetail.getGoodsId());
WisdGoodsSpec wisdGoodsSpec = goodsSpecService.getInfoById(wisdOrderDetail.getSpecId());
WisdWxuser wisdWxuser = wxuserService.getById(userId);
if (wisdWxuser.getUserIscompany() == 1 && wisdOeder.getOrderPayWay() != 3 && wisdOeder.getOrderPayWay() != 4 && wisdOeder.getOrderPayWay() != 5) {
WisdUser wisdUser = wisdUserService.getByUserId(wisdWxuser.getUserId());
QueryWrapper<WisdBulk> queryWrapper3 = new QueryWrapper<>();
queryWrapper3.eq("goods_id", wisdGoods.getId());
queryWrapper3.eq("company_id", wisdUser.getCompanyId());
queryWrapper3.eq("spec_id", wisdGoodsSpec.getId());
queryWrapper3.eq("is_enable", 1);
WisdBulk wisdBulk=blukService.getOne(queryWrapper3);
if (wisdBulk!=null) {
WisdBulk wisdBulk = blukService.getOne(queryWrapper3);
if (wisdBulk != null) {
wisdGoodsSpec.setSpecBulyPrice(wisdBulk.getGoodsBulkPrice());
}
}
if (wisdOeder.getOrderPayWay()!=3) {
if (wisdOeder.getOrderPayWay() != 3) {
wisdGoodsSpec.setSpecPrice(wisdOrderDetail.getSpecPrice());
}
wisdGoods.setWisdGoodsSpec(wisdGoodsSpec);
@ -381,40 +421,40 @@ public class OrderApi {
}
wisdOeder.setGoodsList(wisdGoodsList);
}
return new Result(ResultUtil.SUCCESS,ResultUtil.SUCCESS_MSG,wisdOederList);
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG, wisdOederList);
}
@ApiOperation(value = "获取订单详情")
@GetMapping("getOrderDetail")
public Result getOrderDetail(String orderNumber,Long userId){
WisdOeder wisdOeder=orderService.getOrderByNumber(orderNumber);
WisdUserAddress wisdUserAddress=userAddressService.getById(wisdOeder.getAddressId());
public Result getOrderDetail(String orderNumber, Long userId) {
WisdOeder wisdOeder = orderService.getOrderByNumber(orderNumber);
WisdUserAddress wisdUserAddress = userAddressService.getById(wisdOeder.getAddressId());
wisdOeder.setWisdUserAddress(wisdUserAddress);
QueryWrapper<WisdOrderDetail> queryWrapper2 = new QueryWrapper<>();
queryWrapper2.eq("order_id",wisdOeder.getId());
List<WisdOrderDetail> wisdOrderDetailList=orderDetailService.list(queryWrapper2);
List<WisdGoods> wisdGoodsList=new ArrayList<>();
for (WisdOrderDetail wisdOrderDetail:wisdOrderDetailList){
WisdGoods wisdGoods=goodsService.getInfoById(wisdOrderDetail.getGoodsId());
WisdGoodsSpec wisdGoodsSpec=goodsSpecService.getInfoById(wisdOrderDetail.getSpecId());
WisdWxuser wisdWxuser=wxuserService.getById(userId);
if (wisdWxuser.getUserIscompany()==1&&wisdOeder.getOrderPayWay()!=3&&wisdOeder.getOrderPayWay()!=4&&wisdOeder.getOrderPayWay()!=5) {
WisdUser wisdUser=wisdUserService.getByUserId(wisdWxuser.getUserId());
queryWrapper2.eq("order_id", wisdOeder.getId());
List<WisdOrderDetail> wisdOrderDetailList = orderDetailService.list(queryWrapper2);
List<WisdGoods> wisdGoodsList = new ArrayList<>();
for (WisdOrderDetail wisdOrderDetail : wisdOrderDetailList) {
WisdGoods wisdGoods = goodsService.getInfoById(wisdOrderDetail.getGoodsId());
WisdGoodsSpec wisdGoodsSpec = goodsSpecService.getInfoById(wisdOrderDetail.getSpecId());
WisdWxuser wisdWxuser = wxuserService.getById(userId);
if (wisdWxuser.getUserIscompany() == 1 && wisdOeder.getOrderPayWay() != 3 && wisdOeder.getOrderPayWay() != 4 && wisdOeder.getOrderPayWay() != 5) {
WisdUser wisdUser = wisdUserService.getByUserId(wisdWxuser.getUserId());
QueryWrapper<WisdBulk> queryWrapper3 = new QueryWrapper<>();
queryWrapper3.eq("goods_id", wisdGoods.getId());
queryWrapper3.eq("company_id", wisdUser.getCompanyId());
queryWrapper3.eq("spec_id", wisdGoodsSpec.getId());
queryWrapper3.eq("is_enable", 1);
WisdBulk wisdBulk=blukService.getOne(queryWrapper3);
if (wisdBulk!=null) {
WisdBulk wisdBulk = blukService.getOne(queryWrapper3);
if (wisdBulk != null) {
wisdGoodsSpec.setSpecBulyPrice(wisdBulk.getGoodsBulkPrice());
}
}
if (wisdOeder.getOrderPayWay()!=3) {
if (wisdOeder.getOrderPayWay() != 3) {
wisdGoodsSpec.setSpecPrice(wisdOrderDetail.getSpecPrice());
}
if (wisdOeder.getOrderPayWay()==3) {
WisdPackage wisdPackage=packageService.getWisdPackageById(wisdOeder.getPackageId());
if (wisdOeder.getOrderPayWay() == 3) {
WisdPackage wisdPackage = packageService.getWisdPackageById(wisdOeder.getPackageId());
wisdGoods.setPackageName(wisdPackage.getPackageName());
}
wisdGoods.setWisdGoodsSpec(wisdGoodsSpec);
@ -422,43 +462,43 @@ public class OrderApi {
wisdGoodsList.add(wisdGoods);
}
wisdOeder.setGoodsList(wisdGoodsList);
return new Result(ResultUtil.SUCCESS,ResultUtil.SUCCESS_MSG,wisdOeder);
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG, wisdOeder);
}
@ApiOperation(value = "获取自提订单详情")
@GetMapping("getStoresOrderDetail")
public Result getStoresOrderDetail(String orderNumber,Long userId,Long storesUserId){
WisdOeder wisdOeder=orderService.getOrderByNumber(orderNumber);
if (wisdOeder==null){
return new Result(ResultUtil.ERROR,"该订单不存在");
public Result getStoresOrderDetail(String orderNumber, Long userId, Long storesUserId) {
WisdOeder wisdOeder = orderService.getOrderByNumber(orderNumber);
if (wisdOeder == null) {
return new Result(ResultUtil.ERROR, "该订单不存在");
}
WisdWxuser wisdWxuser1=wxuserService.getById(storesUserId);
if (!wisdOeder.getAddressId().equals(wisdWxuser1.getUserStoresId())){
return new Result(ResultUtil.ERROR,"此订单不是您店铺的");
WisdWxuser wisdWxuser1 = wxuserService.getById(storesUserId);
if (!wisdOeder.getAddressId().equals(wisdWxuser1.getUserStoresId())) {
return new Result(ResultUtil.ERROR, "此订单不是您店铺的");
}
if (wisdOeder.getStatus()!=2){
return new Result(ResultUtil.ERROR,"该订单已核销或者已退款");
if (wisdOeder.getStatus() != 2) {
return new Result(ResultUtil.ERROR, "该订单已核销或者已退款");
}
WisdUserAddress wisdUserAddress=userAddressService.getById(wisdOeder.getAddressId());
WisdUserAddress wisdUserAddress = userAddressService.getById(wisdOeder.getAddressId());
wisdOeder.setWisdUserAddress(wisdUserAddress);
QueryWrapper<WisdOrderDetail> queryWrapper2 = new QueryWrapper<>();
queryWrapper2.eq("order_id",wisdOeder.getId());
List<WisdOrderDetail> wisdOrderDetailList=orderDetailService.list(queryWrapper2);
List<WisdGoods> wisdGoodsList=new ArrayList<>();
for (WisdOrderDetail wisdOrderDetail:wisdOrderDetailList){
WisdGoods wisdGoods=goodsService.getInfoById(wisdOrderDetail.getGoodsId());
WisdGoodsSpec wisdGoodsSpec=goodsSpecService.getInfoById(wisdOrderDetail.getSpecId());
WisdWxuser wisdWxuser=wxuserService.getById(userId);
if (wisdWxuser.getUserIscompany()==1&&wisdOeder.getOrderPayWay()!=3&&wisdOeder.getOrderPayWay()!=4&&wisdOeder.getOrderPayWay()!=5) {
WisdUser wisdUser=wisdUserService.getByUserId(wisdWxuser.getUserId());
queryWrapper2.eq("order_id", wisdOeder.getId());
List<WisdOrderDetail> wisdOrderDetailList = orderDetailService.list(queryWrapper2);
List<WisdGoods> wisdGoodsList = new ArrayList<>();
for (WisdOrderDetail wisdOrderDetail : wisdOrderDetailList) {
WisdGoods wisdGoods = goodsService.getInfoById(wisdOrderDetail.getGoodsId());
WisdGoodsSpec wisdGoodsSpec = goodsSpecService.getInfoById(wisdOrderDetail.getSpecId());
WisdWxuser wisdWxuser = wxuserService.getById(userId);
if (wisdWxuser.getUserIscompany() == 1 && wisdOeder.getOrderPayWay() != 3 && wisdOeder.getOrderPayWay() != 4 && wisdOeder.getOrderPayWay() != 5) {
WisdUser wisdUser = wisdUserService.getByUserId(wisdWxuser.getUserId());
QueryWrapper<WisdBulk> queryWrapper3 = new QueryWrapper<>();
queryWrapper3.eq("goods_id", wisdGoods.getId());
queryWrapper3.eq("company_id", wisdUser.getCompanyId());
queryWrapper3.eq("spec_id", wisdGoodsSpec.getId());
queryWrapper3.eq("is_enable", 1);
WisdBulk wisdBulk=blukService.getOne(queryWrapper3);
if (wisdBulk!=null) {
WisdBulk wisdBulk = blukService.getOne(queryWrapper3);
if (wisdBulk != null) {
wisdGoodsSpec.setSpecBulyPrice(wisdBulk.getGoodsBulkPrice());
}
}
@ -468,13 +508,13 @@ public class OrderApi {
wisdGoodsList.add(wisdGoods);
}
wisdOeder.setGoodsList(wisdGoodsList);
return new Result(ResultUtil.SUCCESS,ResultUtil.SUCCESS_MSG,wisdOeder);
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG, wisdOeder);
}
@ApiOperation(value = "物流查询")
@GetMapping("getLogistics")
public Result getLogistics(String logisticsNumber){
return new Result(ResultUtil.SUCCESS,ResultUtil.SUCCESS_MSG,Tools.findLogistics(logisticsNumber));
public Result getLogistics(String logisticsNumber) {
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG, Tools.findLogistics(logisticsNumber));
}

View File

@ -209,7 +209,7 @@ public class UserApi {
@GetMapping(value = "sendSms")
@ApiOperation(value = "发送短信")
public Result sendSms(String phone) throws InterruptedException {
String regex = "^((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(166)|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}$";
String regex = "^[1][3,4,5,6,7,8,9][0-9]{9}$";
Pattern p = Pattern.compile(regex);
Matcher m = p.matcher(phone);

View File

@ -0,0 +1,11 @@
package com.wisdo.mmining.api.dto;
import lombok.Data;
@Data
public class EditOrderAddressDto {
private int orderId;
private String orderAddress;
private String logisticsName;
private String logisticsNum;
}

View File

@ -11,14 +11,10 @@ import com.wisdo.mmining.redis.RedisService;
import com.wisdo.mmining.result.Result;
import com.wisdo.mmining.result.ResultUtil;
import com.wisdo.mmining.service.*;
import com.wisdo.mmining.utils.LogisticsUtil;
import com.wisdo.mmining.utils.Tools;
import com.wisdo.mmining.utils.WxPayUtil;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.*;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
@ -51,6 +47,8 @@ public class OrderController {
@Autowired
private OrderService orderService;
@Autowired
private UserAddressService userAddressService;
@Autowired
private OrderDetailService orderDetailService;
@Autowired
private GoodsService goodsService;
@ -77,34 +75,34 @@ public class OrderController {
@GetMapping(value = "")
public String page(Model model) {
List<WisdStores> storesList=storesService.list();
model.addAttribute("storesList",storesList);
List<WisdCompany> companyList=companyService.list();
model.addAttribute("companyList",companyList);
List<WisdStores> storesList = storesService.list();
model.addAttribute("storesList", storesList);
List<WisdCompany> companyList = companyService.list();
model.addAttribute("companyList", companyList);
return "pages/order/order_list";
}
@GetMapping(value = "/refund")
public String refund(Model model) {
List<WisdStores> storesList=storesService.list();
model.addAttribute("storesList",storesList);
List<WisdCompany> companyList=companyService.list();
model.addAttribute("companyList",companyList);
List<WisdStores> storesList = storesService.list();
model.addAttribute("storesList", storesList);
List<WisdCompany> companyList = companyService.list();
model.addAttribute("companyList", companyList);
return "pages/order/order_refund_list";
}
@GetMapping(value = "/list")
@ResponseBody
public Result<IPage<WisdOeder>> list(String pickTimeStart,String pickTimeEnd,String createTimeStart,String createTimeEnd,Long companyId,Long addressId,Integer orderPick,String orderNumber, String userName, String userPhone, Integer status, Integer orderPayWay, int page, int num) {
IPage<WisdOeder> wisdCompanyIPage = orderService.selectPage(pickTimeStart,pickTimeEnd,createTimeStart,createTimeEnd,companyId,addressId,orderPick,orderNumber, userName, userPhone, status, orderPayWay, page, num);
public Result<IPage<WisdOeder>> list(String pickTimeStart, String pickTimeEnd, String createTimeStart, String createTimeEnd, Long companyId, Long addressId, Integer orderPick, String orderNumber, String userName, String userPhone, Integer status, Integer orderPayWay, int page, int num) {
IPage<WisdOeder> wisdCompanyIPage = orderService.selectPage(pickTimeStart, pickTimeEnd, createTimeStart, createTimeEnd, companyId, addressId, orderPick, orderNumber, userName, userPhone, status, orderPayWay, page, num);
return new Result<IPage<WisdOeder>>(ResultUtil.SUCCESS, ResultUtil.SUCCESS_DATA, wisdCompanyIPage);
}
@GetMapping(value = "/refundlist")
@ResponseBody
public Result<IPage<WisdOeder>> refundlist(String createTimeStart,String createTimeEnd,Long companyId,Long addressId,Integer orderPick,String orderNumber, String userName, String userPhone, Integer status, Integer orderPayWay, int page, int num) {
IPage<WisdOeder> wisdCompanyIPage = orderService.selectefundPage(createTimeStart,createTimeEnd,companyId,addressId,orderPick,orderNumber, userName, userPhone, status, orderPayWay, page, num);
public Result<IPage<WisdOeder>> refundlist(String createTimeStart, String createTimeEnd, Long companyId, Long addressId, Integer orderPick, String orderNumber, String userName, String userPhone, Integer status, Integer orderPayWay, int page, int num) {
IPage<WisdOeder> wisdCompanyIPage = orderService.selectefundPage(createTimeStart, createTimeEnd, companyId, addressId, orderPick, orderNumber, userName, userPhone, status, orderPayWay, page, num);
return new Result<IPage<WisdOeder>>(ResultUtil.SUCCESS, ResultUtil.SUCCESS_DATA, wisdCompanyIPage);
}
@ -178,6 +176,36 @@ public class OrderController {
return modelAndView;
}
//修改地址申请审批
@RequestMapping(value = "getUpdateAddress")
public ModelAndView getUpdateAddress(Long orderId, Integer type) {
if (orderId == null || type == null) {
return new ModelAndView("sys/error");
}
WisdOeder order = orderService.getById(orderId);
//type 1 一级弹出层 2二级弹出层
ModelAndView modelAndView = new ModelAndView("pages/order/order_update_address");
modelAndView.addObject("orderId", orderId);
modelAndView.addObject("type", type);
modelAndView.addObject("order", order);
return modelAndView;
}
//后台修改地址
@RequestMapping(value = "getEditAddress")
public ModelAndView getEditAddress(Long orderId, Integer type) {
if (orderId == null || type == null) {
return new ModelAndView("sys/error");
}
WisdOeder order = orderService.getById(orderId);
//type 1 一级弹出层 2二级弹出层
ModelAndView modelAndView = new ModelAndView("pages/order/order_edit_address");
modelAndView.addObject("orderId", orderId);
modelAndView.addObject("type", type);
modelAndView.addObject("order", order);
return modelAndView;
}
@RequestMapping(value = "deliveryRefundMoney")
@ResponseBody
public Result deliveryRefundMoney(Long orderId, String logisticsName, String logisticsNum) {
@ -261,7 +289,7 @@ public class OrderController {
}
order.setOrderRefundRemarke(orderRefundRemarke);
order.setOrderRefundRemarkeTime(new Date());
WisdIntegrlRoles wisdIntegrlRoles=integralRolesService.getById(1);
WisdIntegrlRoles wisdIntegrlRoles = integralRolesService.getById(1);
if (agree == 1) {
order.setStatus(63);
Calendar calendar2 = Calendar.getInstance();
@ -275,8 +303,8 @@ public class OrderController {
}
Boolean flag = orderService.updateById(order);
if (flag) {
if (order.getStatus()==63){
redisService.set ( "{'orderNumber':" + order.getOrderNumber() + ",'status':'63'}", "{'orderNumber':" + order.getOrderNumber() + ",'status':'63'}" , wisdIntegrlRoles.getOrderRefundTime()*24*60*60*1000 );
if (order.getStatus() == 63) {
redisService.set("{'orderNumber':" + order.getOrderNumber() + ",'status':'63'}", "{'orderNumber':" + order.getOrderNumber() + ",'status':'63'}", wisdIntegrlRoles.getOrderRefundTime() * 24 * 60 * 60 * 1000);
}
//redisService.set ( "{'orderNumber':" + order.getOrderNumber() + ",'status':'65'}", "{'orderNumber':" + order.getOrderNumber() + ",'status':'65'}" , 900000 );
return new Result(ResultUtil.SUCCESS, ResultUtil.SUCCESS_MSG);
@ -302,7 +330,7 @@ public class OrderController {
@RequestMapping(value = "deliveryStatus")
@ResponseBody
public Result deliveryStatus(Long orderId) {
WisdOeder wisdOeder=orderService.getById(orderId);
WisdOeder wisdOeder = orderService.getById(orderId);
if (wisdOeder.getOrderPayWay() == 2) {
WisdWxuser wisdWxuser = wxuserService.getById(wisdOeder.getUserId());
wisdWxuser.setUserIntegral(wisdWxuser.getUserIntegral() + wisdOeder.getOrderOtherPay().intValue());
@ -379,7 +407,7 @@ public class OrderController {
@RequestMapping(value = "nodeliveryStatus")
@ResponseBody
public Result nodeliveryStatus(Long orderId) {
WisdOeder wisdOeder=orderService.getById(orderId);
WisdOeder wisdOeder = orderService.getById(orderId);
wisdOeder.setStatus(2);
Boolean flag = orderService.saveOrUpdate(wisdOeder);
if (flag) {
@ -527,6 +555,7 @@ public class OrderController {
}
}
//获取物流信息
@RequestMapping(value = "getLogistics")
@ResponseBody
@ -592,26 +621,26 @@ public class OrderController {
// 导出订单信息
@RequestMapping(value = "exportOrder")
@ResponseBody
public Result exportOrder(String createTimeStart,String createTimeEnd,Long companyId,Long addressId,Integer orderPick,String orderNumber, String userName, String userPhone, Integer status, Integer orderPayWay, HttpServletResponse response, HttpServletRequest request,Integer type) throws IOException {
public Result exportOrder(String createTimeStart, String createTimeEnd, Long companyId, Long addressId, Integer orderPick, String orderNumber, String userName, String userPhone, Integer status, Integer orderPayWay, HttpServletResponse response, HttpServletRequest request, Integer type) throws IOException {
String[] title = {"下单时间", "订单状态", "订单号", "微信支付", "其他支付", "运费", "收货人", "电话", "地址", "下单留言", "提货方式", "物流名称", "物流单号", "商品名称", "商品编码", "商品类型", "商品规格", "商品价格", "数量", "是否是商家直发", "套餐券"};
QueryWrapper<WisdOeder> queryWrapper = new QueryWrapper<>();
if (orderNumber != null && !"".equals(orderNumber)) {
queryWrapper.eq("order_number", orderNumber);
}
if (type==1){
queryWrapper.le("status",6);
}else if(type==2){
queryWrapper.ge("status",5);
if (type == 1) {
queryWrapper.le("status", 6);
} else if (type == 2) {
queryWrapper.ge("status", 5);
}
if (userName != null && !"".equals(userName)) {
queryWrapper.like("oeder_costomer", userName);
}
if (createTimeStart!=null&&!"".equals(createTimeStart)){
queryWrapper.ge("create_time",createTimeStart);
if (createTimeStart != null && !"".equals(createTimeStart)) {
queryWrapper.ge("create_time", createTimeStart);
}
if (createTimeEnd!=null&&!"".equals(createTimeEnd)){
queryWrapper.le("create_time",createTimeEnd);
if (createTimeEnd != null && !"".equals(createTimeEnd)) {
queryWrapper.le("create_time", createTimeEnd);
}
if (userPhone != null && !"".equals(userPhone)) {
queryWrapper.like("order_phone", userPhone);
@ -619,15 +648,15 @@ public class OrderController {
if (status != null && status != 0) {
queryWrapper.eq("status", status);
}
if (orderPick!=null&&orderPick!=0){
queryWrapper.eq("order_pick",orderPick);
if (orderPick != null && orderPick != 0) {
queryWrapper.eq("order_pick", orderPick);
}
if (companyId!=null&&companyId!=0){
queryWrapper.eq("company_id",companyId);
if (companyId != null && companyId != 0) {
queryWrapper.eq("company_id", companyId);
}
if (addressId!=null&&addressId!=0){
queryWrapper.eq("address_id",addressId);
queryWrapper.eq("order_pick",1);
if (addressId != null && addressId != 0) {
queryWrapper.eq("address_id", addressId);
queryWrapper.eq("order_pick", 1);
}
if (orderPayWay != null && orderPayWay != 0) {
queryWrapper.eq("order_pay_way", orderPayWay);
@ -636,7 +665,7 @@ public class OrderController {
for (WisdOeder wisdOeder : dataList) {
if (wisdOeder.getOrderPayWay() == 3) {
WisdPackage wisdPackage = packageService.getWisdPackageById(wisdOeder.getPackageId());
if (wisdPackage!=null) {
if (wisdPackage != null) {
wisdOeder.setPackageName(wisdPackage.getPackageName());
}
}
@ -646,7 +675,7 @@ public class OrderController {
if (!orderDetailList.isEmpty()) {
for (WisdOrderDetail wisdOrderDetail : orderDetailList) {
WisdGoods wisdGoods = goodsService.getInfoById(wisdOrderDetail.getGoodsId());
if (wisdGoods!=null) {
if (wisdGoods != null) {
WisdGoodsSpec wisdGoodsSpec = goodsSpecService.getById(wisdOrderDetail.getSpecId());
wisdOrderDetail.setGoodsName(wisdGoods.getGoodsName());
wisdOrderDetail.setGoodsCode(wisdGoods.getGoodsCode());

View File

@ -18,7 +18,7 @@ import java.util.List;
* @author makejava
* @since 2020-09-15 16:56:34
*/
@ApiModel(value="wisd_oeder对象", description="")
@ApiModel(value = "wisd_oeder对象", description = "")
@TableName(value = "wisd_oeder")
@Data
public class WisdOeder implements Serializable {
@ -27,30 +27,30 @@ public class WisdOeder implements Serializable {
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@TableField(value = "create_user",fill = FieldFill.INSERT)
@TableField(value = "create_user", fill = FieldFill.INSERT)
private String createUser;
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(value = "create_time",fill = FieldFill.INSERT)
@TableField(value = "create_time", fill = FieldFill.INSERT)
private Date createTime;
@ApiModelProperty(value = "0正常1删除")
@TableField(value = "is_deleted",fill = FieldFill.INSERT)
@TableField(value = "is_deleted", fill = FieldFill.INSERT)
@TableLogic
private Integer isDeleted;
private Integer isDeleted;
@TableField(value = "update_user",fill = FieldFill.UPDATE)
@TableField(value = "update_user", fill = FieldFill.UPDATE)
private String updateUser;
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(value = "update_time",fill = FieldFill.UPDATE)
@TableField(value = "update_time", fill = FieldFill.UPDATE)
private Date updateTime;
@ApiModelProperty(value = "0开始")
@TableField(value = "version",fill = FieldFill.INSERT)
@TableField(value = "version", fill = FieldFill.INSERT)
private Integer version;
/**
* 公司id
@ -78,6 +78,17 @@ private Integer isDeleted;
* 地址id
*/
private Long addressId;
/**
* 待批准的新addressId
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
private Long pendingApprovalAddressId;
/**
* 待批准的新收货地址
*/
@TableField(updateStrategy = FieldStrategy.IGNORED)
private String pendingApprovalOrderAddress;
/**
* 联系地址
*/
@ -111,20 +122,20 @@ private Integer isDeleted;
/**
* 支付时间
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderPayTime;
/**
* 发货时间
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderDeliverTime;
/**
* 确认收货时间
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderConfirmTime;
/**
@ -165,7 +176,7 @@ private Integer isDeleted;
/**
* 订单运费
*/
private BigDecimal orderFreight;
private BigDecimal orderFreight;
/**
* 收货地址
@ -213,7 +224,7 @@ private Integer isDeleted;
/**
* 取消订单时间
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date cancelTime;
@ -230,7 +241,7 @@ private Integer isDeleted;
/**
* 退款时间
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderRefundTime;
@ -248,7 +259,7 @@ private Integer isDeleted;
/**
* 退换货回复时间
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderRefundRemarkeTime;
@ -306,7 +317,7 @@ private Integer isDeleted;
/**
* 商家确认退换货时间
*/
@JsonFormat(locale="zh", timezone="GMT+8", pattern="yyyy-MM-dd HH:mm:ss")
@JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date orderRefundMerchantsTime;

View File

@ -41,8 +41,7 @@ public class PhoneUtils {
// ^ 匹配输入字符串开始的位置
// \d 匹配一个或多个数字,其中 \ 要转义,所以是 \\d
// $ 匹配输入字符串结尾的位置
String regExp = "^((13[0-9])|(14[5,7,9])|(15[0-3,5-9])|(166)|(17[3,5,6,7,8])" +
"|(18[0-9])|(19[8,9]))\\d{8}$";
String regExp = "^[1][3,4,5,6,7,8,9][0-9]{9}$";
Pattern p = Pattern.compile(regExp);
Matcher m = p.matcher(str);
return m.matches();

View File

@ -24,9 +24,9 @@ public class SmsSend {
try {
//请根据实际 appid 和 appkey 进行开发,以下只作为演示 sdk 使用
//appid,appkey,templId申请方式可参考接入指南 https://www.qcloud.com/document/product/382/3785#5-.E7.9F.AD.E4.BF.A1.E5.86.85.E5.AE.B9.E9.85.8D.E7.BD.AE
int appid = 1400490839;
String appkey = "efcfa4c121e4d47986ca7e34f8cfda44";
int tmplId = 880571;
int appid = 1400441375;
String appkey = "d3ddf5a954e99c9c30e3c211f6388216";
int tmplId = 755056;
SmsSingleSender singleSender = new SmsSingleSender(appid, appkey);
SmsSingleSenderResult singleSenderResult;
//指定模板单发
@ -51,9 +51,9 @@ public class SmsSend {
try {
//请根据实际 appid 和 appkey 进行开发,以下只作为演示 sdk 使用
//appid,appkey,templId申请方式可参考接入指南 https://www.qcloud.com/document/product/382/3785#5-.E7.9F.AD.E4.BF.A1.E5.86.85.E5.AE.B9.E9.85.8D.E7.BD.AE
int appid = 1400490839;
String appkey = "efcfa4c121e4d47986ca7e34f8cfda44";
int tmplId = 880572;
int appid = 1400441375;
String appkey = "d3ddf5a954e99c9c30e3c211f6388216";
int tmplId = 778108;
SmsSingleSender singleSender = new SmsSingleSender(appid, appkey);
SmsSingleSenderResult singleSenderResult;
//指定模板单发

View File

@ -1,9 +1,12 @@
#开发环境
spring:
datasource:
url: jdbc:mysql://146.56.198.32:3306/wisdo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
username: root
password: Sphc666888!
url: jdbc:mysql://192.168.0.137:3306/wisdo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
# url: jdbc:mysql://146.56.198.32:3306/wisdo?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8
username: yshop
# username: root
password: Qwer1234.
# password: Sphc666888!
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: com.mysql.cj.jdbc.Driver
druid:

View File

@ -1,5 +1,6 @@
server:
port: 9090
port: 9000
# port: 9090
servlet:
context-path: /wisdommining
spring:
@ -38,7 +39,8 @@ spring:
# port: 6379
redis:
database: 10
host: 146.56.198.32
host: localhost
# host: 146.56.198.32
timeout: 100000
jedis:
pool:
@ -47,7 +49,8 @@ spring:
max-idle: 8
min-idle: 0
port: 6379
password: Zsd@2021!
# password: Zsd@2021!
password:
mybatis-plus:

View File

@ -0,0 +1,103 @@
<%--
Created by IntelliJ IDEA.
User: ayaya
Date: 2024/5/7
Time: 上午10:28
To change this template use File | Settings | File Templates.
--%>
<%@ include file="../../sys/base.jsp" %>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<html>
<head>
<meta charset="utf-8">
<title>56集品后台管理系统</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="${root}/static/core/css/form.css" media="all">
</head>
<body style="background-color: white">
<div class="layui-fluid">
<div class="layui-row">
<form class="layui-form" id="formData" lay-filter="formData">
<input type="hidden" id="type" value="${type}">
<input type="hidden" id="orderId" name="orderId" value="${orderId}">
<div class="layui-form-item formItem">
<label for="orderAddress" class="layui-form-label">收货地址</label>
<div class="layui-input-block">
<input type="text" id="orderAddress" name="orderAddress"
placeholder="请输入收货地址" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item formItem">
<label for="logisticsName" class="layui-form-label">物流公司</label>
<div class="layui-input-block">
<input type="text" id="logisticsName" name="logisticsName"
placeholder="请输入物流公司" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item formItem">
<label for="logisticsNum" class="layui-form-label">物流单号</label>
<div class="layui-input-block">
<input type="text" id="logisticsNum" name="logisticsNum"
placeholder="请输入物流单号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item formItem">
<label for="logisticsNum" class="layui-form-label"></label>
<button class="layui-btn layui-btn-primary layui-btn-sm subBtn" style="width: 165px;margin-top: 23px;"
lay-filter="add" lay-submit="">提交
</button>
</div>
</form>
</div>
</div>
<script>
layui.use(['layer', 'form'], function () {
var form = layui.form
//监听提交
form.on('submit(add)', function (data) {
$modal({
type: 'confirm',
icon: 'question',
title: '提交确定',
content: '确认提交吗?',
mask: true,
top: 50,
maskClose: true,
confirm: function (close) {
var index = layer.load(2);
let url = root + "/api/order/approvalUpdateAddress?orderId=" + ${order.id} +"&type=1"
if (data.field.logisticsNum) {
url += "&logisticsNo=" + data.field.logisticsNum
}
$.get(url, (e) => {
layer.close(index);
if (e.code == 1) {
$.message({message: e.msg, type: "success"});
setTimeout(function () {
admin.close();
if ($("#type").val() == 1) {
admin.fatherReload();
} else {
admin.fatherReload();
admin.fatherFatherReload();
}
}, 500)
} else {
$.message({message: e.msg, type: "error"});
}
}, "json")
close()
},
cancel: function (close) {
close()
}
})
return false;
});
})
</script>
</body>
</html>

View File

@ -14,7 +14,8 @@
<title></title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
</head>
<body>
@ -86,26 +87,30 @@
</div>
下单时间:
<div class="layui-inline layui-show-xs-block">
<input type="datetime" name="createTimeStart" id="createTimeStart" lay-verify="datetime" placeholder="yyyy-MM-dd HH:mm:ss" autocomplete="off" class="layui-input">
<input type="datetime" name="createTimeStart" id="createTimeStart" lay-verify="datetime"
placeholder="yyyy-MM-dd HH:mm:ss" autocomplete="off" class="layui-input">
</div>
-
<div class="layui-inline layui-show-xs-block">
<input type="datetime" name="createTimeEnd" id="createTimeEnd" lay-verify="datetime" placeholder="yyyy-MM-dd HH:mm:ss" autocomplete="off" class="layui-input">
<input type="datetime" name="createTimeEnd" id="createTimeEnd" lay-verify="datetime"
placeholder="yyyy-MM-dd HH:mm:ss" autocomplete="off" class="layui-input">
</div>
提货时间:
<div class="layui-inline layui-show-xs-block">
<input type="datetime" name="pickTimeStart" id="pickTimeStart" lay-verify="datetime" placeholder="yyyy-MM-dd HH:mm:ss" autocomplete="off" class="layui-input">
<input type="datetime" name="pickTimeStart" id="pickTimeStart" lay-verify="datetime"
placeholder="yyyy-MM-dd HH:mm:ss" autocomplete="off" class="layui-input">
</div>
-
<div class="layui-inline layui-show-xs-block">
<input type="datetime" name="pickTimeEnd" id="pickTimeEnd" lay-verify="datetime" placeholder="yyyy-MM-dd HH:mm:ss" autocomplete="off" class="layui-input">
<input type="datetime" name="pickTimeEnd" id="pickTimeEnd" lay-verify="datetime"
placeholder="yyyy-MM-dd HH:mm:ss" autocomplete="off" class="layui-input">
</div>
<div class="layui-inline layui-show-xs-block">
<a class="layui-btn" data-type="reload"><i class="layui-icon">&#xe615;</i></a>
</div>
<%-- <div class="layui-inline layui-show-xs-block">--%>
<%-- <a class="layui-btn" data-type="reload">导出</a>--%>
<%-- </div>--%>
<%-- <div class="layui-inline layui-show-xs-block">--%>
<%-- <a class="layui-btn" data-type="reload">导出</a>--%>
<%-- </div>--%>
</form>
</div>
<div class="layui-card-body ">
@ -123,7 +128,8 @@
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="deleteAll"><i class="layui-icon">&#xe640;</i>批量删除
</button>
<button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="exportOrder"><i class="layui-icon layui-icon-triangle-r"></i>导出订单信息
<button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="exportOrder"><i
class="layui-icon layui-icon-triangle-r"></i>导出订单信息
</button>
<button class="layui-btn layui-btn-sm" lay-event="importAll">导入</button>
</div>
@ -138,7 +144,7 @@
base: root + '/static/core/js/base/' //静态资源所在路径
}).extend({
index: 'index' //主入口模块
}).use(['table', 'layer', 'form','laydate'], function () {
}).use(['table', 'layer', 'form', 'laydate'], function () {
var form = layui.form,
laydate = layui.laydate,
table = layui.table;
@ -146,23 +152,23 @@
//执行一个laydate实例
laydate.render({
elem: '#createTimeStart' //指定元素
,format: 'yyyy-MM-dd HH:mm:ss'
,type: 'datetime'
, format: 'yyyy-MM-dd HH:mm:ss'
, type: 'datetime'
});
laydate.render({
elem: '#createTimeEnd' //指定元素
,format: 'yyyy-MM-dd HH:mm:ss'
,type: 'datetime'
, format: 'yyyy-MM-dd HH:mm:ss'
, type: 'datetime'
});
laydate.render({
elem: '#pickTimeStart' //指定元素
,format: 'yyyy-MM-dd HH:mm:ss'
,type: 'datetime'
, format: 'yyyy-MM-dd HH:mm:ss'
, type: 'datetime'
});
laydate.render({
elem: '#pickTimeEnd' //指定元素
,format: 'yyyy-MM-dd HH:mm:ss'
,type: 'datetime'
, format: 'yyyy-MM-dd HH:mm:ss'
, type: 'datetime'
});
//方法级渲染
@ -177,13 +183,13 @@
userPhone: $("#userPhone").val(),
status: $("#status").val(),
orderPayWay: $("#orderPayWay").val(),
orderPick:$("#orderPick").val(),
addressId:$("#addressId").val(),
companyId:$("#companyId").val(),
createTimeStart:$("#createTimeStart").val(),
createTimeEnd:$("#createTimeEnd").val(),
pickTimeStart:$("#pickTimeStart").val(),
pickTimeEnd:$("#pickTimeEnd").val(),
orderPick: $("#orderPick").val(),
addressId: $("#addressId").val(),
companyId: $("#companyId").val(),
createTimeStart: $("#createTimeStart").val(),
createTimeEnd: $("#createTimeEnd").val(),
pickTimeStart: $("#pickTimeStart").val(),
pickTimeEnd: $("#pickTimeEnd").val(),
},
cols: [[
{checkbox: true, fixed: true},
@ -195,22 +201,22 @@
field: 'orderPayWay',
title: '支付方式',
templet: function (item) {
if (item.orderPayWay==1) {
if (item.orderPayWay == 1) {
return '<span class="layui-badge layui-bg-red" style="margin-top: 5px">微信支付</span>';
}
if (item.orderPayWay==2){
if (item.orderPayWay == 2) {
return '<span class="layui-badge layui-bg-orange" style="margin-top: 5px">积分支付</span>';
}
if (item.orderPayWay==3){
if (item.orderPayWay == 3) {
return '<span class="layui-badge layui-bg-green" style="margin-top: 5px">套餐券</span>';
}
if (item.orderPayWay==4){
if (item.orderPayWay == 4) {
return '<span class="layui-badge layui-bg-cyan" style="margin-top: 5px">现金券</span>';
}
if (item.orderPayWay==5){
if (item.orderPayWay == 5) {
return '<span class="layui-badge layui-bg-blue" style="margin-top: 5px">现金券(折扣)</span>';
}
if (item.orderPayWay==6){
if (item.orderPayWay == 6) {
return '<span class="layui-badge layui-bg-gray" style="margin-top: 5px">促销</span>';
}
}
@ -233,17 +239,17 @@
},
{
field: 'orderFreight',
width:70,
width: 70,
title: '运费'
},
{
field: 'orderPick',
title: '提货方式',
templet: function (item) {
if (item.orderPick==1) {
if (item.orderPick == 1) {
return '<span class="layui-badge layui-bg-green" style="margin-top: 5px">自提</span>';
}
if (item.orderPick==2){
if (item.orderPick == 2) {
return '<span class="layui-badge layui-bg-error" style="margin-top: 5px">快递</span>';
}
}
@ -256,28 +262,28 @@
field: 'status',
title: '订单状态',
templet: function (item) {
if (item.status==1) {
if (item.status == 1) {
return '<span class="layui-badge layui-bg-green" style="margin-top: 5px">待支付</span>';
}
if (item.status==2){
if (item.status == 2) {
return '<span class="layui-badge layui-bg-cyan" style="margin-top: 5px">待发货</span>';
}
if (item.status==3){
if (item.status == 3) {
return '<span class="layui-badge layui-bg-orange" style="margin-top: 5px">待收货</span>';
}
if (item.status==4){
if (item.status == 4) {
return '<span class="layui-badge layui-bg-red" style="margin-top: 5px">已完成</span>';
}
if (item.status==5){
if (item.status == 5) {
return '<span class="layui-badge layui-bg-black" style="margin-top: 5px">已取消</span>';
}
if (item.status==6){
if (item.status == 6) {
return '<span class="layui-badge layui-bg-error" style="margin-top: 5px">退换货</span>';
}
if (item.status==66){
if (item.status == 66) {
return '<span class="layui-badge layui-bg-blue" style="margin-top: 5px">退换货完成</span>';
}
if (item.status==67){
if (item.status == 67) {
return '<span class="layui-badge layui-bg-blue" style="margin-top: 5px">退换货失败</span>';
}
}
@ -287,13 +293,17 @@
title: '创建时间',
sort: true
},
{fixed: 'right', align: 'center', width:200,title: '操作',templet: function (item) {
if (item.status==2 && item.orderPick==2) {
return '<button class="layui-btn layui-btn-sm" lay-event="edit">详情</button><button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="delivery">发货</button><button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="del">删除</button>';
}else {
return '<button class="layui-btn layui-btn-sm" lay-event="edit">详情</button><button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="del">删除</button>';
{
fixed: 'right', align: 'center', width: 320, title: '操作', templet: function (item) {
if (item.status != 4 && item.orderPick == 2 && item.pendingApprovalAddressId) {
return '<button class="layui-btn layui-btn-sm" lay-event="editAddress">修改地址</button><button class="layui-btn layui-btn-sm" lay-event="edit">详情</button><button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="del">删除</button><button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="updateAddress">处理地址修改申请</button>';
} else if (item.status == 2 && item.orderPick == 2) {
return '<button class="layui-btn layui-btn-sm" lay-event="editAddress">修改地址</button><button class="layui-btn layui-btn-sm" lay-event="edit">详情</button><button class="layui-btn layui-btn-sm layui-btn-normal" lay-event="delivery">发货</button><button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="del">删除</button>';
} else {
return '<button class="layui-btn layui-btn-sm" lay-event="editAddress">修改地址</button><button class="layui-btn layui-btn-sm" lay-event="edit">详情</button><button class="layui-btn layui-btn-sm layui-btn-danger" lay-event="del">删除</button>';
}
}}
}
}
]],
page: true,
request: {
@ -364,7 +374,7 @@
var index = layer.load(2, {
offset: '20%',
shade: [0.5, '#000'],
content: '正在处理, 请稍后...',success: function (layero) {
content: '正在处理, 请稍后...', success: function (layero) {
layero.find('.layui-layer-content').css({
'paddingTop': '40px',
'textAlign': 'center',
@ -374,7 +384,8 @@
'fontWeight': '700',
'letterSpacing': '2px'
});
}})
}
})
$.ajax({
url: root + "/order/exportOrder",
type: "post",
@ -384,16 +395,16 @@
userPhone: $("#userPhone").val(),
status: $("#status").val(),
orderPayWay: $("#orderPayWay").val(),
orderPick:$("#orderPick").val(),
addressId:$("#addressId").val(),
companyId:$("#companyId").val(),
createTimeStart:$("#createTimeStart").val(),
createTimeEnd:$("#createTimeEnd").val(),
pickTimeStart:$("#pickTimeStart").val(),
pickTimeEnd:$("#pickTimeEnd").val(),
type:1
orderPick: $("#orderPick").val(),
addressId: $("#addressId").val(),
companyId: $("#companyId").val(),
createTimeStart: $("#createTimeStart").val(),
createTimeEnd: $("#createTimeEnd").val(),
pickTimeStart: $("#pickTimeStart").val(),
pickTimeEnd: $("#pickTimeEnd").val(),
type: 1
},
success: function(res){
success: function (res) {
window.location.href = res.value;
layer.close(index);
$.message({
@ -457,14 +468,14 @@
// var ids = [];
// ids.push(data.id);
// del(ids, obj, "one");
close()
close()
},
cancel: function (close) {
close()
}
})
} else if (layEvent === 'edit') { //编辑
admin.openMax(root + '/order/find?id=' + data.id,'[ 详情 ]');
admin.openMax(root + '/order/find?id=' + data.id, '[ 详情 ]');
} else if (layEvent === 'delivery') {
if (data.status != 2) {
$.message({
@ -478,7 +489,7 @@
type: 2,
content: root + "/order/getAllLogistics?type=1&orderId=" + data.id,
area: ['500px', '300px']
,offset: '20%'
, offset: '20%'
});
} else if (layEvent === 'refund') {
if (data.status != 6) {
@ -503,7 +514,7 @@
close()
}
})
}else if (layEvent === 'refundno') {
} else if (layEvent === 'refundno') {
if (data.status != 6) {
$.message({
message: "该状态无法拒绝退换货",
@ -526,6 +537,22 @@
close()
}
})
} else if (layEvent === "updateAddress") {
layer.open({
title: "处理发货地址修改申请",
content: root + "/order/getUpdateAddress?type=1&orderId=" + data.id,
area: ['500px', '300px'],
offset: '20%',
type: 2,
})
} else if (layEvent === 'editAddress') {
layer.open({
title: "修改地址",
content: root + "/order/getEditAddress?type=1&orderId=" + data.id,
area: ['500px', '300px'],
offset: '20%',
type: 2,
})
}
});
@ -534,7 +561,7 @@
function refund(id, obj, type) {
var index = layer.load(2);
console.log($(".layui-laypage-em").next().html());
$.post(root + "/order/refund?orderId="+id, function (e) {
$.post(root + "/order/refund?orderId=" + id, function (e) {
layer.close(index);
if (e.code == 1) {
$.message({
@ -560,7 +587,7 @@
function refundno(id, obj, type) {
var index = layer.load(2);
console.log($(".layui-laypage-em").next().html());
$.post(root + "/order/refundno?orderId="+id, function (e) {
$.post(root + "/order/refundno?orderId=" + id, function (e) {
layer.close(index);
if (e.code == 1) {
$.message({
@ -585,7 +612,7 @@
//删除
function del(id, obj, type) {
var index = layer.load(2);
$.post(root + "/order/delete",{ids: JSON.stringify(id)}, function (e) {
$.post(root + "/order/delete", {ids: JSON.stringify(id)}, function (e) {
layer.close(index);
if (e.code == 1) {
if (type == "one") {
@ -621,13 +648,13 @@
userPhone: $("#userPhone").val(),
status: $("#status").val(),
orderPayWay: $("#orderPayWay").val(),
orderPick:$("#orderPick").val(),
addressId:$("#addressId").val(),
companyId:$("#companyId").val(),
createTimeStart:$("#createTimeStart").val(),
createTimeEnd:$("#createTimeEnd").val(),
pickTimeStart:$("#pickTimeStart").val(),
pickTimeEnd:$("#pickTimeEnd").val(),
orderPick: $("#orderPick").val(),
addressId: $("#addressId").val(),
companyId: $("#companyId").val(),
createTimeStart: $("#createTimeStart").val(),
createTimeEnd: $("#createTimeEnd").val(),
pickTimeStart: $("#pickTimeStart").val(),
pickTimeEnd: $("#pickTimeEnd").val(),
},
page: {
curr: 1 //重新从第 1 页开始

View File

@ -0,0 +1,97 @@
<%--
Created by IntelliJ IDEA.
User: ayaya
Date: 2024/5/7
Time: 上午10:28
To change this template use File | Settings | File Templates.
--%>
<%@ include file="../../sys/base.jsp" %>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<html>
<head>
<meta charset="utf-8">
<title>56集品后台管理系统</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
<link rel="stylesheet" href="${root}/static/core/css/form.css" media="all">
</head>
<body style="background-color: white">
<div class="layui-fluid">
<div class="layui-row">
<form class="layui-form" id="formData" lay-filter="formData">
<input type="hidden" id="type" value="${type}">
<input type="hidden" id="orderId" name="orderId" value="${orderId}">
<div class="layui-form-item formItem">
<label for="logisticsName" class="layui-form-label">发货地址</label>
<div class="layui-input-block">
<input type="text" readonly id="logisticsName" name="logisticsName" lay-verify="required"
value="${order.pendingApprovalOrderAddress}"
autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item formItem">
<label for="logisticsNum" class="layui-form-label">物流单号</label>
<div class="layui-input-block">
<input type="text" id="logisticsNum" name="logisticsNum"
placeholder="请输入新的物流单号" autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item formItem">
<label for="logisticsNum" class="layui-form-label"></label>
<button class="layui-btn layui-btn-primary layui-btn-sm subBtn" style="width: 165px;margin-top: 23px;"
lay-filter="add" lay-submit="">提交
</button>
</div>
</form>
</div>
</div>
<script>
layui.use(['layer', 'form'], function () {
var form = layui.form
//监听提交
form.on('submit(add)', function (data) {
$modal({
type: 'confirm',
icon: 'question',
title: '提交确定',
content: '确认提交吗?',
mask: true,
top: 50,
maskClose: true,
confirm: function (close) {
var index = layer.load(2);
let url = root + "/api/order/approvalUpdateAddress?orderId=" + ${order.id} +"&type=1"
if (data.field.logisticsNum) {
url += "&logisticsNo=" + data.field.logisticsNum
}
$.get(url, (e) => {
layer.close(index);
if (e.code == 1) {
$.message({message: e.msg, type: "success"});
setTimeout(function () {
admin.close();
if ($("#type").val() == 1) {
admin.fatherReload();
} else {
admin.fatherReload();
admin.fatherFatherReload();
}
}, 500)
} else {
$.message({message: e.msg, type: "error"});
}
}, "json")
close()
},
cancel: function (close) {
close()
}
})
return false;
});
})
</script>
</body>
</html>