订单统计及项目加盟,社区代理记录的相关接口
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())){
|
if(CacheUtils.get(customerPlace.getPhone()).toString().equals(customerPlace.getCode())){
|
||||||
int result = customerPlaceService.insertCustomerPlace(customerPlace);
|
int result = customerPlaceService.insertCustomerPlace(customerPlace);
|
||||||
Customer params = new Customer();
|
|
||||||
params.setCustomerId(customerPlace.getCustomerId());
|
int updateStatusResult = 1;
|
||||||
params.setPlaceStatus(PlaceStatus.PLACE_APPLYING.getCode());
|
if (customerPlace.getType().equals("distribution")) {
|
||||||
int updateStatusResult = customerService.updateCustomer(params);
|
Customer params = new Customer();
|
||||||
|
params.setCustomerId(customerPlace.getCustomerId());
|
||||||
|
params.setPlaceStatus(PlaceStatus.PLACE_APPLYING.getCode());
|
||||||
|
updateStatusResult = customerService.updateCustomer(params);
|
||||||
|
}
|
||||||
if(result > 0 && updateStatusResult > 0){
|
if(result > 0 && updateStatusResult > 0){
|
||||||
CacheUtils.remove(customerPlace.getPhone());
|
CacheUtils.remove(customerPlace.getPhone());
|
||||||
return AjaxResult.success("分销申请成功!");
|
return AjaxResult.success("申请成功!");
|
||||||
}else {
|
}else {
|
||||||
return AjaxResult.error("分销申请失败!");
|
return AjaxResult.error("申请失败!");
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
return AjaxResult.error("验证码错误!");
|
return AjaxResult.error("验证码错误!");
|
||||||
|
|
|
||||||
|
|
@ -229,6 +229,11 @@ public class OrderMasterController extends BaseController {
|
||||||
return voDataTable(orderListResponses, list);
|
return voDataTable(orderListResponses, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/app/count")
|
||||||
|
@ResponseBody
|
||||||
|
public AjaxResult countAppList(@RequestBody OrderMaster orderMaster) {
|
||||||
|
return AjaxResult.success(orderMasterService.countOrderMasterList(orderMaster));
|
||||||
|
}
|
||||||
|
|
||||||
@PostMapping("/after/list")
|
@PostMapping("/after/list")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
|
|
@ -374,6 +379,45 @@ public class OrderMasterController extends BaseController {
|
||||||
return voDataTable(orderListResponses, list);
|
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")
|
@PostMapping("/app/detail")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public AjaxResult appDetail(@RequestBody OrderMaster request) {
|
public AjaxResult appDetail(@RequestBody OrderMaster request) {
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,10 @@ public class CustomerPlace extends BaseEntity
|
||||||
|
|
||||||
public Integer status;
|
public Integer status;
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
private String subType;
|
||||||
|
|
||||||
public void setId(String id)
|
public void setId(String id)
|
||||||
{
|
{
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
|
@ -100,6 +104,22 @@ public class CustomerPlace extends BaseEntity
|
||||||
this.status = status;
|
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
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
@ -113,6 +133,8 @@ public class CustomerPlace extends BaseEntity
|
||||||
.append("updateBy", getUpdateBy())
|
.append("updateBy", getUpdateBy())
|
||||||
.append("updateTime", getUpdateTime())
|
.append("updateTime", getUpdateTime())
|
||||||
.append("remark", getRemark())
|
.append("remark", getRemark())
|
||||||
|
.append("type", getType())
|
||||||
|
.append("subType", getSubType())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,9 @@
|
||||||
<if test="customerId != null "> and customer_id = #{customerId}</if>
|
<if test="customerId != null "> and customer_id = #{customerId}</if>
|
||||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||||
<if test="city != null "> and city = #{city}</if>
|
<if test="city != null "> and city = #{city}</if>
|
||||||
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
||||||
</where>
|
</where>
|
||||||
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectCustomerPlaceById" parameterType="String" resultMap="CustomerPlaceResult">
|
<select id="selectCustomerPlaceById" parameterType="String" resultMap="CustomerPlaceResult">
|
||||||
|
|
@ -49,6 +51,8 @@
|
||||||
<if test="updateBy != null">update_by,</if>
|
<if test="updateBy != null">update_by,</if>
|
||||||
<if test="updateTime != null">update_time,</if>
|
<if test="updateTime != null">update_time,</if>
|
||||||
<if test="remark != null">remark,</if>
|
<if test="remark != null">remark,</if>
|
||||||
|
<if test="type != null">type,</if>
|
||||||
|
<if test="subType != null">sub_type,</if>
|
||||||
</trim>
|
</trim>
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
<if test="name != null">#{name},</if>
|
<if test="name != null">#{name},</if>
|
||||||
|
|
@ -60,6 +64,8 @@
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
<if test="remark != null">#{remark},</if>
|
<if test="remark != null">#{remark},</if>
|
||||||
|
<if test="type != null">#{type},</if>
|
||||||
|
<if test="subType != null">#{subType},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
|
|
@ -89,10 +95,10 @@
|
||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<update id="changeStatus">
|
<update id="changeStatus">
|
||||||
UPDATE customer_place set status = #{status}
|
UPDATE customer_place set status = #{status}
|
||||||
WHERE id in ( #{ids} )
|
WHERE id in ( #{ids} )
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,9 @@
|
||||||
<if test="payStatus != null">
|
<if test="payStatus != null">
|
||||||
AND om.pay_status = #{payStatus}
|
AND om.pay_status = #{payStatus}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="payStatusList != null">
|
||||||
|
AND om.pay_status in ( #{payStatusList} )
|
||||||
|
</if>
|
||||||
<if test="workerId != null and workerId > 0">
|
<if test="workerId != null and workerId > 0">
|
||||||
AND om.worker_id = #{workerId}
|
AND om.worker_id = #{workerId}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -208,6 +211,9 @@
|
||||||
<if test="hasDispatchedAll != null">
|
<if test="hasDispatchedAll != null">
|
||||||
AND om.has_dispatched_all = #{hasDispatchedAll}
|
AND om.has_dispatched_all = #{hasDispatchedAll}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="orderMasterIds != null and orderMasterIds != ''">
|
||||||
|
AND om.id in (${orderMasterIds})
|
||||||
|
</if>
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue