订单统计及项目加盟,社区代理记录的相关接口
This commit is contained in:
parent
209411ec4f
commit
e2d4a86ac4
|
|
@ -125,15 +125,19 @@ public class CustomerPlaceController extends BaseController
|
|||
// 验证码校验正确
|
||||
if(CacheUtils.get(customerPlace.getPhone()).toString().equals(customerPlace.getCode())){
|
||||
int result = customerPlaceService.insertCustomerPlace(customerPlace);
|
||||
|
||||
int updateStatusResult = 1;
|
||||
if (customerPlace.getType().equals("distribution")) {
|
||||
Customer params = new Customer();
|
||||
params.setCustomerId(customerPlace.getCustomerId());
|
||||
params.setPlaceStatus(PlaceStatus.PLACE_APPLYING.getCode());
|
||||
int updateStatusResult = customerService.updateCustomer(params);
|
||||
updateStatusResult = customerService.updateCustomer(params);
|
||||
}
|
||||
if(result > 0 && updateStatusResult > 0){
|
||||
CacheUtils.remove(customerPlace.getPhone());
|
||||
return AjaxResult.success("分销申请成功!");
|
||||
return AjaxResult.success("申请成功!");
|
||||
}else {
|
||||
return AjaxResult.error("分销申请失败!");
|
||||
return AjaxResult.error("申请失败!");
|
||||
}
|
||||
}else {
|
||||
return AjaxResult.error("验证码错误!");
|
||||
|
|
|
|||
|
|
@ -229,6 +229,11 @@ public class OrderMasterController extends BaseController {
|
|||
return voDataTable(orderListResponses, list);
|
||||
}
|
||||
|
||||
@PostMapping("/app/count")
|
||||
@ResponseBody
|
||||
public AjaxResult countAppList(@RequestBody OrderMaster orderMaster) {
|
||||
return AjaxResult.success(orderMasterService.countOrderMasterList(orderMaster));
|
||||
}
|
||||
|
||||
@PostMapping("/after/list")
|
||||
@ResponseBody
|
||||
|
|
@ -374,6 +379,45 @@ public class OrderMasterController extends BaseController {
|
|||
return voDataTable(orderListResponses, list);
|
||||
}
|
||||
|
||||
@PostMapping("/after/count")
|
||||
@ResponseBody
|
||||
public AjaxResult countAfterList(@RequestBody OrderMaster orderMaster) {
|
||||
// 查所有售后的单
|
||||
AfterServiceRecord afterServiceRecord = new AfterServiceRecord();
|
||||
afterServiceRecord.setExcludeAfterServiceFinished(Boolean.TRUE);
|
||||
List<AfterServiceRecord> afterServiceRecordList = afterServiceRecordService.selectAfterServiceRecordList(afterServiceRecord);
|
||||
// 踢重后的子单ids
|
||||
List<Long> detailIds = afterServiceRecordList.stream().map(AfterServiceRecord::getOrderDetailId).distinct().collect(Collectors.toList());
|
||||
StringBuilder orderDetailIds = new StringBuilder();
|
||||
OrderDetail orderDetail = new OrderDetail();
|
||||
orderDetail.setCustomerId(orderMaster.getCustomerId());
|
||||
orderDetail.setDeptId(orderMaster.getDeptId());
|
||||
detailIds.forEach(id->{
|
||||
orderDetailIds.append(id).append(",");
|
||||
});
|
||||
String ids = orderDetailIds.toString();
|
||||
if(StringUtils.isNotEmpty(ids)){
|
||||
orderDetail.setOrderDetailIds(ids.substring(0, ids.length()-1));
|
||||
}else {
|
||||
orderDetail.setOrderDetailIds("0");
|
||||
}
|
||||
// 所有售后的子单
|
||||
List<OrderDetail> orderDetailList = orderDetailService.selectOrderDetailList(orderDetail);
|
||||
StringBuilder orderMasterIds = new StringBuilder();
|
||||
orderDetailList.stream().map(OrderDetail::getOrderMasterId).distinct()
|
||||
.collect(Collectors.toList()).forEach(id->{
|
||||
orderMasterIds.append(id).append(",");
|
||||
});
|
||||
String orderIds = orderMasterIds.toString();
|
||||
if(StringUtils.isNotEmpty(orderIds)){
|
||||
orderMaster.setOrderMasterIds(orderIds.substring(0, orderIds.length()-1));
|
||||
}else {
|
||||
orderMaster.setOrderMasterIds("0");
|
||||
}
|
||||
|
||||
return AjaxResult.success(orderMasterService.countOrderMasterList(orderMaster));
|
||||
}
|
||||
|
||||
@PostMapping("/app/detail")
|
||||
@ResponseBody
|
||||
public AjaxResult appDetail(@RequestBody OrderMaster request) {
|
||||
|
|
|
|||
|
|
@ -38,6 +38,10 @@ public class CustomerPlace extends BaseEntity
|
|||
|
||||
public Integer status;
|
||||
|
||||
private String type;
|
||||
|
||||
private String subType;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
|
|
@ -100,6 +104,22 @@ public class CustomerPlace extends BaseEntity
|
|||
this.status = status;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getSubType() {
|
||||
return subType;
|
||||
}
|
||||
|
||||
public void setSubType(String subType) {
|
||||
this.subType = subType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
@ -113,6 +133,8 @@ public class CustomerPlace extends BaseEntity
|
|||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.append("type", getType())
|
||||
.append("subType", getSubType())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -29,7 +29,9 @@
|
|||
<if test="customerId != null "> and customer_id = #{customerId}</if>
|
||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||
<if test="city != null "> and city = #{city}</if>
|
||||
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectCustomerPlaceById" parameterType="String" resultMap="CustomerPlaceResult">
|
||||
|
|
@ -49,6 +51,8 @@
|
|||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="subType != null">sub_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
|
|
@ -60,6 +64,8 @@
|
|||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="subType != null">#{subType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
|
|
|||
|
|
@ -196,6 +196,9 @@
|
|||
<if test="payStatus != null">
|
||||
AND om.pay_status = #{payStatus}
|
||||
</if>
|
||||
<if test="payStatusList != null">
|
||||
AND om.pay_status in ( #{payStatusList} )
|
||||
</if>
|
||||
<if test="workerId != null and workerId > 0">
|
||||
AND om.worker_id = #{workerId}
|
||||
</if>
|
||||
|
|
@ -208,6 +211,9 @@
|
|||
<if test="hasDispatchedAll != null">
|
||||
AND om.has_dispatched_all = #{hasDispatchedAll}
|
||||
</if>
|
||||
<if test="orderMasterIds != null and orderMasterIds != ''">
|
||||
AND om.id in (${orderMasterIds})
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue