后台下单整体流程修复,各类统计问题修复

This commit is contained in:
kuang.yife 2023-10-01 01:37:28 +08:00
parent 1df8410b99
commit 73f9cd14e6
4 changed files with 42 additions and 5 deletions

View File

@ -151,7 +151,7 @@ public class OrderController extends BaseController {
// 判断是否有客户 // 判断是否有客户
SysUser sysUser = getSysUser(); SysUser sysUser = getSysUser();
Long deptId = sysUser.getDept().getParentId(); Long deptId = sysUser.getDept().getDeptId();
String loginName = sysUser.getLoginName(); String loginName = sysUser.getLoginName();
Customer customer = customerService.selectByAccount("sys_" + loginName); Customer customer = customerService.selectByAccount("sys_" + loginName);
if (customer == null) { if (customer == null) {
@ -230,6 +230,10 @@ public class OrderController extends BaseController {
orderMaster.setGoodsId(goods.getGoodsId()); orderMaster.setGoodsId(goods.getGoodsId());
orderMaster.setPayType(0); orderMaster.setPayType(0);
orderMaster.setOrderMode(request.getOrderMode()); orderMaster.setOrderMode(request.getOrderMode());
// 存在登陆用户的情况下
if(getSysUser() != null){
orderMaster.setCreateBy(getSysUser().getUserId().toString());
}
// 服务时间 // 服务时间
String[] split = request.getServTime().split("-"); String[] split = request.getServTime().split("-");
try { try {

View File

@ -4,6 +4,7 @@ import com.ghy.common.annotation.Log;
import com.ghy.common.constant.UserConstants; import com.ghy.common.constant.UserConstants;
import com.ghy.common.core.controller.BaseController; import com.ghy.common.core.controller.BaseController;
import com.ghy.common.core.domain.AjaxResult; 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.PageDomain;
import com.ghy.common.core.page.TableDataInfo; import com.ghy.common.core.page.TableDataInfo;
import com.ghy.common.core.page.TableSupport; 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.IWorkerCertificationService;
import com.ghy.worker.service.WorkerService; import com.ghy.worker.service.WorkerService;
import com.huifu.adapay.core.exception.BaseAdaPayException; import com.huifu.adapay.core.exception.BaseAdaPayException;
import org.apache.commons.collections.CollectionUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -633,8 +635,13 @@ public class OrderMasterController extends BaseController {
} }
startPage(); 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); List<OrderMaster> orderMasterList = orderMasterService.selectOrderMasterList(orderMaster);
Set<Long> orderMasterIds = orderMasterList.stream().map(OrderMaster::getId).collect(Collectors.toSet()); 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()); CustomerAddress customerAddress = addressService.selectByCustomerAddressId(master.getAddressId());
if (customerAddress != null) { if (customerAddress != null) {
SysArea sysArea = sysAreaService.selectById(customerAddress.getCountryId());
String completeAddress = sysArea.getMergerName().replaceAll(",", "") + customerAddress.getAddress();
master.setAddressName(customerAddress.getName()); master.setAddressName(customerAddress.getName());
master.setAddressPhone(customerAddress.getPhone()); master.setAddressPhone(customerAddress.getPhone());
master.setAddress(customerAddress.getAddress()); master.setAddress(completeAddress);
} }
} }
return getDataTable(orderMasterList); return getDataTable(orderMasterList);
@ -910,12 +919,19 @@ public class OrderMasterController extends BaseController {
@GetMapping("/differentStatus/count") @GetMapping("/differentStatus/count")
@ResponseBody @ResponseBody
public AjaxResult differentStatusOrderCount(OrderMaster orderMaster) { 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)); return AjaxResult.success(orderMasterService.differentStatusOrderCount(orderMaster));
} }
@GetMapping("/count") @GetMapping("/count")
@ResponseBody @ResponseBody
public AjaxResult OrderMasterCount(OrderMaster orderMaster) { 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)); return AjaxResult.success(orderMasterService.countOrderMasterList(orderMaster));
} }
} }

View File

@ -188,6 +188,7 @@
<script th:inline="javascript"> <script th:inline="javascript">
var payTypes = [[${@dict.getType('pay_type')}]]; var payTypes = [[${@dict.getType('pay_type')}]];
var orderTypes = [[${@dict.getType('goods_category_type')}]]; var orderTypes = [[${@dict.getType('goods_category_type')}]];
var orderModes = [[${@dict.getType('order_mode')}]];
var payStatus = [[${@dict.getType('pay_status')}]]; var payStatus = [[${@dict.getType('pay_status')}]];
var orderStatus = [[${@dict.getType('order_status')}]]; var orderStatus = [[${@dict.getType('order_status')}]];
@ -463,6 +464,13 @@
field: 'changeMoney', field: 'changeMoney',
title: '商家追加金额', title: '商家追加金额',
align: 'center' align: 'center'
},{
field: 'orderMode',
title: '下单模式',
align: 'center',
formatter: function (value, row, index) {
return $.table.selectDictLabel(orderModes, value);
}
},{ },{
field: 'orderType', field: 'orderType',
title: '订单类型', title: '订单类型',

View File

@ -191,6 +191,9 @@
<if test="expectTimeEnd != null"> <if test="expectTimeEnd != null">
AND om.expect_time_end &lt;= #{expectTimeEnd} AND om.expect_time_end &lt;= #{expectTimeEnd}
</if> </if>
<if test="createBy != null and createBy != ''">
AND om.create_by = #{createBy}
</if>
</where> </where>
order by om.create_time order by om.create_time
<trim suffixOverrides=","> <trim suffixOverrides=",">
@ -248,7 +251,7 @@
</if> </if>
<if test="workerId == -1"> <if test="workerId == -1">
AND om.worker_id IS NULL 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) ) OR (om.order_mode = '02' and fm.pay_status = 1) )
</if> </if>
<if test="sysPayStatus != null"> <if test="sysPayStatus != null">
@ -275,6 +278,9 @@
<if test="expectTimeEnd != null"> <if test="expectTimeEnd != null">
AND om.expect_time_end &lt;= #{expectTimeEnd} AND om.expect_time_end &lt;= #{expectTimeEnd}
</if> </if>
<if test="createBy != null and createBy != ''">
AND om.create_by = #{createBy}
</if>
</where> </where>
</select> </select>
@ -445,6 +451,9 @@
<if test="isCall != null"> <if test="isCall != null">
AND om.is_call = #{isCall} AND om.is_call = #{isCall}
</if> </if>
<if test="createBy != null and createBy != ''">
AND om.create_by = #{createBy}
</if>
</select> </select>
</mapper> </mapper>