From f9c9e1f08d81f87b24598f7d18b6e6d2ca07b67d Mon Sep 17 00:00:00 2001 From: wang-hao-jie <1550036656@qq.com> Date: 星期二, 09 十一月 2021 14:57:24 +0800 Subject: [PATCH] 违 --- xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CustomerController.java | 32 +++++++++++++++ xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/Customer.java | 9 ++++ xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/OrderTask.java | 2 xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/CustomerReceive.java | 9 ++-- xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java | 27 +++++++++++++ 5 files changed, 72 insertions(+), 7 deletions(-) diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CustomerController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CustomerController.java index bd68872..57b0c96 100644 --- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/CustomerController.java +++ b/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) { diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java index 5fef915..11ed8e9 100644 --- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/controller/OrderTaskController.java +++ b/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) { diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/Customer.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/Customer.java index a344651..e67382f 100644 --- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/Customer.java +++ b/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; } \ No newline at end of file diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/CustomerReceive.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/CustomerReceive.java index 5694649..dc100e5 100644 --- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/CustomerReceive.java +++ b/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; + } \ No newline at end of file diff --git a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/OrderTask.java b/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/OrderTask.java index f7c91c6..b0f6892 100644 --- a/xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/OrderTask.java +++ b/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 = "鏃犳硶閫佽揪鐨勫師鍥�") -- Gitblit v1.9.1