bug fix,修改地址

pull/1/head
wqy 2 years ago
parent 0d9d9dd22d
commit bb067689b4

@ -50,6 +50,12 @@ public class OrderController extends BaseController {
return ResponseEntity.ok(service.selectList(query, page)); return ResponseEntity.ok(service.selectList(query, page));
} }
@ApiOperation("修改收件人信息")
@PostMapping("/receiver/update")
public ResponseEntity<Boolean> updateReceiver(@RequestBody Order order) {
return ResponseEntity.ok(service.updateReceiver(order));
}
@ApiOperation("导出订单表列表") @ApiOperation("导出订单表列表")
@PreAuthorize("@ss.hasPermi('oms:order:export')") @PreAuthorize("@ss.hasPermi('oms:order:export')")
@Log(title = "订单表", businessType = BusinessType.EXPORT) @Log(title = "订单表", businessType = BusinessType.EXPORT)

@ -33,14 +33,14 @@ public class ManagerOrderQueryForm {
@ApiModelProperty(name = "status", value = "订单状态0->待付款1->待发货2->已发货3->已完成4->已关闭5->无效订单", required = true, dataType = "String") @ApiModelProperty(name = "status", value = "订单状态0->待付款1->待发货2->已发货3->已完成4->已关闭5->无效订单", required = true, dataType = "String")
private Integer status; private Integer status;
@ApiModelProperty("省份/直辖市id 精确匹配") @ApiModelProperty("省份/直辖市 精确匹配")
private Long receiverProvinceId; private String receiverProvince;
@ApiModelProperty("城市id 精确匹配") @ApiModelProperty("城市 精确匹配")
private Long receiverCityId; private String receiverCity;
@ApiModelProperty("区id 精确匹配") @ApiModelProperty("区 精确匹配")
private Long receiverDistrictId; private String receiverDistrict;
@ApiModelProperty(name = "startTime", value = "开始时间", required = true, dataType = "Date") @ApiModelProperty(name = "startTime", value = "开始时间", required = true, dataType = "Date")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

@ -30,6 +30,7 @@ import com.cyl.manager.ums.mapper.MemberMapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.ruoyi.common.constant.Constants; import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.utils.AesCryptoUtils; import com.ruoyi.common.utils.AesCryptoUtils;
import com.ruoyi.common.utils.PhoneUtils;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -380,4 +381,23 @@ public class OrderService {
return null; return null;
} }
} }
public Boolean updateReceiver(Order order) {
Order dbOrder = orderMapper.selectById(order.getId());
if (dbOrder == null) {
return false;
}
UpdateWrapper<Order> updateWrapper = new UpdateWrapper<>();
updateWrapper.set("receiver_name",order.getReceiverName())
.set("receiver_phone",PhoneUtils.hidePhone(order.getReceiverPhone()))
.set("receiver_city",order.getReceiverCity())
.set("receiver_district",order.getReceiverDistrict())
.set("receiver_province",order.getReceiverProvince())
.set("receiver_detail_address",order.getReceiverDetailAddress())
.set("receiver_phone_encrypted",AesCryptoUtils.encrypt(aesKey, order.getReceiverPhone()))
.set("update_time",LocalDateTime.now());
updateWrapper.eq("id",order.getId());
int update = orderMapper.update(null, updateWrapper);
return update == 1;
}
} }

@ -133,14 +133,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!--<if test="productName != null and productName != ''">--> <!--<if test="productName != null and productName != ''">-->
<!--and instr(b.product_name, #{productName}) > 0--> <!--and instr(b.product_name, #{productName}) > 0-->
<!--</if>--> <!--</if>-->
<if test="receiverProvinceId != null "> <if test="receiverProvince != null ">
and a.receiver_province_id = #{receiverProvinceId} and a.receiver_province = #{receiverProvince}
</if> </if>
<if test="receiverCityId != null"> <if test="receiverCity != null">
and a.receiver_city_id = #{receiverCityId} and a.receiver_city = #{receiverCity}
</if> </if>
<if test="receiverDistrictId != null"> <if test="receiverDistrict != null">
and a.receiver_district_id = #{receiverDistrictId} and a.receiver_district = #{receiverDistrict}
</if> </if>
<if test="userPhone != null and userPhone != ''"> <if test="userPhone != null and userPhone != ''">
and c.phone_encrypted=#{userPhone} > 0 and c.phone_encrypted=#{userPhone} > 0

Loading…
Cancel
Save