zq-erp/src/main/java/com/matrix/system/common/dao/SysRolePwoerFnDao.java
@@ -41,4 +41,5 @@ public SysRolePwoerFn selectForUpdate(Long rpfId); int deleteByFns(@Param("companyId") Long comId, @Param("list") List<String> deletedFn); } zq-erp/src/main/java/com/matrix/system/common/service/impl/SysCompanyServiceImpl.java
@@ -1,28 +1,39 @@ package com.matrix.system.common.service.impl; import cn.hutool.crypto.SecureUtil; import cn.hutool.json.JSONUtil; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.constance.SystemErrorCode; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.LogUtil; import com.matrix.core.tools.ModelUtils; import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.WebUtil; import com.matrix.system.common.bean.*; import com.matrix.system.app.authority.AppAuthorityManager; import com.matrix.system.common.authority.DefaultAuthorityManager; import com.matrix.system.common.bean.SysCompany; import com.matrix.system.common.bean.SysRole; import com.matrix.system.common.bean.SysRolePwoerFn; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.constance.AppConstance; import com.matrix.system.common.dao.SysCompanyDao; import com.matrix.system.common.dao.SysRoleDao; import com.matrix.system.common.dao.SysRolePwoerFnDao; import com.matrix.system.common.init.LocalCache; import com.matrix.system.common.service.SysCompanyService; import com.matrix.system.common.service.SysUsersService; import com.matrix.system.hive.bean.SysShopInfo; import com.matrix.system.hive.bean.Warehouse; import com.matrix.system.hive.dao.SysShopInfoDao; import com.matrix.system.hive.dao.WarehouseDao; import com.matrix.system.hive.plugin.util.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.*; import java.util.stream.Collectors; /** * 公司管理 @@ -89,8 +100,10 @@ @Autowired private WarehouseDao warehouseDao; /** * 为新公司创建一个总部 * * @param sysCompany */ private SysShopInfo addZbShop(SysCompany sysCompany) { @@ -141,10 +154,10 @@ /** * 更新公司员工权限 * * @param newSysCompany * @author JIANGYOUYAO * @email 935090232@qq.com * @date 2017年12月5日 * @param newSysCompany */ private void updatePower(SysCompany newSysCompany) { List<String> oldFunctions = null; @@ -160,7 +173,39 @@ newFunctions = StringUtils.strToCollToString(newSysCompany.getComFunctions(), ","); } for (String old : oldFunctions) { Collections.sort(newFunctions); Collections.sort(oldFunctions); if (Objects.equals(JSONUtil.toJsonStr(newFunctions), JSONUtil.toJsonStr(oldFunctions))) { //没有更新的权限 return; } List<String> finalNewFunctions = newFunctions; List<String> deletedFn = oldFunctions.stream().map(old -> { if (finalNewFunctions.stream().noneMatch(newFn -> Objects.equals(newFn, old))) { return old; } else { return ""; } }).filter(item->StringUtils.isNotBlank(item)).collect(Collectors.toList()); if(CollectionUtils.isNotEmpty(deletedFn)){ rolePwoerFnDao.deleteByFns(newSysCompany.getComId(),deletedFn); //有更新权限清空缓存 SysUsers sysUsers = new SysUsers(); sysUsers.setCompanyId(newSysCompany.getComId()); sysUsers.setSuValid(AppConstance.RECORD_VALID); List<SysUsers> users = sysUsersService.findByModel(sysUsers); users.forEach(user -> { String userKey = SecureUtil.md5(user.getSuId() + ""); LocalCache.remove(DefaultAuthorityManager.USER_POWER_REDISKEY_PC + userKey); LocalCache.remove(AppAuthorityManager.USER_POWER_REDISKEY_APP + userKey); }); } /* for (String old : oldFunctions) { // 如果新权限中不包含这个老的功能,则要更新改企业下所有的角色权限 if (!newFunctions.contains(old)) { SysRole role = new SysRole(); @@ -186,8 +231,14 @@ rolePwoerFnDao.deleteByIds(delRolePwoer); } } }*/ } } @Autowired SysUsersService sysUsersService; @Override public int modifyByModel(SysCompany sysCompany) { @@ -244,7 +295,6 @@ return sysCompanyDao.selectById(Long.parseLong(comId)); } } zq-erp/src/main/java/com/matrix/system/hive/action/OrderController.java
@@ -239,7 +239,7 @@ public @ResponseBody ModelAndView printOrder(SysOrder order) throws GlobleException { ModelAndView mv = new ModelAndView("admin/hive/beautySalon/print-order"); SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); SysUsers user = getMe(); String comRegisterCode = companyDao.selectById(user.getCompanyId()).getComRegisterCode(); if (StringUtils.isNotBlank(comRegisterCode)) { mv.addObject("page", comRegisterCode); zq-erp/src/main/java/com/matrix/system/hive/action/ProjServiceController.java
@@ -1,5 +1,6 @@ package com.matrix.system.hive.action; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.util.StrUtil; import com.matrix.core.anotations.RemoveRequestToken; @@ -26,17 +27,16 @@ import com.matrix.system.constance.Dictionary; import com.matrix.system.hive.bean.*; import com.matrix.system.hive.dao.*; import com.matrix.system.hive.dto.ServiceOrderTimeDto; import com.matrix.system.hive.service.*; import com.matrix.system.hive.vo.ServiceOrderInfoVo; import io.swagger.annotations.ApiOperation; import org.apache.commons.collections.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.ModelAndView; import javax.annotation.Resource; @@ -143,6 +143,20 @@ result.setStatus(AjaxResult.STATUS_SUCCESS); return result; } /** * 根据id查询服务单简单信息 */ @RequestMapping(value = "/findServiceOrderInfoVo/{id}") public @ResponseBody AjaxResult findServiceOrderInfoVo(@PathVariable Long id) { // 获取服务单信息 SysProjServices projServices = sysProjServicesService.findById(id); ServiceOrderInfoVo serviceOrderInfoVo= BeanUtil.copyProperties(projServices,ServiceOrderInfoVo.class); return AjaxResult.buildSuccessInstance(serviceOrderInfoVo); } @@ -429,13 +443,12 @@ */ @RequestMapping(value = "/updateOrderTime") public @ResponseBody AjaxResult updateOrderTime(SysProjServices serviceQuery) { SysProjServices services = sysProjServicesDao.selectById(serviceQuery.getId()); sysProjServicesDao.updateOrderTime(serviceQuery.getConsumeTime(), serviceQuery.getId()); AjaxResult updateOrderTime(@RequestBody ServiceOrderTimeDto serviceOrderTimeDto) { sysProjServicesDao.updateOrderTime(serviceOrderTimeDto); // 更新业绩时间 AchieveNew achieveNew = new AchieveNew(); achieveNew.setServiceOrderId(serviceQuery.getId()); achieveNew.setDatatime(serviceQuery.getConsumeTime()); achieveNew.setServiceOrderId(serviceOrderTimeDto.getId()); achieveNew.setDatatime(serviceOrderTimeDto.getConsumeTime()); achieveNewService.modifyAchieveTime(achieveNew); return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功"); } zq-erp/src/main/java/com/matrix/system/hive/dao/SysProjServicesDao.java
@@ -4,6 +4,7 @@ import com.matrix.system.app.dto.ServiceOrderListDto; import com.matrix.system.app.vo.ServiceOrderListVo; import com.matrix.system.hive.bean.SysProjServices; import com.matrix.system.hive.dto.ServiceOrderTimeDto; import com.matrix.system.shopXcx.api.dto.ErpServiceOrderListDto; import com.matrix.system.shopXcx.api.vo.ErpServiceOrderListVo; import org.apache.ibatis.annotations.Param; @@ -36,7 +37,7 @@ public SysProjServices selectById(Long id); public void updateOrderTime(@Param("consumeTime") Date createTime, @Param("id") Long id); public void updateOrderTime(@Param("serviceOrderTimeDto") ServiceOrderTimeDto serviceOrderTimeDto); List<ServiceOrderListVo> selectApiServiceOrderListInPage(@Param("record") ServiceOrderListDto serviceOrderListDto, @Param("pageVo") PaginationVO pageVo); zq-erp/src/main/java/com/matrix/system/hive/dto/ServiceOrderTimeDto.java
New file @@ -0,0 +1,34 @@ package com.matrix.system.hive.dto; import com.fasterxml.jackson.annotation.JsonFormat; import com.matrix.core.tools.DateUtil; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; @Data public class ServiceOrderTimeDto { /** * 服务单id */ private Long id; /** * 预约时间 */ @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_MM) private Date yyTime; /** * 订单创建时间 */ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") private Date createTime; /** * 订单划扣时间 */ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") private Date consumeTime; } zq-erp/src/main/java/com/matrix/system/hive/vo/ServiceOrderInfoVo.java
New file @@ -0,0 +1,69 @@ package com.matrix.system.hive.vo; import com.fasterxml.jackson.annotation.JsonFormat; import com.matrix.core.tools.DateUtil; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; /** * 简单服务单信息展示对象不含明细 */ @Data public class ServiceOrderInfoVo { /** * id */ private Long id; /** * 编号 */ private String serviceNo; /** * 服务单金额 */ private Double money; /** * 预约时间 */ @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_MM) private Date yyTime; /** * 订单创建时间 */ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") private Date createTime; /** * 订单划扣时间 */ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm") private Date consumeTime; /** * 开始时间 */ @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_MM) private Date startTime; /** * 结束时间 */ @DateTimeFormat(pattern = DateUtil.DATE_FORMAT_MM) private Date endTime; /** * 超时时间 */ private String isOverTime; /** * 服务状态 0.待预约 1.预约失败,2预约成功待处理,3需配料,4配料中,5配料完成,6,服务中,7服务完成 */ private String state; } zq-erp/src/main/resources/mybatis/mapper/common/SysRolePwoerFnDao.xml
@@ -150,7 +150,18 @@ </if> </where> </delete> <delete id="deleteByFns"> DELETE a FROM sys_role_pwoer_fn a , sys_role b WHERE a.role_id = b.role_id and b.company_id=#{companyId} and a.fn_id in <foreach collection="list" index="index" item="item" open="(" separator="," close=")"> #{item} </foreach> </delete> <!-- 分页查询 --> zq-erp/src/main/resources/mybatis/mapper/hive/SysProjServicesDao.xml
@@ -140,7 +140,11 @@ <!-- 根据id更新 部分更新 --> <update id="updateOrderTime"> UPDATE sys_proj_services set consume_time=#{consumeTime} WHERE id=#{id} UPDATE sys_proj_services set consume_time=#{serviceOrderTimeDto.consumeTime}, yy_time=#{serviceOrderTimeDto.yyTime}, create_time=#{serviceOrderTimeDto.createTime} WHERE id=#{serviceOrderTimeDto.id} </update> <!-- 设置服务单为已通知 --> zq-erp/src/main/resources/static/js/systools/AjaxProxyVue.js
@@ -121,6 +121,10 @@ var MTools = { closeIframe: function () { parent.layer.close(parent.layer.getFrameIndex(window.name)); }, /** 返回一个随机字符串 */ uuid : function() { zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/service_all_list.html
@@ -218,7 +218,7 @@ title: "修改订单时间", maxmin: true, area: [MUI.SIZE_L, '500px'], content: [basePath + '/admin/projService/toServiceOrderUpdateTime?id=' + id] content: [basePath + '/admin/redirect/hive/beautySalon/updateServiceOrderTimeV2?id=' +id] }); } zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateServiceOrderTime.html
@@ -1,9 +1,4 @@ <!DOCTYPE HTML> <!DOCTYPE HTML> <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/updateServiceOrderTimeV2.html
New file @@ -0,0 +1,126 @@ <!DOCTYPE HTML> <html xmlns:th="http://www.thymeleaf.org" xmlns:matrix="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8"> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <meta name="renderer" content="webkit|ie-comp|ie-stand"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/> <meta http-equiv="Cache-Control" content="no-siteapp"/> <!-- 本框架基本脚本和样式 --> <script type="text/javascript" th:src="@{/js/systools/MBaseVue.js}"></script> <link rel="stylesheet" th:href="@{/plugin/element-ui/index.css}"> <link th:href="@{/css/styleOne/style.min.css}" rel="stylesheet" type="text/css"/> </head> <body> <div class="ibox-content" id="app" v-cloak > <el-form :model="serviceOrder" ref="form" label-width="100px" class="demo-form"> <el-form-item label="创建时间"> <el-date-picker v-model="serviceOrder.createTime" type="datetime"></el-date-picker> </el-form-item> <el-form-item label="预约时间"> <el-date-picker v-model="serviceOrder.yyTime" type="datetime"></el-date-picker> </el-form-item> <el-form-item label="划扣时间"> <el-date-picker v-model="serviceOrder.consumeTime" type="datetime" ></el-date-picker> <span>修改划扣时间才会同步修改服务单业绩</span> </el-form-item> <el-form-item> <el-button type="primary" @click="submitForm('form')" >保存</el-button> <el-button @click="closeFram()">关闭</el-button> </el-form-item> </el-form> </div> </body> <script type="text/javascript" th:src="@{/js/plugin/jquery-2.1.4.min.js}"></script> <script type="text/javascript" th:src="@{/js/plugin/jquery.query.js}"></script> <script type="text/javascript" th:src="@{/js/systools/AjaxProxyVue.js}"></script> <script type="text/javascript" th:src="@{/js/plugin/vue.js}"></script> <script type="text/javascript" th:src="@{/plugin/element-ui/index.js}"></script> <script src="https://cdn.jsdelivr.net/npm/@riophae/vue-treeselect@^0.4.0/dist/vue-treeselect.umd.min.js"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@riophae/vue-treeselect@^0.4.0/dist/vue-treeselect.min.css"> <script> var id = $.query.get("id"); var app = new Vue({ el: '#app', data: { //表单数据 serviceOrder:{} }, /** * 初始化数据表 */ created: function () { this.loadData() }, methods: { loadData(){ let _this=this; AjaxProxy.requst({ app: _this, url: basePath + '/admin/projService/findServiceOrderInfoVo/'+id, callback: function (data) { _this.serviceOrder = data.data; } }); }, submitForm(){ let _this=this; let data={ id:this.serviceOrder.id, yyTime:this.serviceOrder.yyTime, createTime:this.serviceOrder.createTime, consumeTime:this.serviceOrder.consumeTime } AjaxProxy.requst({ app: _this, data: data, contentType: 'application/json', url: basePath + '/admin/projService/updateOrderTime', callback: function (data) { _this.$message.success("修改成功"); if(parent.myGrid){ parent.myGrid.serchData() } if(parent.app){ parent.app.serviceOrderQuery(); } setInterval(MTools.closeIframe(), 1000); } }); }, closeFram: function () { parent.layer.close(parent.layer.getFrameIndex(window.name)); }, } }) </script> </body> </html> zq-erp/src/main/resources/templates/views/admin/hive/beautySalon/vip.html
@@ -124,10 +124,12 @@ </el-col> </el-col> <el-col :span="8" style="float: right; margin-right: 20px;"> <el-button type="primary" plain @click="recharge">充值</el-button> <el-button type="warning" plain @click="addOrder">开单</el-button> <el-button type="success" plain @click="addServiceOrder">开服务单</el-button> <el-button type="info" plain @click="exportExcel">导出项目</el-button> <el-button type="primary" plain @click="openAdd">会员注册</el-button> </el-col> </el-header> <el-container> @@ -820,6 +822,14 @@ } }, methods : { openAdd(){ layer.full(layer.open({ type : 2, title : "添加会员信息", area : [ MUI.SIZE_L, '450px' ], content : [ basePath+'/admin/vipInfo/editForm' ] })); }, //打开订单详情页面 openOrder(index,row){ layer.full(layer.open({ @@ -1243,7 +1253,7 @@ title: "修改订单时间", maxmin: true, area: [MUI.SIZE_L, '500px'], content: [basePath + '/admin/projService/toServiceOrderUpdateTime?id=' + row.id] content: [basePath + '/admin/redirect/hive/beautySalon/updateServiceOrderTimeV2?id=' + row.id] }); }, /********* 服务单tab end ***********/