wang-hao-jie
2021-11-09 f9c9e1f08d81f87b24598f7d18b6e6d2ca07b67d

5个文件已修改
79 ■■■■■ 已修改文件
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CustomerController.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/Customer.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/CustomerReceive.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/OrderTask.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CustomerController.java
@@ -5,6 +5,8 @@
import cn.exrick.xboot.core.common.vo.PageVo;
import cn.exrick.xboot.core.common.vo.Result;
import cn.exrick.xboot.your.entity.Customer;
import cn.exrick.xboot.your.entity.CustomerReceive;
import cn.exrick.xboot.your.service.ICustomerReceiveService;
import cn.exrick.xboot.your.service.ICustomerService;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -30,12 +32,18 @@
    @Autowired
    private ICustomerService iCustomerService;
    @Autowired
    private ICustomerReceiveService iCustomerReceiveService;
    @RequestMapping(value = "/get/{id}", method = RequestMethod.GET)
    @ApiOperation(value = "通过id获取")
    public Result<Customer> get(@PathVariable String id) {
        Customer customer = iCustomerService.getById(id);
        QueryWrapper<CustomerReceive> wrapper = new QueryWrapper<>();
        wrapper.eq("customer_id",id);
        wrapper.eq("customer_id",id);
        List<CustomerReceive> list = iCustomerReceiveService.list(wrapper);
        customer.setReceives(list);
        return new ResultUtil<Customer>().setData(customer);
    }
@@ -70,6 +78,28 @@
        return new ResultUtil<Customer>().setErrorMsg("操作失败");
    }
    @RequestMapping(value = "/update", method = RequestMethod.POST)
    @ApiOperation(value = "更新数据")
    public Result<Customer> update(String customerId,String lng,String lat,String address,String headImg) {
        Customer customer = iCustomerService.getById(customerId);
        if(StrUtil.isNotEmpty(lng)){
            customer.setLng(lng);
        }
        if(StrUtil.isNotEmpty(lat)){
            customer.setLat(lat);
        }
        if(StrUtil.isNotEmpty(address)){
            customer.setRegisteredAddress(address);
        }
        if(StrUtil.isNotEmpty(headImg)){
            customer.setHeadImg(headImg);
        }
        if (iCustomerService.saveOrUpdate(customer)) {
            return new ResultUtil<Customer>().setData(customer);
        }
        return new ResultUtil<Customer>().setErrorMsg("操作失败");
    }
    @RequestMapping(value = "/delByIds", method = RequestMethod.POST)
    @ApiOperation(value = "批量通过id删除")
    public Result<Object> delAllByIds(@RequestParam String[] ids) {
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java
@@ -205,6 +205,33 @@
        return new ResultUtil<Object>().setData(map);
    }
    @RequestMapping(value = "/addImg", method = RequestMethod.POST)
    @ApiOperation(value = "上传门头照")
    public Object saveOrUpdate(String orderId,String imgUrl) {
        OrderTask orderTask = iOrderTaskService.getById(orderId);
        orderTask.setImg(imgUrl);
        iOrderTaskService.saveOrUpdate(orderTask);
        return ResultUtil.success("添加成功");
    }
    @RequestMapping(value = "/signFor", method = RequestMethod.POST)
    @ApiOperation(value = "签收")
    public Object signFor(String orderId,int status,String content) {
        OrderTask orderTask = iOrderTaskService.getById(orderId);
        orderTask.setStatus(status);
        orderTask.setUserId(securityUtil.getCurrUser().getId());
        if(!StrUtil.isEmpty(content)){
            orderTask.setRemarks(content);
        }else{
            if(status==2){
                return ResultUtil.error("请填写异常签收原因");
            }
        }
        iOrderTaskService.saveOrUpdate(orderTask);
        return ResultUtil.success("添加成功");
    }
    @RequestMapping(value = "/getByPage", method = RequestMethod.GET)
    @ApiOperation(value = "分页获取")
    public Result<IPage<OrderTask>> getByPage(PageVo page) {
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/Customer.java
@@ -1,6 +1,7 @@
package cn.exrick.xboot.your.entity;
import cn.exrick.xboot.core.base.XbootBaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
@@ -12,7 +13,9 @@
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
import java.util.List;
/**
 * @author Exrick
@@ -66,7 +69,7 @@
    @ApiModelProperty(value = "商户注册地址")
    private String registeredAddress;
    @ApiModelProperty(value = "联系人")
    @ApiModelProperty(value = "联系人 法人")
    private String linker;
    @ApiModelProperty(value = "零售许可证")
@@ -75,4 +78,8 @@
    @ApiModelProperty(value = "接货人名称")
    private String recvName;
    @Transient
    @TableField(exist = false)
    @ApiModelProperty(value = "接货人列表")
    private List<CustomerReceive> receives;
}
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/CustomerReceive.java
@@ -3,18 +3,15 @@
import cn.exrick.xboot.core.base.XbootBaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;
/**
 * @author Exrick
@@ -30,7 +27,7 @@
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "商户id")
    @ApiModelProperty(value = "区域id")
    private String customerId;
    @ApiModelProperty(value = "名称")
@@ -48,4 +45,8 @@
    @Transient
    @TableField(exist = false)
    private String customerName;
    @ApiModelProperty(value = "头像")
    private String img;
}
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/OrderTask.java
@@ -79,7 +79,7 @@
    @ApiModelProperty(value = "是否驶出月台(0:否  1:是)")
    private int isOut;
    @ApiModelProperty(value = "0配送中,1已送达,2无法送达,3异常签收")
    @ApiModelProperty(value = "0配送中,1已送达,3异常签收")
    private int status;
    @ApiModelProperty(value = "无法送达的原因")