后台下单整体流程修复,各类统计问题修复
This commit is contained in:
parent
1df8410b99
commit
73f9cd14e6
|
|
@ -151,7 +151,7 @@ public class OrderController extends BaseController {
|
|||
|
||||
// 判断是否有客户
|
||||
SysUser sysUser = getSysUser();
|
||||
Long deptId = sysUser.getDept().getParentId();
|
||||
Long deptId = sysUser.getDept().getDeptId();
|
||||
String loginName = sysUser.getLoginName();
|
||||
Customer customer = customerService.selectByAccount("sys_" + loginName);
|
||||
if (customer == null) {
|
||||
|
|
@ -230,6 +230,10 @@ public class OrderController extends BaseController {
|
|||
orderMaster.setGoodsId(goods.getGoodsId());
|
||||
orderMaster.setPayType(0);
|
||||
orderMaster.setOrderMode(request.getOrderMode());
|
||||
// 存在登陆用户的情况下
|
||||
if(getSysUser() != null){
|
||||
orderMaster.setCreateBy(getSysUser().getUserId().toString());
|
||||
}
|
||||
// 服务时间
|
||||
String[] split = request.getServTime().split("-");
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ import com.ghy.common.annotation.Log;
|
|||
import com.ghy.common.constant.UserConstants;
|
||||
import com.ghy.common.core.controller.BaseController;
|
||||
import com.ghy.common.core.domain.AjaxResult;
|
||||
import com.ghy.common.core.domain.entity.SysUser;
|
||||
import com.ghy.common.core.page.PageDomain;
|
||||
import com.ghy.common.core.page.TableDataInfo;
|
||||
import com.ghy.common.core.page.TableSupport;
|
||||
|
|
@ -45,6 +46,7 @@ import com.ghy.worker.domain.WorkerCertification;
|
|||
import com.ghy.worker.service.IWorkerCertificationService;
|
||||
import com.ghy.worker.service.WorkerService;
|
||||
import com.huifu.adapay.core.exception.BaseAdaPayException;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -633,8 +635,13 @@ public class OrderMasterController extends BaseController {
|
|||
}
|
||||
|
||||
startPage();
|
||||
if (this.getSysUser().getDept().getParentId() != 101) {
|
||||
orderMaster.setDeptId(this.getSysUser().getDept().getParentId());
|
||||
// 非管理员
|
||||
if (this.getSysUser().getRoles().get(0).getRoleId() != 1) {
|
||||
orderMaster.setDeptId(this.getSysUser().getDeptId());
|
||||
}
|
||||
// PC师傅
|
||||
if (this.getSysUser().getRoles().get(0).getRoleId() == 101L) {
|
||||
orderMaster.setCreateBy(this.getSysUser().getUserId().toString());
|
||||
}
|
||||
List<OrderMaster> orderMasterList = orderMasterService.selectOrderMasterList(orderMaster);
|
||||
Set<Long> orderMasterIds = orderMasterList.stream().map(OrderMaster::getId).collect(Collectors.toSet());
|
||||
|
|
@ -674,9 +681,11 @@ public class OrderMasterController extends BaseController {
|
|||
// 地址信息
|
||||
CustomerAddress customerAddress = addressService.selectByCustomerAddressId(master.getAddressId());
|
||||
if (customerAddress != null) {
|
||||
SysArea sysArea = sysAreaService.selectById(customerAddress.getCountryId());
|
||||
String completeAddress = sysArea.getMergerName().replaceAll(",", "") + customerAddress.getAddress();
|
||||
master.setAddressName(customerAddress.getName());
|
||||
master.setAddressPhone(customerAddress.getPhone());
|
||||
master.setAddress(customerAddress.getAddress());
|
||||
master.setAddress(completeAddress);
|
||||
}
|
||||
}
|
||||
return getDataTable(orderMasterList);
|
||||
|
|
@ -910,12 +919,19 @@ public class OrderMasterController extends BaseController {
|
|||
@GetMapping("/differentStatus/count")
|
||||
@ResponseBody
|
||||
public AjaxResult differentStatusOrderCount(OrderMaster orderMaster) {
|
||||
SysUser user = this.getSysUser();
|
||||
if(user != null && user.getRoles().get(0).getRoleId() == 101L ){
|
||||
orderMaster.setCreateBy(this.getSysUser().getUserId().toString());
|
||||
}
|
||||
return AjaxResult.success(orderMasterService.differentStatusOrderCount(orderMaster));
|
||||
}
|
||||
|
||||
@GetMapping("/count")
|
||||
@ResponseBody
|
||||
public AjaxResult OrderMasterCount(OrderMaster orderMaster) {
|
||||
if(this.getSysUser() != null && this.getSysUser().getRoles().get(0).getRoleId() == 101L){
|
||||
orderMaster.setCreateBy(this.getSysUser().getUserId().toString());
|
||||
}
|
||||
return AjaxResult.success(orderMasterService.countOrderMasterList(orderMaster));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -188,6 +188,7 @@
|
|||
<script th:inline="javascript">
|
||||
var payTypes = [[${@dict.getType('pay_type')}]];
|
||||
var orderTypes = [[${@dict.getType('goods_category_type')}]];
|
||||
var orderModes = [[${@dict.getType('order_mode')}]];
|
||||
var payStatus = [[${@dict.getType('pay_status')}]];
|
||||
var orderStatus = [[${@dict.getType('order_status')}]];
|
||||
|
||||
|
|
@ -463,6 +464,13 @@
|
|||
field: 'changeMoney',
|
||||
title: '商家追加金额',
|
||||
align: 'center'
|
||||
},{
|
||||
field: 'orderMode',
|
||||
title: '下单模式',
|
||||
align: 'center',
|
||||
formatter: function (value, row, index) {
|
||||
return $.table.selectDictLabel(orderModes, value);
|
||||
}
|
||||
},{
|
||||
field: 'orderType',
|
||||
title: '订单类型',
|
||||
|
|
|
|||
|
|
@ -191,6 +191,9 @@
|
|||
<if test="expectTimeEnd != null">
|
||||
AND om.expect_time_end <= #{expectTimeEnd}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
AND om.create_by = #{createBy}
|
||||
</if>
|
||||
</where>
|
||||
order by om.create_time
|
||||
<trim suffixOverrides=",">
|
||||
|
|
@ -248,7 +251,7 @@
|
|||
</if>
|
||||
<if test="workerId == -1">
|
||||
AND om.worker_id IS NULL
|
||||
AND ( (om.order_mode in ('01','03','04'))
|
||||
AND ( (om.order_mode in ('01','02', '03','04'))
|
||||
OR (om.order_mode = '02' and fm.pay_status = 1) )
|
||||
</if>
|
||||
<if test="sysPayStatus != null">
|
||||
|
|
@ -275,6 +278,9 @@
|
|||
<if test="expectTimeEnd != null">
|
||||
AND om.expect_time_end <= #{expectTimeEnd}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
AND om.create_by = #{createBy}
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
@ -445,6 +451,9 @@
|
|||
<if test="isCall != null">
|
||||
AND om.is_call = #{isCall}
|
||||
</if>
|
||||
<if test="createBy != null and createBy != ''">
|
||||
AND om.create_by = #{createBy}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue