6 files modified
6 files added
| | |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.tools.DataAuthUtil; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.bean.ShoppingGoodsCategory; |
| | | import com.matrix.system.hive.bean.SysOrder; |
| | | import com.matrix.system.hive.bean.SysShopInfo; |
| | | import com.matrix.system.hive.dao.SysShopInfoDao; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.hive.pojo.ShoppingCarItem; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | if (order == null) { |
| | | throw new GlobleException("订单不存在"); |
| | | } |
| | | sysOrderService.cancelOrder(orderId); |
| | | |
| | | return AjaxResult.buildSuccessInstance("取消成功"); |
| | | |
| | | int i = sysOrderService.cancelOrder(orderId); |
| | | if (i > 0) { |
| | | return AjaxResult.buildSuccessInstance("取消成功"); |
| | | } |
| | | return AjaxResult.buildFailInstance("取消失败"); |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.common.bean; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 单据操作日志 |
| | | */ |
| | | @Data |
| | | @TableName("sys_operation_log") |
| | | @Builder |
| | | public class OperationLog { |
| | | |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | @TableId(value = "id",type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | /** |
| | | *公司id |
| | | */ |
| | | private Long companyId; |
| | | |
| | | /** |
| | | *门店id |
| | | */ |
| | | private Long shopId; |
| | | |
| | | /** |
| | | *操作用户id |
| | | */ |
| | | private Long opeUserId; |
| | | |
| | | /** |
| | | * 会员id |
| | | */ |
| | | private Long vipId; |
| | | |
| | | /** |
| | | * 操作功能 |
| | | */ |
| | | private Integer opeFunction; |
| | | |
| | | /** |
| | | * 单据按钮 |
| | | */ |
| | | private Integer opeBut; |
| | | |
| | | /** |
| | | * 单据id |
| | | */ |
| | | private Long billId; |
| | | |
| | | /** |
| | | * 单据号 |
| | | */ |
| | | private String billNo; |
| | | |
| | | /** |
| | | * 操作人ip |
| | | */ |
| | | private String ip; |
| | | |
| | | /** |
| | | * 操作备注 |
| | | */ |
| | | private String note; |
| | | |
| | | /** |
| | | * 操作时间 |
| | | */ |
| | | private String createTime; |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.common.dao; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.matrix.system.common.bean.OperationLog; |
| | | |
| | | /** |
| | | * @description 单据操作记录 |
| | | * @author jyy |
| | | * @date 2021-03-10 15:22 |
| | | */ |
| | | public interface OperationLogDao extends BaseMapper<OperationLog> { |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.common.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.matrix.system.common.bean.OperationLog; |
| | | import com.matrix.system.enums.OperationButtonEnum; |
| | | import com.matrix.system.enums.OperationFunctionEnum; |
| | | |
| | | /** |
| | | * 单据操作日志 |
| | | */ |
| | | public interface OperationLogService extends IService<OperationLog> { |
| | | |
| | | |
| | | |
| | | void saveOperation(Long companyId, Long shopId, Long userId, OperationFunctionEnum operationFunctionEnum, OperationButtonEnum operationButtonEnum, |
| | | Long billId, String billNo, Long vipId,String note); |
| | | |
| | | void saveOperation(Long companyId, Long shopId, Long userId, OperationFunctionEnum operationFunctionEnum, OperationButtonEnum operationButtonEnum, |
| | | Long billId, String billNo, Long vipId); |
| | | |
| | | void saveOperation(Long companyId, Long shopId, Long suId, OperationFunctionEnum operationFunctionEnum, OperationButtonEnum operationButtonEnum,String note); |
| | | } |
New file |
| | |
| | | package com.matrix.system.common.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.OperationLog; |
| | | import com.matrix.system.common.dao.OperationLogDao; |
| | | import com.matrix.system.common.service.OperationLogService; |
| | | import com.matrix.system.enums.OperationButtonEnum; |
| | | import com.matrix.system.enums.OperationFunctionEnum; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | | * 单据操作日志 |
| | | */ |
| | | @Service |
| | | public class OperationLogServiceImpl extends ServiceImpl<OperationLogDao, OperationLog> implements OperationLogService { |
| | | |
| | | @Override |
| | | public void saveOperation(Long companyId, Long shopId, Long userId, OperationFunctionEnum operationFunctionEnum, OperationButtonEnum operationButtonEnum, |
| | | Long billId, String billNo, Long vipId, String note) { |
| | | save(OperationLog.builder() |
| | | .companyId(companyId) |
| | | .shopId(shopId) |
| | | .opeUserId(userId) |
| | | .opeFunction(operationFunctionEnum.getValue()) |
| | | .opeBut(operationButtonEnum.getValue()) |
| | | .billId(billId) |
| | | .billNo(billNo) |
| | | .vipId(vipId) |
| | | .note(note) |
| | | .ip(WebUtil.getCustomerIp()).build()); |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void saveOperation(Long companyId, Long shopId, Long userId, OperationFunctionEnum operationFunctionEnum, OperationButtonEnum operationButtonEnum, |
| | | Long billId, String billNo, Long vipId) { |
| | | save(OperationLog.builder() |
| | | .companyId(companyId) |
| | | .shopId(shopId) |
| | | .opeUserId(userId) |
| | | .opeFunction(operationFunctionEnum.getValue()) |
| | | .opeBut(operationButtonEnum.getValue()) |
| | | .billId(billId) |
| | | .billNo(billNo) |
| | | .vipId(vipId) |
| | | .ip(WebUtil.getCustomerIp()).build()); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void saveOperation(Long companyId, Long shopId, Long userId, OperationFunctionEnum operationFunctionEnum, OperationButtonEnum operationButtonEnum |
| | | , String note) { |
| | | save(OperationLog.builder() |
| | | .companyId(companyId) |
| | | .shopId(shopId) |
| | | .opeUserId(userId) |
| | | .opeFunction(operationFunctionEnum.getValue()) |
| | | .opeBut(operationButtonEnum.getValue()) |
| | | .note(note) |
| | | .ip(WebUtil.getCustomerIp()).build()); |
| | | |
| | | } |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.enums; |
| | | |
| | | import com.google.common.collect.Lists; |
| | | import com.matrix.core.enums.EnumApiShowAble; |
| | | import com.matrix.core.enums.EnumsShowVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 操作按钮枚举 |
| | | * @author jyy |
| | | */ |
| | | public enum OperationButtonEnum implements EnumApiShowAble { |
| | | |
| | | CREATE(1, "新增"), |
| | | UPDATE(2, "修改"), |
| | | DELETE(3, "删除"), |
| | | CANCEL(4, "取消"), |
| | | INVALID(5, "设置为无效"), |
| | | EFFECTIVE(6, "设置为有效"), |
| | | ORDER_SK(7, "订单收款"), |
| | | ORDER_TK(8, "订单退款"), |
| | | ORDER_UPDATE_TIME(9, "更新订单时间"), |
| | | EXPORT(10, "导出"), |
| | | SERVICE_ORDER_BEGIN(11, "开始服务单"), |
| | | SERVICE_ORDER_END(12, "完成服务单"), |
| | | SERVICE_ORDER_PL(13, "服务单配料"), |
| | | SERVICE_ORDER_HK(14, "划扣"), |
| | | SERVICE_ORDER_PB(15, "排班"), |
| | | SERVICE_ORDER_QRYY(16, "确认预约"), |
| | | |
| | | ; |
| | | |
| | | private Integer value; |
| | | |
| | | private String displayName; |
| | | |
| | | OperationButtonEnum(Integer value, String displayName) { |
| | | this.value = value; |
| | | this.displayName = displayName; |
| | | } |
| | | |
| | | @Override |
| | | public String getEnumCode() { |
| | | return "operationButton"; |
| | | } |
| | | |
| | | @Override |
| | | public List<EnumsShowVo> getEnumsShowVos() { |
| | | return Lists.newArrayList(values()).stream().map(item -> |
| | | EnumsShowVo.builder() |
| | | .displayName(item.getDisplayName()) |
| | | .value(item.value) |
| | | .build() |
| | | ).collect(Collectors.toList()); |
| | | } |
| | | |
| | | public Integer getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public String getDisplayName() { |
| | | return displayName; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.enums; |
| | | |
| | | import com.google.common.collect.Lists; |
| | | import com.matrix.core.enums.EnumApiShowAble; |
| | | import com.matrix.core.enums.EnumsShowVo; |
| | | |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * 操作功能枚举 |
| | | * @author jyy |
| | | */ |
| | | public enum OperationFunctionEnum implements EnumApiShowAble { |
| | | |
| | | ORDER(1, "订单"), |
| | | SERVICE_ORDER(2, "服务单"), |
| | | VIP_PROJECT(3, "会员套餐卡项"), |
| | | VIP_CARD(4, "会员卡"); |
| | | |
| | | private Integer value; |
| | | |
| | | private String displayName; |
| | | |
| | | OperationFunctionEnum(Integer value, String displayName) { |
| | | this.value = value; |
| | | this.displayName = displayName; |
| | | } |
| | | |
| | | @Override |
| | | public String getEnumCode() { |
| | | return "operationFunction"; |
| | | } |
| | | |
| | | @Override |
| | | public List<EnumsShowVo> getEnumsShowVos() { |
| | | return Lists.newArrayList(values()).stream().map(item -> |
| | | EnumsShowVo.builder() |
| | | .displayName(item.getDisplayName()) |
| | | .value(item.value) |
| | | .build() |
| | | ).collect(Collectors.toList()); |
| | | } |
| | | |
| | | public Integer getValue() { |
| | | return value; |
| | | } |
| | | |
| | | public String getDisplayName() { |
| | | return displayName; |
| | | } |
| | | |
| | | } |
| | |
| | | package com.matrix.system.hive.action; |
| | | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.matrix.component.asyncmessage.AsyncMessageManager; |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysCompanyDao; |
| | | import com.matrix.system.common.service.OperationLogService; |
| | | import com.matrix.system.common.tools.DataAuthUtil; |
| | | import com.matrix.system.common.tools.ResponseHeadUtil; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.enums.OperationButtonEnum; |
| | | import com.matrix.system.enums.OperationFunctionEnum; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.dao.*; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | |
| | | import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; |
| | | import com.matrix.system.wechart.templateMsg.UniformMsgParam; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.ui.ModelMap; |
| | |
| | | @Autowired |
| | | private AsyncMessageManager asyncMessageManager; |
| | | |
| | | @Value("${evn}") |
| | | private String evn; |
| | | |
| | | @Autowired |
| | | private OperationLogService operationLogService; |
| | | |
| | | |
| | | /** |
| | | * 计算订单金额 |
| | |
| | | SysCompanyDao companyDao; |
| | | |
| | | /** |
| | | * 收款 |
| | | * 打印订单 |
| | | */ |
| | | @RequestMapping(value = "/printOrder") |
| | | public @ResponseBody |
| | |
| | | */ |
| | | @RequestMapping(value = "/updateOrderTime") |
| | | public @ResponseBody |
| | | @Transactional(rollbackFor = Exception.class) |
| | | AjaxResult updateOrderTime(SysOrder sysOrder) { |
| | | |
| | | sysOrderDao.updateOrderTime(sysOrder.getPayTime(), sysOrder.getId()); |
| | |
| | | //更新收款流水时间 |
| | | sysOrderFlowDao.updateTimeByOrderId(sysOrder.getId(), sysOrder.getPayTime()); |
| | | |
| | | //保存单据日志 |
| | | sysOrder= sysOrderDao.selectById(sysOrder.getId()); |
| | | operationLogService.saveOperation(sysOrder.getCompanyId(), sysOrder.getShopId(),getMe().getSuId(), |
| | | OperationFunctionEnum.ORDER, |
| | | OperationButtonEnum.ORDER_UPDATE_TIME, |
| | | sysOrder.getId(), |
| | | sysOrder.getOrderNo(), |
| | | sysOrder.getVipId(), |
| | | "更新参数: "+JSON.toJSONString(sysOrder)); |
| | | |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功"); |
| | | } |
| | |
| | | @RequestMapping(value = "/exportExcel") |
| | | public void report(ModelMap model, HttpServletRequest request, HttpServletResponse response, |
| | | SysOrder sysOrder) throws Exception { |
| | | SysUsers sysUsers = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | sysOrder.setShopId(sysUsers.getShopId()); |
| | | sysOrder.setShopId(getMe().getShopId()); |
| | | doExportOrder(response, sysOrder); |
| | | return; |
| | | |
| | |
| | | public void erpExportExcel(ModelMap model, HttpServletRequest request, HttpServletResponse response, |
| | | SysOrder sysOrder) throws Exception { |
| | | doExportOrder(response, sysOrder); |
| | | |
| | | return; |
| | | |
| | | } |
| | |
| | | * @throws IOException |
| | | */ |
| | | private void doExportOrder(HttpServletResponse response, SysOrder sysOrder) throws IOException { |
| | | |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(getMe().getCompanyId(), getMe().getShopId(),getMe().getSuId(), |
| | | OperationFunctionEnum.ORDER, |
| | | OperationButtonEnum.EXPORT, |
| | | String.format("导出参数:%s" , JSON.toJSONString(sysOrder))); |
| | | |
| | | List<ExcelSheetPO> res = new ArrayList<>(); |
| | | ExcelSheetPO orderSheet = new ExcelSheetPO(); |
| | | String title = "订单记录"; |
| | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.matrix.core.anotations.RemoveRequestToken; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | |
| | | import com.matrix.core.tools.excl.ExcelSheetPO; |
| | | import com.matrix.core.tools.excl.ExcelUtil; |
| | | import com.matrix.core.tools.excl.ExcelVersion; |
| | | import com.matrix.system.app.dto.IdSubmitDto; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysCompanyDao; |
| | | import com.matrix.system.common.service.OperationLogService; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.common.tools.DataAuthUtil; |
| | | import com.matrix.system.common.tools.ResponseHeadUtil; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.enums.OperationButtonEnum; |
| | | import com.matrix.system.enums.OperationFunctionEnum; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.dao.*; |
| | |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.ui.ModelMap; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | |
| | | |
| | | @Autowired |
| | | SysShopInfoDao shopInfoDao; |
| | | |
| | | @Autowired |
| | | private OperationLogService operationLogService; |
| | | |
| | | |
| | | /** |
| | | * 根据id查询服务单信息 |
| | |
| | | */ |
| | | @RequestMapping(value = "/updateOrderTime") |
| | | public @ResponseBody |
| | | @Transactional(rollbackFor = Exception.class) |
| | | AjaxResult updateOrderTime(@RequestBody ServiceOrderTimeDto serviceOrderTimeDto) { |
| | | sysProjServicesDao.updateOrderTime(serviceOrderTimeDto); |
| | | // 更新业绩时间 |
| | |
| | | achieveNew.setServiceOrderId(serviceOrderTimeDto.getId()); |
| | | achieveNew.setDatatime(serviceOrderTimeDto.getConsumeTime()); |
| | | achieveNewService.modifyAchieveTime(achieveNew); |
| | | SysProjServices projServices = sysProjServicesDao.selectById(serviceOrderTimeDto.getId()); |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(projServices.getCompanyId(), projServices.getShopId(),getMe().getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.ORDER_UPDATE_TIME, |
| | | projServices.getId(), |
| | | projServices.getServiceNo(), |
| | | projServices.getVipId(), |
| | | "更新参数: "+JSON.toJSONString(serviceOrderTimeDto)); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功"); |
| | | } |
| | | |
| | |
| | | return mv; |
| | | } |
| | | |
| | | /** |
| | | * 根据id对服务单进行派单 |
| | | */ |
| | | @RequestMapping(value = "/paidan") |
| | | public @ResponseBody |
| | | AjaxResult paidan(Long id) { |
| | | SysProjServices services = sysProjServicesService.findById(id); |
| | | int i = sysProjServicesService.modifyPDProjServices(services); |
| | | if (i > 0) { |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "派单成功"); |
| | | } else { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "派单失败"); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/addServiceProj") |
| | | @ResponseBody |
| | | public AjaxResult addServiceProj(SysProjServices sysProjServices) { |
| | | |
| | | return AjaxResult.buildSuccessInstance("保存成功"); |
| | | } |
| | | |
| | | /** |
| | | * 删除服务单项目/套餐 |
| | |
| | | |
| | | |
| | | private void doExportServiceOrder(HttpServletResponse response, SysProjServices projServices) throws IOException { |
| | | |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(getMe().getCompanyId(), getMe().getShopId(),getMe().getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.EXPORT, |
| | | String.format("导出参数:%s" , JSON.toJSONString(projServices))); |
| | | |
| | | |
| | | List<ExcelSheetPO> res = new ArrayList<>(); |
| | | ExcelSheetPO orderSheet = new ExcelSheetPO(); |
| | | String title = "服务订单明细"; |
| | |
| | | */ |
| | | public int remove(List<Long> list); |
| | | |
| | | public int cancelOrder(Long id); |
| | | public void cancelOrder(Long id); |
| | | /** |
| | | * 根据id删除SysOrder |
| | | * |
| | |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.common.service.OperationLogService; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.enums.OperationButtonEnum; |
| | | import com.matrix.system.enums.OperationFunctionEnum; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.dao.*; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | |
| | | @Autowired |
| | | private AsyncMessageManager asyncMessageManager; |
| | | |
| | | @Autowired |
| | | private OperationLogService operationLogService; |
| | | |
| | | |
| | | @Override |
| | | public int add(SysOrder sysOrder) { |
| | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public SysOrder checkAndSaveOrder(SysOrder sysOrder) { |
| | | |
| | | // 计算订单折扣金额,收款情况下 计算订单总额 |
| | |
| | | //新增订单 |
| | | sysOrder.setOrderNo(codeService.getOrderCode()); |
| | | sysOrderDao.insert(sysOrder); |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(sysOrder.getCompanyId(), sysOrder.getShopId(), user.getSuId(), |
| | | OperationFunctionEnum.ORDER, |
| | | OperationButtonEnum.CREATE, |
| | | sysOrder.getId(), |
| | | sysOrder.getOrderNo(), |
| | | sysOrder.getVipId()); |
| | | |
| | | } else { |
| | | //更新订单 |
| | | sysOrderDao.update(sysOrder); |
| | | //删除原有订单明细 |
| | | orderItemDao.deleteByOrderId(sysOrder.getId()); |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(sysOrder.getCompanyId(), sysOrder.getShopId(), user.getSuId(), |
| | | OperationFunctionEnum.ORDER, |
| | | OperationButtonEnum.UPDATE, |
| | | sysOrder.getId(), |
| | | sysOrder.getOrderNo(), |
| | | sysOrder.getVipId(), |
| | | "修改订单内容"); |
| | | } |
| | | |
| | | sysOrder.getItems().forEach(sysOrderItem -> { |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int cancelOrder(Long id) { |
| | | public void cancelOrder(Long id) { |
| | | |
| | | SysOrder order = sysOrderDao.selectById(id); |
| | | SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | if (order.getStatu().equals(Dictionary.ORDER_STATU_DFK)) { |
| | | |
| | | order.setStatu(Dictionary.ORDER_STATU_YQX); |
| | |
| | | //发送微信公众号提醒 |
| | | UniformMsgParam uniformMsgParam = new UniformMsgParam(order.getCompanyId(), UniformMsgParam.GZH_DDQX); |
| | | uniformMsgParam.put("orderId", order.getId()); |
| | | asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG ,uniformMsgParam); |
| | | asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG, uniformMsgParam); |
| | | |
| | | return sysOrderDao.update(order); |
| | | |
| | | sysOrderDao.update(order); |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(order.getCompanyId(), order.getShopId(),sysUsers.getSuId(), |
| | | OperationFunctionEnum.ORDER, |
| | | OperationButtonEnum.CANCEL, |
| | | order.getId(), |
| | | order.getOrderNo(), |
| | | order.getVipId(), |
| | | "未付款取消订单"); |
| | | } else { |
| | | |
| | | //一个订单只能被取消一次 |
| | |
| | | |
| | | // 取消订单 |
| | | order.setStatu(Dictionary.ORDER_STATU_YQX); |
| | | return sysOrderDao.update(order); |
| | | sysOrderDao.update(order); |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(order.getCompanyId(), order.getShopId(),sysUsers.getSuId(), |
| | | OperationFunctionEnum.ORDER, |
| | | OperationButtonEnum.CANCEL, |
| | | order.getId(), |
| | | order.getOrderNo(), |
| | | order.getVipId(), |
| | | "已付款取消订单"); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | //设置会员积分 |
| | | addVipScore(pageOrder); |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 付款后更新订单信息 |
| | | * |
| | | * @param pageOrder |
| | | */ |
| | | private void updateOrderInfo(SysOrder pageOrder) { |
| | |
| | | |
| | | double sum = flows.stream().mapToDouble(item -> item.getAmount().doubleValue()).sum(); |
| | | |
| | | if(sum>0 && cardPayAmount.doubleValue()==0 && cashPayAmount.doubleValue()==0 ){ |
| | | if (sum > 0 && cardPayAmount.doubleValue() == 0 && cashPayAmount.doubleValue() == 0) { |
| | | throw new GlobleException("订单更新失败,支付金额计算错误,请联系管理员"); |
| | | } |
| | | |
| | | |
| | | sysOrderDao.update(pageOrder); |
| | | |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(pageOrder.getCompanyId(), pageOrder.getShopId(), user.getSuId(), |
| | | OperationFunctionEnum.ORDER, |
| | | OperationButtonEnum.ORDER_SK, |
| | | pageOrder.getId(), |
| | | pageOrder.getOrderNo(), |
| | | pageOrder.getVipId()); |
| | | } |
| | | |
| | | private void checkOrder(SysOrder pageOrder) { |
| | |
| | | entries.forEach(entrie -> { |
| | | double sum = entrie.getValue().stream().mapToDouble(AchieveNew::getGoodsCash).sum(); |
| | | //todo 目前使用js计算金额可能存在精度的误差展示用0.1屏蔽 |
| | | if (Math.abs(sum- (item.getZkPrice()*item.getCount()) )>0.1) { |
| | | if (Math.abs(sum - (item.getZkPrice() * item.getCount())) > 0.1) { |
| | | ShoppingGoods shopGoods = shoppingGoodsDao.selectById(item.getGoodsId()); |
| | | throw GlobleException.instance(shopGoods.getName() + "," + entrie.getKey() + "业绩金额与收款金额不一致"); |
| | | } |
| | |
| | | boolean zsConsumeAchieve = projServicesService.skipServiceOrderStep(Dictionary.ZS_CONSUME_ACHIEVE); |
| | | if (zsConsumeAchieve) { |
| | | //赠送情况下,如果收款金额大于0,就是赠送金额划扣的情况,金额即为划扣的折扣金额 |
| | | if(sysOrderItem.getZkPrice()>0){ |
| | | if (sysOrderItem.getZkPrice() > 0) { |
| | | puse.setPrice(sysOrderItem.getZkPrice()); |
| | | }else{ |
| | | } else { |
| | | puse.setPrice(sysOrderItem.getShoppingGoods().getSealPice()); |
| | | } |
| | | } else { |
| | |
| | | // 设置业绩 |
| | | achieveNewService.addAchaeveByOrder(sysOrder); |
| | | |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(sysOrder.getCompanyId(), sysOrder.getShopId(), user.getSuId(), |
| | | OperationFunctionEnum.ORDER, |
| | | OperationButtonEnum.ORDER_TK, |
| | | sysOrder.getId(), |
| | | sysOrder.getOrderNo(), |
| | | sysOrder.getVipId()); |
| | | |
| | | } |
| | | |
| | | private void addRefundOrderFlow(SysOrder sourceOrder) { |
| | |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.common.service.BusParameterSettingService; |
| | | import com.matrix.system.common.service.OperationLogService; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.enums.OperationButtonEnum; |
| | | import com.matrix.system.enums.OperationFunctionEnum; |
| | | import com.matrix.system.hive.bean.*; |
| | | import com.matrix.system.hive.dao.*; |
| | | import com.matrix.system.hive.plugin.util.MoneyUtil; |
| | |
| | | @Autowired |
| | | private SysProjUseDao sysProjUseDao; |
| | | |
| | | |
| | | @Autowired |
| | | private OperationLogService operationLogService; |
| | | @Autowired |
| | | private SysOutStoreDao sysOutStoreDao; |
| | | |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | @Override |
| | | public SysProjServices addSysProjServices(SysProjServices sysProjServices) throws GlobleException { |
| | | |
| | | SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | //创建服务单 |
| | | if (WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY) != null) { |
| | | SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | sysProjServices.setCreateStaffId(user.getSuId()); |
| | | sysProjServices.setShopId(user.getShopId()); |
| | | sysProjServices.setCompanyId(user.getCompanyId()); |
| | |
| | | sysProjServices.setTotalTime(totalTime); |
| | | sysProjServices.setMoney(new BigDecimal(hkPrice).setScale(2, BigDecimal.ROUND_HALF_DOWN).doubleValue()); |
| | | sysProjServicesDao.update(sysProjServices); |
| | | |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(sysProjServices.getCompanyId(), sysProjServices.getShopId(),user.getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.CREATE, |
| | | sysProjServices.getId(), |
| | | sysProjServices.getServiceNo(), |
| | | sysProjServices.getVipId()); |
| | | |
| | | return sysProjServices; |
| | | } |
| | | |
| | |
| | | autoBatching(projServices); |
| | | } |
| | | |
| | | SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(checkProjServices.getCompanyId(), checkProjServices.getShopId(),users.getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.SERVICE_ORDER_PB, |
| | | checkProjServices.getId(), |
| | | checkProjServices.getServiceNo(), |
| | | checkProjServices.getVipId()); |
| | | |
| | | return i; |
| | | } |
| | |
| | | } |
| | | //删除积分 |
| | | scoreVipDetailService.removeByBusinessId(checkProjServices.getVipId(), checkProjServices.getId()); |
| | | |
| | | SysUsers users = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(checkProjServices.getCompanyId(), checkProjServices.getShopId(),users.getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.CANCEL, |
| | | checkProjServices.getId(), |
| | | checkProjServices.getServiceNo(), |
| | | checkProjServices.getVipId()); |
| | | |
| | | |
| | | //更新服务单状态 |
| | | return sysProjServicesDao.update(checkProjServices); |
| | |
| | | asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG, uniformMsgParam); |
| | | //发送划扣短信提醒 |
| | | taiYanAliyunSmsService.sendHkNotice(projServices); |
| | | |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(projServices.getCompanyId(), projServices.getShopId(),users.getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.SERVICE_ORDER_HK, |
| | | projServices.getId(), |
| | | projServices.getServiceNo(), |
| | | projServices.getVipId()); |
| | | |
| | | return result; |
| | | } |
| | |
| | | // // 判断是服务超时还是服务提前结束,如果minspace大于0则是超时服务,小于0则是提前结束服务 |
| | | // projServices.setIsOverTime(minspace + ""); |
| | | // projServices.setState(Dictionary.SERVICE_STATU_FWWC); |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(projServices.getCompanyId(), projServices.getShopId(),sysUsers.getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.SERVICE_ORDER_PL, |
| | | projServices.getId(), |
| | | projServices.getServiceNo(), |
| | | projServices.getVipId()); |
| | | |
| | | |
| | | return sysProjServicesDao.update(projServices); |
| | | } |
| | | |
| | |
| | | // 设置美疗师实际开始时间 |
| | | checkBeauticianState.setState(Dictionary.BEATUI_STATE_SYZ); |
| | | projServices.getVipId(); |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(projServices.getCompanyId(), projServices.getShopId(),users.getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.SERVICE_ORDER_BEGIN, |
| | | projServices.getId(), |
| | | projServices.getServiceNo(), |
| | | projServices.getVipId()); |
| | | |
| | | return beauticianStateDao.update(checkBeauticianState); |
| | | } |
| | | |
| | |
| | | checkprojServices.setState(Dictionary.SERVICE_STATU_FWWC); |
| | | sysProjServicesDao.update(checkprojServices); |
| | | } |
| | | |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(projServices.getCompanyId(), projServices.getShopId(),users.getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.SERVICE_ORDER_END, |
| | | projServices.getId(), |
| | | projServices.getServiceNo(), |
| | | projServices.getVipId()); |
| | | return rerunlt; |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public int confirmServiceOrder(Long id) { |
| | | SysUsers users = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | SysProjServices services = new SysProjServices(); |
| | | services.setId(id); |
| | | services.setState(Dictionary.BEATUI_STATE_DYY); |
| | | int i = modify(services); |
| | | SysProjServices projServices =findById(id); |
| | | //保存单据日志 |
| | | operationLogService.saveOperation(projServices.getCompanyId(), projServices.getShopId(),users.getSuId(), |
| | | OperationFunctionEnum.SERVICE_ORDER, |
| | | OperationButtonEnum.SERVICE_ORDER_QRYY, |
| | | projServices.getId(), |
| | | projServices.getServiceNo(), |
| | | projServices.getVipId()); |
| | | |
| | | if (i > 0) { |
| | | //发送微信公众号提醒 |
| | | services = findById(services.getId()); |