完善订单页面
This commit is contained in:
parent
b1bb07a0da
commit
f161f449ba
@ -0,0 +1,33 @@
|
||||
package com.ruoyi.web.controller.custom;
|
||||
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.custom.domain.CusUserPost;
|
||||
import com.ruoyi.custom.service.ICusUserPostService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 销售订单Controller
|
||||
*
|
||||
* @author wonder
|
||||
* @date 2020-09-24
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/post")
|
||||
public class CusUserPostController extends BaseController {
|
||||
@Autowired
|
||||
private ICusUserPostService cusUserPostService;
|
||||
|
||||
@GetMapping("/options")
|
||||
public AjaxResult getOptions() {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
List<CusUserPost> userPosts = cusUserPostService.selectAllCusUserPost();
|
||||
|
||||
ajax.put(AjaxResult.DATA_TAG, userPosts);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
}
|
@ -1,13 +1,10 @@
|
||||
package com.ruoyi.web.controller.custom;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
import com.ruoyi.common.core.domain.entity.SysUser;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
import com.ruoyi.system.domain.SysUserPost;
|
||||
import com.ruoyi.system.domain.custom.UserPostOption;
|
||||
import com.ruoyi.system.service.ISysPostService;
|
||||
import com.ruoyi.system.service.ISysDictDataService;
|
||||
import com.ruoyi.system.service.ISysUserService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -40,12 +37,11 @@ public class SysOrderController extends BaseController {
|
||||
@Autowired
|
||||
private ISysOrderService sysOrderService;
|
||||
|
||||
@Autowired
|
||||
private ISysPostService postService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
@Autowired
|
||||
private ISysDictDataService dictDataService;
|
||||
|
||||
/**
|
||||
* 查询销售订单列表
|
||||
@ -54,8 +50,28 @@ public class SysOrderController extends BaseController {
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysOrder sysOrder) {
|
||||
startPage();
|
||||
// List<SysUser> users = userService.selectUserList();
|
||||
List<SysOrder> list = sysOrderService.selectSysOrderList(sysOrder);
|
||||
List<SysUser> userList = userService.selectAllUser();
|
||||
|
||||
for (SysOrder order : list) {
|
||||
for (SysUser user : userList) {
|
||||
if (user.getUserId().equals(order.getPreSaleId())) {
|
||||
order.setPreSale(user.getNickName());
|
||||
} else if (user.getUserId().equals(order.getAfterSaleId())) {
|
||||
order.setAfterSale(user.getNickName());
|
||||
} else if (user.getUserId().equals(order.getNutritionistId())) {
|
||||
order.setNutritionist(user.getNickName());
|
||||
} else if (user.getUserId().equals(order.getNutriAssisId())) {
|
||||
order.setNutriAssis(user.getNickName());
|
||||
} else if (user.getUserId().equals(order.getOperatorId())) {
|
||||
order.setOperator(user.getNickName());
|
||||
} else if (user.getUserId().equals(order.getPlannerId())) {
|
||||
order.setPlanner(user.getNickName());
|
||||
} else if (user.getUserId().equals(order.getPlannerAssisId())) {
|
||||
order.setPlannerAssis(user.getNickName());
|
||||
}
|
||||
}
|
||||
}
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
@ -68,6 +84,27 @@ public class SysOrderController extends BaseController {
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(SysOrder sysOrder) {
|
||||
List<SysOrder> list = sysOrderService.selectSysOrderList(sysOrder);
|
||||
List<SysUser> userList = userService.selectAllUser();
|
||||
|
||||
for (SysOrder order : list) {
|
||||
for (SysUser user : userList) {
|
||||
if (user.getUserId().equals(order.getPreSaleId())) {
|
||||
order.setPreSale(user.getNickName());
|
||||
} else if (user.getUserId().equals(order.getAfterSaleId())) {
|
||||
order.setAfterSale(user.getNickName());
|
||||
} else if (user.getUserId().equals(order.getNutritionistId())) {
|
||||
order.setNutritionist(user.getNickName());
|
||||
} else if (user.getUserId().equals(order.getNutriAssisId())) {
|
||||
order.setNutriAssis(user.getNickName());
|
||||
} else if (user.getUserId().equals(order.getOperatorId())) {
|
||||
order.setOperator(user.getNickName());
|
||||
} else if (user.getUserId().equals(order.getPlannerId())) {
|
||||
order.setPlanner(user.getNickName());
|
||||
} else if (user.getUserId().equals(order.getPlannerAssisId())) {
|
||||
order.setPlannerAssis(user.getNickName());
|
||||
}
|
||||
}
|
||||
}
|
||||
ExcelUtil<SysOrder> util = new ExcelUtil<SysOrder>(SysOrder.class);
|
||||
return util.exportExcel(list, "order");
|
||||
}
|
||||
@ -111,25 +148,5 @@ public class SysOrderController extends BaseController {
|
||||
return toAjax(sysOrderService.deleteSysOrderByIds(orderIds));
|
||||
}
|
||||
|
||||
@GetMapping("/getOptions")
|
||||
public AjaxResult getOptions() {
|
||||
AjaxResult ajax = AjaxResult.success();
|
||||
List<SysUserPost> userPosts = postService.selectUserPostAll();
|
||||
|
||||
List<UserPostOption> userPostOptions = new ArrayList<>();
|
||||
|
||||
for (SysUserPost userPost : userPosts) {
|
||||
SysPost post = postService.selectPostById(userPost.getPostId());
|
||||
SysUser user = userService.selectUserById(userPost.getUserId());
|
||||
UserPostOption userPostOption = new UserPostOption();
|
||||
userPostOption.setPostCode(post.getPostCode());
|
||||
userPostOption.setUserId(userPost.getUserId());
|
||||
userPostOption.setUserName(user.getNickName());
|
||||
userPostOptions.add(userPostOption);
|
||||
}
|
||||
|
||||
ajax.put(AjaxResult.DATA_TAG, userPostOptions);
|
||||
return ajax;
|
||||
}
|
||||
|
||||
}
|
@ -9,8 +9,8 @@ spring:
|
||||
# url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# password: wonderdb
|
||||
|
||||
# url: jdbc:mysql://47.97.194.44:3306/long_shop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://localhost:3306/long_shop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://47.97.194.44:3306/long_shop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://localhost:3306/long_shop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
password: 9gPUnV$#2s/j(7_(
|
||||
username: root
|
||||
# 从库数据源
|
||||
|
@ -9,8 +9,8 @@ ruoyi:
|
||||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
# profile: /Users/wonder/Documents/Workspaces/node/RuoYi-Vue/running/uploadPath
|
||||
profile: /home/www/api/longShop/uploadPath
|
||||
profile: /Users/wonder/Documents/Workspaces/java/RuoYi-Vue/running/uploadPath
|
||||
# profile: /home/www/api/longShop/uploadPath
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
# 验证码类型 math 数组计算 char 字符验证
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!-- 日志存放路径 -->
|
||||
<!-- <property name="log.path" value="/Users/wonder/Documents/Workspaces/node/RuoYi-Vue/running/logs" />-->
|
||||
<property name="log.path" value="/home/www/api/longShop/logs" />
|
||||
<property name="log.path" value="/Users/wonder/Documents/Workspaces/node/RuoYi-Vue/running/logs" />
|
||||
<!-- <property name="log.path" value="/home/www/api/longShop/logs" />-->
|
||||
<!-- 日志输出格式 -->
|
||||
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />
|
||||
|
||||
|
@ -1,6 +1,12 @@
|
||||
package com.ruoyi.system.domain.custom;
|
||||
package com.ruoyi.custom.domain;
|
||||
|
||||
public class UserPostOption {
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
public class CusUserPost implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long userId;
|
||||
|
||||
@ -8,6 +14,8 @@ public class UserPostOption {
|
||||
|
||||
private String postCode;
|
||||
|
||||
private String postId;
|
||||
|
||||
public String getPostCode() {
|
||||
return postCode;
|
||||
}
|
||||
@ -32,12 +40,21 @@ public class UserPostOption {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getPostId() {
|
||||
return postId;
|
||||
}
|
||||
|
||||
public void setPostId(String postId) {
|
||||
this.postId = postId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserPostOption{" +
|
||||
"userId=" + userId +
|
||||
", userName='" + userName + '\'' +
|
||||
", postCode='" + postCode + '\'' +
|
||||
", postid='" + postId + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -100,11 +100,34 @@ public class SysOrder extends BaseEntity
|
||||
@Excel(name = "推荐人")
|
||||
private String recommender;
|
||||
|
||||
/** 服务月数 */
|
||||
@Excel(name = "服务月数")
|
||||
private String serveMonth;
|
||||
|
||||
@Excel(name = "审核状态", dictType = "cus_review_status")
|
||||
private String reviewStatus;
|
||||
|
||||
/** 成交日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "成交日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date orderTime;
|
||||
|
||||
public String getReviewStatus() {
|
||||
return reviewStatus;
|
||||
}
|
||||
|
||||
public void setReviewStatus(String reviewStatus) {
|
||||
this.reviewStatus = reviewStatus;
|
||||
}
|
||||
|
||||
public void setServeMonth(String serveMonth) {
|
||||
this.serveMonth = serveMonth;
|
||||
}
|
||||
|
||||
public String getServeMonth() {
|
||||
return serveMonth;
|
||||
}
|
||||
|
||||
public void setOrderId(Long orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
@ -354,6 +377,8 @@ public class SysOrder extends BaseEntity
|
||||
.append("operator", getOperator())
|
||||
.append("recommender", getRecommender())
|
||||
.append("orderTime", getOrderTime())
|
||||
.append("serveMonth", getServeMonth())
|
||||
.append("reviewStatus", getReviewStatus())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.ruoyi.custom.mapper;
|
||||
|
||||
import com.ruoyi.custom.domain.CusUserPost;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CusUserPostMapper {
|
||||
public List<CusUserPost> selectAllCusUserPost();
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
package com.ruoyi.custom.service;
|
||||
|
||||
import com.ruoyi.custom.domain.CusUserPost;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ICusUserPostService {
|
||||
|
||||
public List<CusUserPost> selectAllCusUserPost();
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.ruoyi.custom.service.impl;
|
||||
|
||||
import com.ruoyi.custom.domain.CusUserPost;
|
||||
import com.ruoyi.custom.mapper.CusUserPostMapper;
|
||||
import com.ruoyi.custom.service.ICusUserPostService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class CusUserPostImpl implements ICusUserPostService {
|
||||
|
||||
@Autowired
|
||||
private CusUserPostMapper cusUserPostMapper;
|
||||
|
||||
@Override
|
||||
public List<CusUserPost> selectAllCusUserPost() {
|
||||
return cusUserPostMapper.selectAllCusUserPost();
|
||||
}
|
||||
}
|
@ -54,6 +54,7 @@ public class SysOrderServiceImpl implements ISysOrderService
|
||||
public int insertSysOrder(SysOrder sysOrder)
|
||||
{
|
||||
sysOrder.setCreateTime(DateUtils.getNowDate());
|
||||
sysOrder.setOrderTime(DateUtils.getNowDate());
|
||||
return sysOrderMapper.insertSysOrder(sysOrder);
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.custom.mapper.CusUserPostMapper">
|
||||
|
||||
<resultMap type="CusUserPost" id="CusUserPostResult">
|
||||
<result property="userId" column="user_id"/>
|
||||
<result property="userName" column="nick_name"/>
|
||||
<result property="postId" column="post_id"/>
|
||||
<result property="postCode" column="post_code"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCusUserPostVo">
|
||||
SELECT u.user_id, u.nick_name, p.post_id, p.post_code
|
||||
FROM sys_user u, sys_post p, sys_user_post up
|
||||
WHERE up.user_id = u.user_id AND p.post_id = up.post_id
|
||||
</sql>
|
||||
|
||||
<select id="selectAllCusUserPost" parameterType="CusUserPost" resultMap="CusUserPostResult">
|
||||
<include refid="selectCusUserPostVo"/>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
@ -5,58 +5,59 @@
|
||||
<mapper namespace="com.ruoyi.custom.mapper.SysOrderMapper">
|
||||
|
||||
<resultMap type="SysOrder" id="SysOrderResult">
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="customer" column="customer" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="payTypeId" column="pay_type_id" />
|
||||
<result property="payType" column="pay_type" />
|
||||
<result property="preSaleId" column="pre_sale_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="preSale" column="pre_sale" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="afterSaleId" column="after_sale_id" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="afterSale" column="after_sale" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="nutritionistId" column="nutritionist_id" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="nutritionist" column="nutritionist" />
|
||||
<result property="nutriAssisId" column="nutri_assis_id" />
|
||||
<result property="nutriAssis" column="nutri_assis" />
|
||||
<result property="accountId" column="account_id" />
|
||||
<result property="account" column="account" />
|
||||
<result property="plannerId" column="planner_id" />
|
||||
<result property="planner" column="planner" />
|
||||
<result property="plannerAssisId" column="planner_assis_id" />
|
||||
<result property="plannerAssis" column="planner_assis" />
|
||||
<result property="operatorId" column="operator_id" />
|
||||
<result property="operator" column="operator" />
|
||||
<result property="recommender" column="recommender" />
|
||||
<result property="orderTime" column="order_time" />
|
||||
<result property="orderId" column="order_id"/>
|
||||
<result property="customer" column="customer"/>
|
||||
<result property="phone" column="phone"/>
|
||||
<result property="amount" column="amount"/>
|
||||
<result property="payTypeId" column="pay_type_id"/>
|
||||
<result property="payType" column="pay_type"/>
|
||||
<result property="preSaleId" column="pre_sale_id"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="afterSaleId" column="after_sale_id"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="nutritionistId" column="nutritionist_id"/>
|
||||
<result property="remark" column="remark"/>
|
||||
<result property="nutriAssisId" column="nutri_assis_id"/>
|
||||
<result property="accountId" column="account_id"/>
|
||||
<result property="account" column="account"/>
|
||||
<result property="plannerId" column="planner_id"/>
|
||||
<result property="plannerAssisId" column="planner_assis_id"/>
|
||||
<result property="operatorId" column="operator_id"/>
|
||||
<result property="recommender" column="recommender"/>
|
||||
<result property="orderTime" column="order_time"/>
|
||||
<result property="serveMonth" column="serve_month"/>
|
||||
<result property="reviewStatus" column="review_status"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectSysOrderVo">
|
||||
select order_id, customer, phone, amount, pay_type_id, pay_type, pre_sale_id, create_by, pre_sale, create_time, after_sale_id, update_by, after_sale, update_time, nutritionist_id, remark, nutritionist, nutri_assis_id, nutri_assis, account_id, account, planner_id, planner, planner_assis_id, planner_assis, operator_id, operator, recommender, order_time from sys_order
|
||||
select o.order_id, o.review_status, o.customer, o.phone, o.amount, o.serve_month, o.pay_type_id, pay.dict_label as pay_type, o.pre_sale_id, o.create_by, o.create_time, o.after_sale_id, o.update_by, o.update_time, o.nutritionist_id, o.remark, o.nutri_assis_id, o.account_id, acc.dict_label as account, o.planner_id, o.planner_assis_id, o.operator_id, o.recommender, o.order_time from sys_order o
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_pay_type') AS pay ON pay.dict_value = o.pay_type_id
|
||||
LEFT JOIN (SELECT dict_label, dict_value FROM sys_dict_data WHERE dict_type = 'cus_account') AS acc ON acc.dict_value = o.account_id
|
||||
</sql>
|
||||
|
||||
<select id="selectSysOrderList" parameterType="SysOrder" resultMap="SysOrderResult">
|
||||
<include refid="selectSysOrderVo"/>
|
||||
<where>
|
||||
<if test="customer != null and customer != ''"> and customer = #{customer}</if>
|
||||
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
|
||||
<if test="payTypeId != null "> and pay_type_id = #{payTypeId}</if>
|
||||
<if test="preSaleId != null "> and pre_sale_id = #{preSaleId}</if>
|
||||
<if test="afterSaleId != null "> and after_sale_id = #{afterSaleId}</if>
|
||||
<if test="nutritionistId != null "> and nutritionist_id = #{nutritionistId}</if>
|
||||
<if test="nutriAssisId != null "> and nutri_assis_id = #{nutriAssisId}</if>
|
||||
<if test="accountId != null "> and account_id = #{accountId}</if>
|
||||
<if test="plannerId != null "> and planner_id = #{plannerId}</if>
|
||||
<if test="plannerAssisId != null "> and planner_assis_id = #{plannerAssisId}</if>
|
||||
<if test="operatorId != null "> and operator_id = #{operatorId}</if>
|
||||
<if test="recommender != null and recommender != ''"> and recommender = #{recommender}</if>
|
||||
<if test="orderTime != null "> and order_time = #{orderTime}</if>
|
||||
<if test="customer != null and customer != ''">and customer = #{customer}</if>
|
||||
<if test="phone != null and phone != ''">and phone = #{phone}</if>
|
||||
<if test="payTypeId != null ">and pay_type_id = #{payTypeId}</if>
|
||||
<if test="preSaleId != null ">and pre_sale_id = #{preSaleId}</if>
|
||||
<if test="afterSaleId != null ">and after_sale_id = #{afterSaleId}</if>
|
||||
<if test="nutritionistId != null ">and nutritionist_id = #{nutritionistId}</if>
|
||||
<if test="nutriAssisId != null ">and nutri_assis_id = #{nutriAssisId}</if>
|
||||
<if test="accountId != null ">and account_id = #{accountId}</if>
|
||||
<if test="plannerId != null ">and planner_id = #{plannerId}</if>
|
||||
<if test="plannerAssisId != null ">and planner_assis_id = #{plannerAssisId}</if>
|
||||
<if test="operatorId != null ">and operator_id = #{operatorId}</if>
|
||||
<if test="recommender != null and recommender != ''">and recommender = #{recommender}</if>
|
||||
<if test="beginTime != null ">and order_time >= #{beginTime}</if>
|
||||
<if test="endTime != null ">and order_time <= #{endTime}</if>
|
||||
<if test="serveMonth != null ">and serve_month = #{serveMonth}</if>
|
||||
<if test="reviewStatus != null ">and review_status = #{reviewStatus}</if>
|
||||
</where>
|
||||
order by order_time desc
|
||||
</select>
|
||||
|
||||
<select id="selectSysOrderById" parameterType="Long" resultMap="SysOrderResult">
|
||||
@ -71,60 +72,46 @@
|
||||
<if test="phone != null">phone,</if>
|
||||
<if test="amount != null">amount,</if>
|
||||
<if test="payTypeId != null">pay_type_id,</if>
|
||||
<if test="payType != null">pay_type,</if>
|
||||
<if test="preSaleId != null">pre_sale_id,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="preSale != null">pre_sale,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="afterSaleId != null">after_sale_id,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="afterSale != null">after_sale,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="nutritionistId != null">nutritionist_id,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="nutritionist != null">nutritionist,</if>
|
||||
<if test="nutriAssisId != null">nutri_assis_id,</if>
|
||||
<if test="nutriAssis != null">nutri_assis,</if>
|
||||
<if test="accountId != null">account_id,</if>
|
||||
<if test="account != null">account,</if>
|
||||
<if test="plannerId != null">planner_id,</if>
|
||||
<if test="planner != null">planner,</if>
|
||||
<if test="plannerAssisId != null">planner_assis_id,</if>
|
||||
<if test="plannerAssis != null">planner_assis,</if>
|
||||
<if test="operatorId != null">operator_id,</if>
|
||||
<if test="operator != null">operator,</if>
|
||||
<if test="recommender != null">recommender,</if>
|
||||
<if test="orderTime != null">order_time,</if>
|
||||
<if test="serveMonth != null">serve_month,</if>
|
||||
<if test="reviewStatus != null">review_status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="customer != null and customer != ''">#{customer},</if>
|
||||
<if test="phone != null">#{phone},</if>
|
||||
<if test="amount != null">#{amount},</if>
|
||||
<if test="payTypeId != null">#{payTypeId},</if>
|
||||
<if test="payType != null">#{payType},</if>
|
||||
<if test="preSaleId != null">#{preSaleId},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="preSale != null">#{preSale},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="afterSaleId != null">#{afterSaleId},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="afterSale != null">#{afterSale},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="nutritionistId != null">#{nutritionistId},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="nutritionist != null">#{nutritionist},</if>
|
||||
<if test="nutriAssisId != null">#{nutriAssisId},</if>
|
||||
<if test="nutriAssis != null">#{nutriAssis},</if>
|
||||
<if test="accountId != null">#{accountId},</if>
|
||||
<if test="account != null">#{account},</if>
|
||||
<if test="plannerId != null">#{plannerId},</if>
|
||||
<if test="planner != null">#{planner},</if>
|
||||
<if test="plannerAssisId != null">#{plannerAssisId},</if>
|
||||
<if test="plannerAssis != null">#{plannerAssis},</if>
|
||||
<if test="operatorId != null">#{operatorId},</if>
|
||||
<if test="operator != null">#{operator},</if>
|
||||
<if test="recommender != null">#{recommender},</if>
|
||||
<if test="orderTime != null">#{orderTime},</if>
|
||||
<if test="serveMonth != null">#{serveMonth},</if>
|
||||
<if test="reviewStatus != null">#{reviewStatus},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -135,30 +122,23 @@
|
||||
<if test="phone != null">phone = #{phone},</if>
|
||||
<if test="amount != null">amount = #{amount},</if>
|
||||
<if test="payTypeId != null">pay_type_id = #{payTypeId},</if>
|
||||
<if test="payType != null">pay_type = #{payType},</if>
|
||||
<if test="preSaleId != null">pre_sale_id = #{preSaleId},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="preSale != null">pre_sale = #{preSale},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="afterSaleId != null">after_sale_id = #{afterSaleId},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="afterSale != null">after_sale = #{afterSale},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="nutritionistId != null">nutritionist_id = #{nutritionistId},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="nutritionist != null">nutritionist = #{nutritionist},</if>
|
||||
<if test="nutriAssisId != null">nutri_assis_id = #{nutriAssisId},</if>
|
||||
<if test="nutriAssis != null">nutri_assis = #{nutriAssis},</if>
|
||||
<if test="accountId != null">account_id = #{accountId},</if>
|
||||
<if test="account != null">account = #{account},</if>
|
||||
<if test="plannerId != null">planner_id = #{plannerId},</if>
|
||||
<if test="planner != null">planner = #{planner},</if>
|
||||
<if test="plannerAssisId != null">planner_assis_id = #{plannerAssisId},</if>
|
||||
<if test="plannerAssis != null">planner_assis = #{plannerAssis},</if>
|
||||
<if test="operatorId != null">operator_id = #{operatorId},</if>
|
||||
<if test="operator != null">operator = #{operator},</if>
|
||||
<if test="recommender != null">recommender = #{recommender},</if>
|
||||
<if test="orderTime != null">order_time = #{orderTime},</if>
|
||||
<if test="serveMonth != null">serve_month = #{serveMonth},</if>
|
||||
<if test="reviewStatus != null">review_status = #{reviewStatus},</if>
|
||||
</trim>
|
||||
where order_id = #{orderId}
|
||||
</update>
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
|
||||
/**
|
||||
@ -8,8 +9,7 @@ import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface ISysDictDataService
|
||||
{
|
||||
public interface ISysDictDataService {
|
||||
/**
|
||||
* 根据条件分页查询字典数据
|
||||
*
|
||||
@ -21,7 +21,7 @@ public interface ISysDictDataService
|
||||
/**
|
||||
* 根据字典类型和字典键值查询字典数据信息
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典键值
|
||||
* @return 字典标签
|
||||
*/
|
||||
@ -58,4 +58,6 @@ public interface ISysDictDataService
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateDictData(SysDictData dictData);
|
||||
|
||||
public List<SysDictData> selectDictDataByType(String dictType);
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.core.domain.entity.SysDictData;
|
||||
@ -14,8 +15,7 @@ import com.ruoyi.system.service.ISysDictDataService;
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class SysDictDataServiceImpl implements ISysDictDataService
|
||||
{
|
||||
public class SysDictDataServiceImpl implements ISysDictDataService {
|
||||
@Autowired
|
||||
private SysDictDataMapper dictDataMapper;
|
||||
|
||||
@ -26,21 +26,19 @@ public class SysDictDataServiceImpl implements ISysDictDataService
|
||||
* @return 字典数据集合信息
|
||||
*/
|
||||
@Override
|
||||
public List<SysDictData> selectDictDataList(SysDictData dictData)
|
||||
{
|
||||
public List<SysDictData> selectDictDataList(SysDictData dictData) {
|
||||
return dictDataMapper.selectDictDataList(dictData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据字典类型和字典键值查询字典数据信息
|
||||
*
|
||||
* @param dictType 字典类型
|
||||
* @param dictType 字典类型
|
||||
* @param dictValue 字典键值
|
||||
* @return 字典标签
|
||||
*/
|
||||
@Override
|
||||
public String selectDictLabel(String dictType, String dictValue)
|
||||
{
|
||||
public String selectDictLabel(String dictType, String dictValue) {
|
||||
return dictDataMapper.selectDictLabel(dictType, dictValue);
|
||||
}
|
||||
|
||||
@ -51,8 +49,7 @@ public class SysDictDataServiceImpl implements ISysDictDataService
|
||||
* @return 字典数据
|
||||
*/
|
||||
@Override
|
||||
public SysDictData selectDictDataById(Long dictCode)
|
||||
{
|
||||
public SysDictData selectDictDataById(Long dictCode) {
|
||||
return dictDataMapper.selectDictDataById(dictCode);
|
||||
}
|
||||
|
||||
@ -63,11 +60,9 @@ public class SysDictDataServiceImpl implements ISysDictDataService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteDictDataByIds(Long[] dictCodes)
|
||||
{
|
||||
public int deleteDictDataByIds(Long[] dictCodes) {
|
||||
int row = dictDataMapper.deleteDictDataByIds(dictCodes);
|
||||
if (row > 0)
|
||||
{
|
||||
if (row > 0) {
|
||||
DictUtils.clearDictCache();
|
||||
}
|
||||
return row;
|
||||
@ -80,11 +75,9 @@ public class SysDictDataServiceImpl implements ISysDictDataService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertDictData(SysDictData dictData)
|
||||
{
|
||||
public int insertDictData(SysDictData dictData) {
|
||||
int row = dictDataMapper.insertDictData(dictData);
|
||||
if (row > 0)
|
||||
{
|
||||
if (row > 0) {
|
||||
DictUtils.clearDictCache();
|
||||
}
|
||||
return row;
|
||||
@ -97,13 +90,16 @@ public class SysDictDataServiceImpl implements ISysDictDataService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateDictData(SysDictData dictData)
|
||||
{
|
||||
public int updateDictData(SysDictData dictData) {
|
||||
int row = dictDataMapper.updateDictData(dictData);
|
||||
if (row > 0)
|
||||
{
|
||||
if (row > 0) {
|
||||
DictUtils.clearDictCache();
|
||||
}
|
||||
return row;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysDictData> selectDictDataByType(String dictType) {
|
||||
return dictDataMapper.selectDictDataByType(dictType);
|
||||
}
|
||||
}
|
||||
|
@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -31,8 +32,7 @@ import com.ruoyi.system.service.ISysUserService;
|
||||
* @author ruoyi
|
||||
*/
|
||||
@Service
|
||||
public class SysUserServiceImpl implements ISysUserService
|
||||
{
|
||||
public class SysUserServiceImpl implements ISysUserService {
|
||||
private static final Logger log = LoggerFactory.getLogger(SysUserServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
@ -61,14 +61,13 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
*/
|
||||
@Override
|
||||
@DataScope(deptAlias = "d", userAlias = "u")
|
||||
public List<SysUser> selectUserList(SysUser user)
|
||||
{
|
||||
public List<SysUser> selectUserList(SysUser user) {
|
||||
return userMapper.selectUserList(user);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUser> selectAllUser() {
|
||||
return return userMapper.selectUserList();
|
||||
return userMapper.selectAllUser();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -78,8 +77,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
@Override
|
||||
public SysUser selectUserByUserName(String userName)
|
||||
{
|
||||
public SysUser selectUserByUserName(String userName) {
|
||||
return userMapper.selectUserByUserName(userName);
|
||||
}
|
||||
|
||||
@ -90,8 +88,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
@Override
|
||||
public SysUser selectUserById(Long userId)
|
||||
{
|
||||
public SysUser selectUserById(Long userId) {
|
||||
return userMapper.selectUserById(userId);
|
||||
}
|
||||
|
||||
@ -102,16 +99,13 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String selectUserRoleGroup(String userName)
|
||||
{
|
||||
public String selectUserRoleGroup(String userName) {
|
||||
List<SysRole> list = roleMapper.selectRolesByUserName(userName);
|
||||
StringBuffer idsStr = new StringBuffer();
|
||||
for (SysRole role : list)
|
||||
{
|
||||
for (SysRole role : list) {
|
||||
idsStr.append(role.getRoleName()).append(",");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(idsStr.toString()))
|
||||
{
|
||||
if (StringUtils.isNotEmpty(idsStr.toString())) {
|
||||
return idsStr.substring(0, idsStr.length() - 1);
|
||||
}
|
||||
return idsStr.toString();
|
||||
@ -124,16 +118,13 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String selectUserPostGroup(String userName)
|
||||
{
|
||||
public String selectUserPostGroup(String userName) {
|
||||
List<SysPost> list = postMapper.selectPostsByUserName(userName);
|
||||
StringBuffer idsStr = new StringBuffer();
|
||||
for (SysPost post : list)
|
||||
{
|
||||
for (SysPost post : list) {
|
||||
idsStr.append(post.getPostName()).append(",");
|
||||
}
|
||||
if (StringUtils.isNotEmpty(idsStr.toString()))
|
||||
{
|
||||
if (StringUtils.isNotEmpty(idsStr.toString())) {
|
||||
return idsStr.substring(0, idsStr.length() - 1);
|
||||
}
|
||||
return idsStr.toString();
|
||||
@ -146,11 +137,9 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String checkUserNameUnique(String userName)
|
||||
{
|
||||
public String checkUserNameUnique(String userName) {
|
||||
int count = userMapper.checkUserNameUnique(userName);
|
||||
if (count > 0)
|
||||
{
|
||||
if (count > 0) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
@ -163,12 +152,10 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String checkPhoneUnique(SysUser user)
|
||||
{
|
||||
public String checkPhoneUnique(SysUser user) {
|
||||
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
||||
SysUser info = userMapper.checkPhoneUnique(user.getPhonenumber());
|
||||
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
|
||||
{
|
||||
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
@ -181,12 +168,10 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String checkEmailUnique(SysUser user)
|
||||
{
|
||||
public String checkEmailUnique(SysUser user) {
|
||||
Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId();
|
||||
SysUser info = userMapper.checkEmailUnique(user.getEmail());
|
||||
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue())
|
||||
{
|
||||
if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) {
|
||||
return UserConstants.NOT_UNIQUE;
|
||||
}
|
||||
return UserConstants.UNIQUE;
|
||||
@ -198,10 +183,8 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
* @param user 用户信息
|
||||
*/
|
||||
@Override
|
||||
public void checkUserAllowed(SysUser user)
|
||||
{
|
||||
if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin())
|
||||
{
|
||||
public void checkUserAllowed(SysUser user) {
|
||||
if (StringUtils.isNotNull(user.getUserId()) && user.isAdmin()) {
|
||||
throw new CustomException("不允许操作超级管理员用户");
|
||||
}
|
||||
}
|
||||
@ -214,8 +197,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int insertUser(SysUser user)
|
||||
{
|
||||
public int insertUser(SysUser user) {
|
||||
// 新增用户信息
|
||||
int rows = userMapper.insertUser(user);
|
||||
// 新增用户岗位关联
|
||||
@ -233,8 +215,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public int updateUser(SysUser user)
|
||||
{
|
||||
public int updateUser(SysUser user) {
|
||||
Long userId = user.getUserId();
|
||||
// 删除用户与角色关联
|
||||
userRoleMapper.deleteUserRoleByUserId(userId);
|
||||
@ -254,8 +235,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateUserStatus(SysUser user)
|
||||
{
|
||||
public int updateUserStatus(SysUser user) {
|
||||
return userMapper.updateUser(user);
|
||||
}
|
||||
|
||||
@ -266,8 +246,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateUserProfile(SysUser user)
|
||||
{
|
||||
public int updateUserProfile(SysUser user) {
|
||||
return userMapper.updateUser(user);
|
||||
}
|
||||
|
||||
@ -275,12 +254,11 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
* 修改用户头像
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @param avatar 头像地址
|
||||
* @param avatar 头像地址
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public boolean updateUserAvatar(String userName, String avatar)
|
||||
{
|
||||
public boolean updateUserAvatar(String userName, String avatar) {
|
||||
return userMapper.updateUserAvatar(userName, avatar) > 0;
|
||||
}
|
||||
|
||||
@ -291,8 +269,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int resetPwd(SysUser user)
|
||||
{
|
||||
public int resetPwd(SysUser user) {
|
||||
return userMapper.updateUser(user);
|
||||
}
|
||||
|
||||
@ -304,8 +281,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int resetUserPwd(String userName, String password)
|
||||
{
|
||||
public int resetUserPwd(String userName, String password) {
|
||||
return userMapper.resetUserPwd(userName, password);
|
||||
}
|
||||
|
||||
@ -314,22 +290,18 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
*
|
||||
* @param user 用户对象
|
||||
*/
|
||||
public void insertUserRole(SysUser user)
|
||||
{
|
||||
public void insertUserRole(SysUser user) {
|
||||
Long[] roles = user.getRoleIds();
|
||||
if (StringUtils.isNotNull(roles))
|
||||
{
|
||||
if (StringUtils.isNotNull(roles)) {
|
||||
// 新增用户与角色管理
|
||||
List<SysUserRole> list = new ArrayList<SysUserRole>();
|
||||
for (Long roleId : roles)
|
||||
{
|
||||
for (Long roleId : roles) {
|
||||
SysUserRole ur = new SysUserRole();
|
||||
ur.setUserId(user.getUserId());
|
||||
ur.setRoleId(roleId);
|
||||
list.add(ur);
|
||||
}
|
||||
if (list.size() > 0)
|
||||
{
|
||||
if (list.size() > 0) {
|
||||
userRoleMapper.batchUserRole(list);
|
||||
}
|
||||
}
|
||||
@ -340,22 +312,18 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
*
|
||||
* @param user 用户对象
|
||||
*/
|
||||
public void insertUserPost(SysUser user)
|
||||
{
|
||||
public void insertUserPost(SysUser user) {
|
||||
Long[] posts = user.getPostIds();
|
||||
if (StringUtils.isNotNull(posts))
|
||||
{
|
||||
if (StringUtils.isNotNull(posts)) {
|
||||
// 新增用户与岗位管理
|
||||
List<SysUserPost> list = new ArrayList<SysUserPost>();
|
||||
for (Long postId : posts)
|
||||
{
|
||||
for (Long postId : posts) {
|
||||
SysUserPost up = new SysUserPost();
|
||||
up.setUserId(user.getUserId());
|
||||
up.setPostId(postId);
|
||||
list.add(up);
|
||||
}
|
||||
if (list.size() > 0)
|
||||
{
|
||||
if (list.size() > 0) {
|
||||
userPostMapper.batchUserPost(list);
|
||||
}
|
||||
}
|
||||
@ -368,8 +336,7 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUserById(Long userId)
|
||||
{
|
||||
public int deleteUserById(Long userId) {
|
||||
// 删除用户与角色关联
|
||||
userRoleMapper.deleteUserRoleByUserId(userId);
|
||||
// 删除用户与岗位表
|
||||
@ -384,10 +351,8 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteUserByIds(Long[] userIds)
|
||||
{
|
||||
for (Long userId : userIds)
|
||||
{
|
||||
public int deleteUserByIds(Long[] userIds) {
|
||||
for (Long userId : userIds) {
|
||||
checkUserAllowed(new SysUser(userId));
|
||||
}
|
||||
return userMapper.deleteUserByIds(userIds);
|
||||
@ -396,16 +361,14 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
/**
|
||||
* 导入用户数据
|
||||
*
|
||||
* @param userList 用户数据列表
|
||||
* @param userList 用户数据列表
|
||||
* @param isUpdateSupport 是否更新支持,如果已存在,则进行更新数据
|
||||
* @param operName 操作用户
|
||||
* @param operName 操作用户
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName)
|
||||
{
|
||||
if (StringUtils.isNull(userList) || userList.size() == 0)
|
||||
{
|
||||
public String importUser(List<SysUser> userList, Boolean isUpdateSupport, String operName) {
|
||||
if (StringUtils.isNull(userList) || userList.size() == 0) {
|
||||
throw new CustomException("导入用户数据不能为空!");
|
||||
}
|
||||
int successNum = 0;
|
||||
@ -413,48 +376,36 @@ public class SysUserServiceImpl implements ISysUserService
|
||||
StringBuilder successMsg = new StringBuilder();
|
||||
StringBuilder failureMsg = new StringBuilder();
|
||||
String password = configService.selectConfigByKey("sys.user.initPassword");
|
||||
for (SysUser user : userList)
|
||||
{
|
||||
try
|
||||
{
|
||||
for (SysUser user : userList) {
|
||||
try {
|
||||
// 验证是否存在这个用户
|
||||
SysUser u = userMapper.selectUserByUserName(user.getUserName());
|
||||
if (StringUtils.isNull(u))
|
||||
{
|
||||
if (StringUtils.isNull(u)) {
|
||||
user.setPassword(SecurityUtils.encryptPassword(password));
|
||||
user.setCreateBy(operName);
|
||||
this.insertUser(user);
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 导入成功");
|
||||
}
|
||||
else if (isUpdateSupport)
|
||||
{
|
||||
} else if (isUpdateSupport) {
|
||||
user.setUpdateBy(operName);
|
||||
this.updateUser(user);
|
||||
successNum++;
|
||||
successMsg.append("<br/>" + successNum + "、账号 " + user.getUserName() + " 更新成功");
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
failureNum++;
|
||||
failureMsg.append("<br/>" + failureNum + "、账号 " + user.getUserName() + " 已存在");
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
} catch (Exception e) {
|
||||
failureNum++;
|
||||
String msg = "<br/>" + failureNum + "、账号 " + user.getUserName() + " 导入失败:";
|
||||
failureMsg.append(msg + e.getMessage());
|
||||
log.error(msg, e);
|
||||
}
|
||||
}
|
||||
if (failureNum > 0)
|
||||
{
|
||||
if (failureNum > 0) {
|
||||
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
|
||||
throw new CustomException(failureMsg.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
|
||||
}
|
||||
return successMsg.toString();
|
||||
|
@ -45,6 +45,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="status" column="role_status" />
|
||||
</resultMap>
|
||||
|
||||
<select id="selectAllUser" parameterType="SysUser" resultMap="SysUserResult">
|
||||
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, d.dept_name, d.leader from sys_user u
|
||||
left join sys_dept d on u.dept_id = d.dept_id
|
||||
where u.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<sql id="selectUserVo">
|
||||
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark,
|
||||
d.dept_id, d.parent_id, d.dept_name, d.order_num, d.leader, d.status as dept_status,
|
||||
|
@ -2,11 +2,11 @@ import request from '@/utils/request'
|
||||
|
||||
// 查询销售订单列表
|
||||
export function listOrder(query) {
|
||||
const [fromOrderTime, toOrderTime] = query.orderTime || [null, null];
|
||||
const [beginTime, endTime] = query.orderTime || [null, null];
|
||||
const params = {
|
||||
...query,
|
||||
fromOrderTime,
|
||||
toOrderTime,
|
||||
beginTime,
|
||||
endTime,
|
||||
orderTime: null
|
||||
}
|
||||
|
||||
@ -62,7 +62,7 @@ export function exportOrder(query) {
|
||||
|
||||
export function getOptions() {
|
||||
return request({
|
||||
url: '/custom/order/getOptions',
|
||||
url: '/custom/post/options',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
<div class="app-container">
|
||||
<el-row>
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="70px">
|
||||
<el-col :span="4">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="客户姓名" prop="customer">
|
||||
<el-input
|
||||
v-model="queryParams.customer"
|
||||
@ -13,20 +13,7 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-col :span="4">-->
|
||||
<!-- <el-form-item label="电话" prop="phone">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.phone"-->
|
||||
<!-- placeholder="请输入电话"-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- </el-col>-->
|
||||
|
||||
<el-col :span="4">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="收款方式" prop="payTypeId">
|
||||
<el-select v-model="queryParams.payTypeId" placeholder="请选择收款方式" clearable size="small">
|
||||
<el-option v-for="dict in payTypeIdOptions"
|
||||
@ -36,8 +23,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="售前" prop="preSaleId">
|
||||
<el-select v-model="queryParams.preSaleId" placeholder="请选择售前" clearable size="small">
|
||||
<el-option v-for="dict in preSaleIdOptions"
|
||||
@ -47,8 +33,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="售后" prop="afterSaleId">
|
||||
<el-select v-model="queryParams.afterSaleId" placeholder="请选择售后" clearable size="small">
|
||||
<el-option v-for="dict in afterSaleIdOptions"
|
||||
@ -58,8 +43,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="主营养师" prop="nutritionistId">
|
||||
<el-select v-model="queryParams.nutritionistId" placeholder="请选择主营养师" clearable size="small">
|
||||
<el-option v-for="dict in nutritionistIdOptions"
|
||||
@ -69,8 +53,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="助理营养师" prop="nutriAssisId" label-width="90px">
|
||||
<el-select v-model="queryParams.nutriAssisId" placeholder="请选择助理营养师" clearable style="width: 170px"
|
||||
size="small">
|
||||
@ -81,8 +64,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="账号" prop="accountId">
|
||||
<el-select v-model="queryParams.accountId" placeholder="请选择账号" clearable
|
||||
size="small">
|
||||
@ -95,8 +77,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="策划" prop="plannerId">
|
||||
<el-select v-model="queryParams.plannerId" placeholder="请选择策划" clearable
|
||||
size="small">
|
||||
@ -107,8 +88,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="策划助理" prop="plannerAssisId">
|
||||
<el-select v-model="queryParams.plannerAssisId" placeholder="请选择策划助理"
|
||||
clearable size="small">
|
||||
@ -119,8 +99,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="4">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="运营" prop="operatorId">
|
||||
<el-select v-model="queryParams.operatorId" placeholder="请选择运营"
|
||||
clearable size="small">
|
||||
@ -131,19 +110,19 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!-- <el-form-item label="推荐人" prop="recommender">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.recommender"-->
|
||||
<!-- placeholder="请输入推荐人"-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-col :span="8">
|
||||
<el-col :span="6">
|
||||
<el-form-item label="审核状态" prop="reviewStatus">
|
||||
<el-select v-model="queryParams.reviewStatus" placeholder="请选择审核状态"
|
||||
clearable size="small">
|
||||
<el-option v-for="dict in reviewStatusOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="成交日期" prop="orderTime">
|
||||
|
||||
<el-date-picker
|
||||
v-model="queryParams.orderTime"
|
||||
type="daterange"
|
||||
@ -156,19 +135,8 @@
|
||||
value-format="yyyy-MM-dd"
|
||||
:picker-options="pickerOptions">
|
||||
</el-date-picker>
|
||||
|
||||
<!-- <el-date-picker-->
|
||||
<!-- clearable-->
|
||||
<!-- size="small"-->
|
||||
<!-- style="width: 200px"-->
|
||||
<!-- v-model="queryParams.orderTime"-->
|
||||
<!-- type="date"-->
|
||||
<!-- value-format="yyyy-MM-dd"-->
|
||||
<!-- placeholder="选择成交日期">>-->
|
||||
<!-- </el-date-picker>-->
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col>
|
||||
<el-form-item>
|
||||
<el-button type="cyan" icon="el-icon-search" size="mini"
|
||||
@ -193,28 +161,6 @@
|
||||
>新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="success"-->
|
||||
<!-- icon="el-icon-edit"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="single"-->
|
||||
<!-- @click="handleUpdate"-->
|
||||
<!-- v-hasPermi="['custom:order:edit']"-->
|
||||
<!-- >修改-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<!-- <el-col :span="1.5">-->
|
||||
<!-- <el-button-->
|
||||
<!-- type="danger"-->
|
||||
<!-- icon="el-icon-delete"-->
|
||||
<!-- size="mini"-->
|
||||
<!-- :disabled="multiple"-->
|
||||
<!-- @click="handleDelete"-->
|
||||
<!-- v-hasPermi="['custom:order:remove']"-->
|
||||
<!-- >删除-->
|
||||
<!-- </el-button>-->
|
||||
<!-- </el-col>-->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
@ -229,9 +175,16 @@
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="orderList" @selection-change="handleSelectionChange">
|
||||
<!-- <el-table-column type="selection" width="55" align="center"/>-->
|
||||
<!-- <el-table-column label="编号" align="center" prop="orderId"/>-->
|
||||
<el-table-column label="成交日期" align="center" prop="orderTime" width="150" fixed="left">
|
||||
<el-table-column label="审核状态" align="center" prop="reviewStatus" width="80" fixed="left">
|
||||
<template slot-scope="scope">
|
||||
<el-tag
|
||||
:type="scope.row.reviewStatus === 'yes' ? 'success' : 'danger'"
|
||||
disable-transitions>
|
||||
{{scope.row.reviewStatus === 'yes' ? '已审核':'未审核'}}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="成交日期" align="center" prop="orderTime" width="120" fixed="left">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.orderTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
@ -239,6 +192,7 @@
|
||||
<el-table-column label="客户姓名" align="center" prop="customer" width="120" fixed="left"/>
|
||||
<el-table-column label="金额" align="center" prop="amount" width="120" fixed="left"/>
|
||||
<el-table-column label="电话" align="center" prop="phone" width="120"/>
|
||||
<el-table-column label="服务月数" align="center" prop="serveMonth" width="80"/>
|
||||
<el-table-column label="收款方式" align="center" prop="payType" width="120"/>
|
||||
<el-table-column label="售前" align="center" prop="preSale" width="120"/>
|
||||
<el-table-column label="售后" align="center" prop="afterSale" width="120"/>
|
||||
@ -311,100 +265,6 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="售前" prop="preSaleId">
|
||||
<el-select v-model="form.preSaleId" placeholder="请选择售前">
|
||||
<el-option
|
||||
v-for="dict in preSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="售后" prop="afterSaleId">
|
||||
<el-select v-model="form.afterSaleId" placeholder="请选择售后">
|
||||
<el-option
|
||||
v-for="dict in afterSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主营养师" prop="nutritionistId">
|
||||
<el-select v-model="form.nutritionistId" placeholder="请选择主营养师">
|
||||
<el-option
|
||||
v-for="dict in nutritionistIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="助理营养师" prop="nutriAssisId">
|
||||
<el-select v-model="form.nutriAssisId" placeholder="请选择助理营养师">
|
||||
<el-option
|
||||
v-for="dict in nutriAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="策划" prop="plannerId">
|
||||
<el-select v-model="form.plannerId" placeholder="请选择策划">
|
||||
<el-option
|
||||
v-for="dict in plannerIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="策划助理" prop="plannerAssisId">
|
||||
<el-select v-model="form.plannerAssisId" placeholder="请选择策划助理">
|
||||
<el-option
|
||||
v-for="dict in plannerAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="运营" prop="operatorId">
|
||||
<el-select v-model="form.operatorId" placeholder="请选择运营">
|
||||
<el-option
|
||||
v-for="dict in operatorIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="12">
|
||||
<el-form-item label="账号" prop="accountId">
|
||||
<el-select v-model="form.accountId" placeholder="请选择账号">
|
||||
@ -417,15 +277,112 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col>
|
||||
<el-form-item label="成交日期" prop="orderTime">
|
||||
<el-date-picker clearable size="small" style="width: 200px"
|
||||
v-model="form.orderTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择成交日期">
|
||||
</el-date-picker>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="服务月数" prop="serveMonth">
|
||||
<el-select v-model="form.serveMonth" placeholder="请选服务月数">
|
||||
<el-option
|
||||
v-for="dict in serveMonthOption"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="售前" prop="preSaleId">
|
||||
<el-select v-model="form.preSaleId" placeholder="请选择售前">
|
||||
<el-option
|
||||
v-for="dict in preSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="售后" prop="afterSaleId">
|
||||
<el-select v-model="form.afterSaleId" placeholder="请选择售后">
|
||||
<el-option
|
||||
v-for="dict in afterSaleIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="主营养师" prop="nutritionistId">
|
||||
<el-select v-model="form.nutritionistId" placeholder="请选择主营养师">
|
||||
<el-option
|
||||
v-for="dict in nutritionistIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="助理营养师" prop="nutriAssisId">
|
||||
<el-select v-model="form.nutriAssisId" placeholder="请选择助理营养师">
|
||||
<el-option
|
||||
v-for="dict in nutriAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="策划" prop="plannerId">
|
||||
<el-select v-model="form.plannerId" placeholder="请选择策划">
|
||||
<el-option
|
||||
v-for="dict in plannerIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="策划助理" prop="plannerAssisId">
|
||||
<el-select v-model="form.plannerAssisId" placeholder="请选择策划助理">
|
||||
<el-option
|
||||
v-for="dict in plannerAssisIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="运营" prop="operatorId">
|
||||
<el-select v-model="form.operatorId" placeholder="请选择运营">
|
||||
<el-option
|
||||
v-for="dict in operatorIdOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="parseInt(dict.dictValue)"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12" v-hasPermi="['custom:order:review']">
|
||||
<el-form-item label="审核状态" prop="reviewStatus">
|
||||
<el-select v-model="form.reviewStatus" placeholder="请选择审核状态">
|
||||
<el-option
|
||||
v-for="dict in reviewStatusOptions"
|
||||
:key="dict.dictValue"
|
||||
:label="dict.dictLabel"
|
||||
:value="dict.dictValue"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col>
|
||||
@ -487,6 +444,10 @@
|
||||
plannerIdOptions: [],
|
||||
// 账号
|
||||
accountIdOptions: [],
|
||||
// 服务月数
|
||||
serveMonthOption: [],
|
||||
// 审核状态
|
||||
reviewStatusOptions: [],
|
||||
// 策划助理字典
|
||||
plannerAssisIdOptions: [],
|
||||
// 运营字典
|
||||
@ -507,7 +468,8 @@
|
||||
plannerAssisId: null,
|
||||
operatorId: null,
|
||||
recommender: null,
|
||||
orderTime: null
|
||||
orderTime: null,
|
||||
reviewStatus: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@ -519,15 +481,18 @@
|
||||
amount: [
|
||||
{required: true, message: "金额不能为空", trigger: "blur"}
|
||||
],
|
||||
orderTime: [
|
||||
{required: true, message: "成交日期不能为空", trigger: "blur"}
|
||||
],
|
||||
payTypeId: [
|
||||
{required: true, message: "首款方式不能为空", trigger: "blur"}
|
||||
{required: true, message: "收款方式不能为空", trigger: "blur"}
|
||||
],
|
||||
accountId: [
|
||||
{required: true, message: "账号不能为空", trigger: "blur"}
|
||||
]
|
||||
],
|
||||
serveMonth: [
|
||||
{required: true, message: "服务月数不能为空", trigger: "blur"}
|
||||
],
|
||||
// reviewStatus: [
|
||||
// {required: true, message: "请对数据进行审核", trigger: "blur"}
|
||||
// ]
|
||||
},
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
@ -561,7 +526,6 @@
|
||||
created() {
|
||||
this.getList();
|
||||
getOptions().then(response => {
|
||||
console.log(response)
|
||||
const options = response.data.reduce((opts, cur) => {
|
||||
if (!opts[cur.postCode]) {
|
||||
opts[cur.postCode] = [];
|
||||
@ -583,6 +547,12 @@
|
||||
this.getDicts("cus_account").then(response => {
|
||||
this.accountIdOptions = response.data;
|
||||
});
|
||||
this.getDicts("cus_serve_month").then(response => {
|
||||
this.serveMonthOption = response.data;
|
||||
});
|
||||
this.getDicts("cus_review_status").then(response => {
|
||||
this.reviewStatusOptions = response.data;
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
/** 查询销售订单列表 */
|
||||
@ -636,36 +606,29 @@
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
const defaultPayType = this.payTypeIdOptions.find(opt => opt.remark === 'default');
|
||||
this.form = {
|
||||
orderId: null,
|
||||
customer: null,
|
||||
phone: null,
|
||||
amount: null,
|
||||
payTypeId: null,
|
||||
payType: null,
|
||||
payTypeId: defaultPayType ? parseInt(defaultPayType.dictValue) : null,
|
||||
preSaleId: null,
|
||||
createBy: null,
|
||||
preSale: null,
|
||||
createTime: null,
|
||||
afterSaleId: null,
|
||||
updateBy: null,
|
||||
afterSale: null,
|
||||
updateTime: null,
|
||||
nutritionistId: null,
|
||||
remark: null,
|
||||
nutritionist: null,
|
||||
nutriAssisId: null,
|
||||
nutriAssis: null,
|
||||
accountId: null,
|
||||
account: null,
|
||||
plannerId: null,
|
||||
planner: null,
|
||||
plannerAssisId: null,
|
||||
plannerAssis: null,
|
||||
operatorId: null,
|
||||
operator: null,
|
||||
recommender: null,
|
||||
orderTime: null
|
||||
orderTime: null,
|
||||
serveMonth: 1,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
@ -673,33 +636,6 @@
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
// this.getDicts("cus_pay_type").then(response => {
|
||||
// this.payTypeIdOptions = response.data;
|
||||
// });
|
||||
// this.getDicts("cus_pre_sale").then(response => {
|
||||
// this.preSaleIdOptions = response.data;
|
||||
// });
|
||||
// this.getDicts("cus_after_sale").then(response => {
|
||||
// this.afterSaleIdOptions = response.data;
|
||||
// });
|
||||
// this.getDicts("cus_nutri").then(response => {
|
||||
// this.nutritionistIdOptions = response.data;
|
||||
// });
|
||||
// this.getDicts("cus_nutri_assis").then(response => {
|
||||
// this.nutriAssisIdOptions = response.data;
|
||||
// });
|
||||
// this.getDicts("cus_planner").then(response => {
|
||||
// this.plannerIdOptions = response.data;
|
||||
// });
|
||||
// this.getDicts("cus_account").then(response => {
|
||||
// this.accountIdOptions = response.data;
|
||||
// });
|
||||
// this.getDicts("cus_planner_assis").then(response => {
|
||||
// this.plannerAssisIdOptions = response.data;
|
||||
// });
|
||||
// this.getDicts("cus_operator").then(response => {
|
||||
// this.operatorIdOptions = response.data;
|
||||
// });
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
@ -732,19 +668,6 @@
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
|
||||
// console.log(this.form)
|
||||
|
||||
// this.form.payType = this.selectDictLabel(this.payTypeIdOptions, this.form.payTypeId);
|
||||
// this.form.preSale = this.selectDictLabel(this.preSaleIdOptions, this.form.preSaleId);
|
||||
// this.form.afterSale = this.selectDictLabel(this.afterSaleIdOptions, this.form.afterSaleId);
|
||||
// this.form.nutritionist = this.selectDictLabel(this.nutritionistIdOptions, this.form.nutritionistId);
|
||||
// this.form.nutriAssis = this.selectDictLabel(this.nutriAssisIdOptions, this.form.nutriAssisId);
|
||||
// this.form.account = this.selectDictLabel(this.accountIdOptions, this.form.accountId);
|
||||
// this.form.planner = this.selectDictLabel(this.plannerIdOptions, this.form.plannerId);
|
||||
// this.form.plannerAssis = this.selectDictLabel(this.plannerAssisIdOptions, this.form.plannerAssisId);
|
||||
// this.form.operator = this.selectDictLabel(this.operatorIdOptions, this.form.operatorId);
|
||||
|
||||
if (this.form.orderId != null) {
|
||||
updateOrder(this.form).then(response => {
|
||||
if (response.code === 200) {
|
||||
|
@ -712,27 +712,20 @@ create table sys_order (
|
||||
order_id bigint(20) not null auto_increment comment '编号',
|
||||
customer varchar(30) not null comment '客户姓名',
|
||||
phone varchar(30) comment '电话',
|
||||
review_status varchar(10) default 'no' comment '审核状态',
|
||||
pay_type_id bigint(20) comment '收款方式ID',
|
||||
pay_type varchar(30) comment '收款方式',
|
||||
pre_sale_id bigint(20) comment '售前ID',
|
||||
pre_sale varchar(30) comment '售前',
|
||||
after_sale_id bigint(20) comment '售后ID',
|
||||
after_sale varchar(30) comment '售后',
|
||||
nutritionist_id bigint(20) comment '营养师ID',
|
||||
nutritionist varchar(30) comment '营养师',
|
||||
nutri_assis_id bigint(20) comment '助理营养师ID',
|
||||
nutri_assis varchar(30) comment '助理营养师',
|
||||
account_id bigint(20) comment '账号ID',
|
||||
account varchar(30) comment '账号',
|
||||
planner_id bigint(20) comment '策划ID',
|
||||
planner varchar(30) comment '策划',
|
||||
planner_assis_id bigint(20) comment '策划助理ID',
|
||||
planner_assis varchar(30) comment '策划助理',
|
||||
operator_id bigint(20) comment '运营ID',
|
||||
operator varchar(30) comment '运营',
|
||||
recommender varchar(30) comment '推荐人',
|
||||
serve_month tinyint comment '服务月数',
|
||||
amount decimal(10,2) comment '金额',
|
||||
order_time datetime comment '成交日期',
|
||||
order_time datetime comment '成交日期',
|
||||
create_by varchar(64) default '' comment '创建者',
|
||||
create_time datetime comment '创建时间',
|
||||
update_by varchar(64) default '' comment '更新者',
|
||||
|
Loading…
x
Reference in New Issue
Block a user