完善订单功能
This commit is contained in:
parent
58f276922f
commit
41fb244499
@ -1,6 +1,14 @@
|
||||
package com.ruoyi.web.controller.custom;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
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.ISysUserService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@ -28,31 +36,36 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/custom/order")
|
||||
public class SysOrderController extends BaseController
|
||||
{
|
||||
public class SysOrderController extends BaseController {
|
||||
@Autowired
|
||||
private ISysOrderService sysOrderService;
|
||||
|
||||
@Autowired
|
||||
private ISysPostService postService;
|
||||
|
||||
@Autowired
|
||||
private ISysUserService userService;
|
||||
|
||||
|
||||
/**
|
||||
* 查询销售订单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(SysOrder sysOrder)
|
||||
{
|
||||
public TableDataInfo list(SysOrder sysOrder) {
|
||||
startPage();
|
||||
List<SysOrder> list = sysOrderService.selectSysOrderList(sysOrder);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 导出销售订单列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:export')")
|
||||
@Log(title = "销售订单", businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export")
|
||||
public AjaxResult export(SysOrder sysOrder)
|
||||
{
|
||||
public AjaxResult export(SysOrder sysOrder) {
|
||||
List<SysOrder> list = sysOrderService.selectSysOrderList(sysOrder);
|
||||
ExcelUtil<SysOrder> util = new ExcelUtil<SysOrder>(SysOrder.class);
|
||||
return util.exportExcel(list, "order");
|
||||
@ -63,8 +76,7 @@ public class SysOrderController extends BaseController
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:query')")
|
||||
@GetMapping(value = "/{orderId}")
|
||||
public AjaxResult getInfo(@PathVariable("orderId") Long orderId)
|
||||
{
|
||||
public AjaxResult getInfo(@PathVariable("orderId") Long orderId) {
|
||||
return AjaxResult.success(sysOrderService.selectSysOrderById(orderId));
|
||||
}
|
||||
|
||||
@ -74,8 +86,7 @@ public class SysOrderController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:add')")
|
||||
@Log(title = "销售订单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SysOrder sysOrder)
|
||||
{
|
||||
public AjaxResult add(@RequestBody SysOrder sysOrder) {
|
||||
return toAjax(sysOrderService.insertSysOrder(sysOrder));
|
||||
}
|
||||
|
||||
@ -85,8 +96,7 @@ public class SysOrderController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:edit')")
|
||||
@Log(title = "销售订单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SysOrder sysOrder)
|
||||
{
|
||||
public AjaxResult edit(@RequestBody SysOrder sysOrder) {
|
||||
return toAjax(sysOrderService.updateSysOrder(sysOrder));
|
||||
}
|
||||
|
||||
@ -96,8 +106,29 @@ public class SysOrderController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('custom:order:remove')")
|
||||
@Log(title = "销售订单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{orderIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] orderIds)
|
||||
{
|
||||
public AjaxResult remove(@PathVariable Long[] orderIds) {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
@ -1,57 +1,60 @@
|
||||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/ry-vue?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: wonderdb
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username:
|
||||
login-password:
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
# 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
|
||||
password: 9gPUnV$#2s/j(7_(
|
||||
username: root
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
enabled: false
|
||||
url:
|
||||
username:
|
||||
password:
|
||||
# 初始连接数
|
||||
initialSize: 5
|
||||
# 最小连接池数量
|
||||
minIdle: 10
|
||||
# 最大连接池数量
|
||||
maxActive: 20
|
||||
# 配置获取连接等待超时的时间
|
||||
maxWait: 60000
|
||||
# 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
||||
timeBetweenEvictionRunsMillis: 60000
|
||||
# 配置一个连接在池中最小生存的时间,单位是毫秒
|
||||
minEvictableIdleTimeMillis: 300000
|
||||
# 配置一个连接在池中最大生存的时间,单位是毫秒
|
||||
maxEvictableIdleTimeMillis: 900000
|
||||
# 配置检测连接是否有效
|
||||
validationQuery: SELECT 1 FROM DUAL
|
||||
testWhileIdle: true
|
||||
testOnBorrow: false
|
||||
testOnReturn: false
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
statViewServlet:
|
||||
enabled: true
|
||||
# 设置白名单,不填则允许所有访问
|
||||
allow:
|
||||
url-pattern: /druid/*
|
||||
# 控制台管理用户名和密码
|
||||
login-username:
|
||||
login-password:
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
multi-statement-allow: true
|
@ -0,0 +1,43 @@
|
||||
package com.ruoyi.system.domain.custom;
|
||||
|
||||
public class UserPostOption {
|
||||
|
||||
private Long userId;
|
||||
|
||||
private String userName;
|
||||
|
||||
private String postCode;
|
||||
|
||||
public String getPostCode() {
|
||||
return postCode;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setPostCode(String postCode) {
|
||||
this.postCode = postCode;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "UserPostOption{" +
|
||||
"userId=" + userId +
|
||||
", userName='" + userName + '\'' +
|
||||
", postCode='" + postCode + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -1,15 +1,16 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
import com.ruoyi.system.domain.SysUserPost;
|
||||
|
||||
/**
|
||||
* 岗位信息 数据层
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface SysPostMapper
|
||||
{
|
||||
public interface SysPostMapper {
|
||||
/**
|
||||
* 查询岗位数据集合
|
||||
*
|
||||
@ -25,6 +26,8 @@ public interface SysPostMapper
|
||||
*/
|
||||
public List<SysPost> selectPostAll();
|
||||
|
||||
public List<SysUserPost> selectUserPostAll();
|
||||
|
||||
/**
|
||||
* 通过岗位ID查询岗位信息
|
||||
*
|
||||
|
@ -1,6 +1,7 @@
|
||||
package com.ruoyi.system.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.system.domain.SysUserPost;
|
||||
|
||||
/**
|
||||
@ -8,8 +9,8 @@ import com.ruoyi.system.domain.SysUserPost;
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public interface SysUserPostMapper
|
||||
{
|
||||
public interface SysUserPostMapper {
|
||||
|
||||
/**
|
||||
* 通过用户ID删除用户和岗位关联
|
||||
*
|
||||
|
@ -2,6 +2,7 @@ package com.ruoyi.system.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.system.domain.SysPost;
|
||||
import com.ruoyi.system.domain.SysUserPost;
|
||||
|
||||
/**
|
||||
* 岗位信息 服务层
|
||||
@ -18,6 +19,8 @@ public interface ISysPostService
|
||||
*/
|
||||
public List<SysPost> selectPostList(SysPost post);
|
||||
|
||||
public List<SysUserPost> selectUserPostAll();
|
||||
|
||||
/**
|
||||
* 查询所有岗位
|
||||
*
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.ruoyi.system.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.system.domain.SysUserPost;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.common.constant.UserConstants;
|
||||
@ -48,6 +50,11 @@ public class SysPostServiceImpl implements ISysPostService
|
||||
return postMapper.selectPostAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUserPost> selectUserPostAll() {
|
||||
return postMapper.selectUserPostAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过岗位ID查询岗位信息
|
||||
*
|
||||
|
@ -1,52 +1,65 @@
|
||||
<?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">
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.mapper.SysPostMapper">
|
||||
|
||||
<resultMap type="SysPost" id="SysPostResult">
|
||||
<id property="postId" column="post_id" />
|
||||
<result property="postCode" column="post_code" />
|
||||
<result property="postName" column="post_name" />
|
||||
<result property="postSort" column="post_sort" />
|
||||
<result property="status" column="status" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
<resultMap type="SysPost" id="SysPostResult">
|
||||
<id property="postId" column="post_id"/>
|
||||
<result property="postCode" column="post_code"/>
|
||||
<result property="postName" column="post_name"/>
|
||||
<result property="postSort" column="post_sort"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPostVo">
|
||||
<resultMap id="SysUserPostResult" type="SysUserPost">
|
||||
<id property="userId" column="user_id"/>
|
||||
<result property="postId" column="post_id"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectPostVo">
|
||||
select post_id, post_code, post_name, post_sort, status, create_by, create_time, remark
|
||||
from sys_post
|
||||
</sql>
|
||||
|
||||
<select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
<where>
|
||||
<if test="postCode != null and postCode != ''">
|
||||
AND post_code like concat('%', #{postCode}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="postName != null and postName != ''">
|
||||
AND post_name like concat('%', #{postName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
<sql id="selectUserPostVo">
|
||||
select * from sys_user_post
|
||||
</sql>
|
||||
|
||||
<select id="selectPostAll" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
</select>
|
||||
<select id="selectPostList" parameterType="SysPost" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
<where>
|
||||
<if test="postCode != null and postCode != ''">
|
||||
AND post_code like concat('%', #{postCode}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
<if test="postName != null and postName != ''">
|
||||
AND post_name like concat('%', #{postName}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectPostById" parameterType="Long" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_id = #{postId}
|
||||
</select>
|
||||
<select id="selectPostAll" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectPostListByUserId" parameterType="Long" resultType="Integer">
|
||||
<select id="selectUserPostAll" resultMap="SysUserPostResult">
|
||||
<include refid="selectUserPostVo"/>
|
||||
</select>
|
||||
|
||||
<select id="selectPostById" parameterType="Long" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_id = #{postId}
|
||||
</select>
|
||||
|
||||
<select id="selectPostListByUserId" parameterType="Long" resultType="Integer">
|
||||
select p.post_id
|
||||
from sys_post p
|
||||
left join sys_user_post up on up.post_id = p.post_id
|
||||
@ -54,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where u.user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
|
||||
<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
|
||||
select p.post_id, p.post_name, p.post_code
|
||||
from sys_post p
|
||||
left join sys_user_post up on up.post_id = p.post_id
|
||||
@ -62,61 +75,61 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where u.user_name = #{userName}
|
||||
</select>
|
||||
|
||||
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_name=#{postName} limit 1
|
||||
</select>
|
||||
<select id="checkPostNameUnique" parameterType="String" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_name=#{postName} limit 1
|
||||
</select>
|
||||
|
||||
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_code=#{postCode} limit 1
|
||||
</select>
|
||||
<select id="checkPostCodeUnique" parameterType="String" resultMap="SysPostResult">
|
||||
<include refid="selectPostVo"/>
|
||||
where post_code=#{postCode} limit 1
|
||||
</select>
|
||||
|
||||
<update id="updatePost" parameterType="SysPost">
|
||||
update sys_post
|
||||
<set>
|
||||
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
|
||||
<if test="postName != null and postName != ''">post_name = #{postName},</if>
|
||||
<if test="postSort != null and postSort != ''">post_sort = #{postSort},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where post_id = #{postId}
|
||||
</update>
|
||||
<update id="updatePost" parameterType="SysPost">
|
||||
update sys_post
|
||||
<set>
|
||||
<if test="postCode != null and postCode != ''">post_code = #{postCode},</if>
|
||||
<if test="postName != null and postName != ''">post_name = #{postName},</if>
|
||||
<if test="postSort != null and postSort != ''">post_sort = #{postSort},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
|
||||
update_time = sysdate()
|
||||
</set>
|
||||
where post_id = #{postId}
|
||||
</update>
|
||||
|
||||
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
|
||||
insert into sys_post(
|
||||
<if test="postId != null and postId != 0">post_id,</if>
|
||||
<if test="postCode != null and postCode != ''">post_code,</if>
|
||||
<if test="postName != null and postName != ''">post_name,</if>
|
||||
<if test="postSort != null and postSort != ''">post_sort,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="postId != null and postId != 0">#{postId},</if>
|
||||
<if test="postCode != null and postCode != ''">#{postCode},</if>
|
||||
<if test="postName != null and postName != ''">#{postName},</if>
|
||||
<if test="postSort != null and postSort != ''">#{postSort},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertPost" parameterType="SysPost" useGeneratedKeys="true" keyProperty="postId">
|
||||
insert into sys_post(
|
||||
<if test="postId != null and postId != 0">post_id,</if>
|
||||
<if test="postCode != null and postCode != ''">post_code,</if>
|
||||
<if test="postName != null and postName != ''">post_name,</if>
|
||||
<if test="postSort != null and postSort != ''">post_sort,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="remark != null and remark != ''">remark,</if>
|
||||
<if test="createBy != null and createBy != ''">create_by,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="postId != null and postId != 0">#{postId},</if>
|
||||
<if test="postCode != null and postCode != ''">#{postCode},</if>
|
||||
<if test="postName != null and postName != ''">#{postName},</if>
|
||||
<if test="postSort != null and postSort != ''">#{postSort},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="remark != null and remark != ''">#{remark},</if>
|
||||
<if test="createBy != null and createBy != ''">#{createBy},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deletePostById" parameterType="Long">
|
||||
<delete id="deletePostById" parameterType="Long">
|
||||
delete from sys_post where post_id = #{postId}
|
||||
</delete>
|
||||
|
||||
<delete id="deletePostByIds" parameterType="Long">
|
||||
delete from sys_post where post_id in
|
||||
<foreach collection="array" item="postId" open="(" separator="," close=")">
|
||||
#{postId}
|
||||
<delete id="deletePostByIds" parameterType="Long">
|
||||
delete from sys_post where post_id in
|
||||
<foreach collection="array" item="postId" open="(" separator="," close=")">
|
||||
#{postId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
@ -2,10 +2,18 @@ import request from '@/utils/request'
|
||||
|
||||
// 查询销售订单列表
|
||||
export function listOrder(query) {
|
||||
const [fromOrderTime, toOrderTime] = query.orderTime || [null, null];
|
||||
const params = {
|
||||
...query,
|
||||
fromOrderTime,
|
||||
toOrderTime,
|
||||
orderTime: null
|
||||
}
|
||||
|
||||
return request({
|
||||
url: '/custom/order/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
params: params
|
||||
})
|
||||
}
|
||||
|
||||
@ -51,3 +59,10 @@ export function exportOrder(query) {
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function getOptions() {
|
||||
return request({
|
||||
url: '/custom/order/getOptions',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ export default {
|
||||
props: {
|
||||
showSearch: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -14,17 +14,17 @@
|
||||
</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-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-form-item label="收款方式" prop="payTypeId">
|
||||
@ -141,14 +141,31 @@
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-col :span="4">
|
||||
<el-col :span="8">
|
||||
<el-form-item label="成交日期" prop="orderTime">
|
||||
<el-date-picker clearable size="small" style="width: 200px"
|
||||
v-model="queryParams.orderTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="选择成交日期">
|
||||
|
||||
<el-date-picker
|
||||
v-model="queryParams.orderTime"
|
||||
type="daterange"
|
||||
size="small"
|
||||
align="right"
|
||||
unlink-panels
|
||||
range-separator="至"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
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>
|
||||
|
||||
@ -432,7 +449,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listOrder, getOrder, delOrder, addOrder, updateOrder, exportOrder} from "@/api/custom/order";
|
||||
import {listOrder, getOrder, delOrder, addOrder, updateOrder, exportOrder, getOptions} from "@/api/custom/order";
|
||||
|
||||
export default {
|
||||
name: "Order",
|
||||
@ -447,7 +464,7 @@
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
showSearch: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 销售订单表格数据
|
||||
@ -504,39 +521,68 @@
|
||||
],
|
||||
orderTime: [
|
||||
{required: true, message: "成交日期不能为空", trigger: "blur"}
|
||||
],
|
||||
payTypeId: [
|
||||
{required: true, message: "首款方式不能为空", trigger: "blur"}
|
||||
],
|
||||
accountId: [
|
||||
{required: true, message: "账号不能为空", trigger: "blur"}
|
||||
]
|
||||
}
|
||||
},
|
||||
pickerOptions: {
|
||||
shortcuts: [{
|
||||
text: '最近一周',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}, {
|
||||
text: '最近一个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}, {
|
||||
text: '最近三个月',
|
||||
onClick(picker) {
|
||||
const end = new Date();
|
||||
const start = new Date();
|
||||
start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
|
||||
picker.$emit('pick', [start, end]);
|
||||
}
|
||||
}]
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
getOptions().then(response => {
|
||||
console.log(response)
|
||||
const options = response.data.reduce((opts, cur) => {
|
||||
if (!opts[cur.postCode]) {
|
||||
opts[cur.postCode] = [];
|
||||
}
|
||||
opts[cur.postCode].push({dictValue: cur.userId, dictLabel: cur.userName})
|
||||
return opts;
|
||||
}, {})
|
||||
this.preSaleIdOptions = options['pre_sale'] || [];
|
||||
this.afterSaleIdOptions = options['after_sale'] || [];
|
||||
this.nutritionistIdOptions = options['nutri'] || [];
|
||||
this.nutriAssisIdOptions = options['nutri_assis'] || [];
|
||||
this.plannerIdOptions = options['planner'] || [];
|
||||
this.plannerAssisIdOptions = options['planner_assis'] || [];
|
||||
this.operatorIdOptions = options['operator'] || [];
|
||||
})
|
||||
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;
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
/** 查询销售订单列表 */
|
||||
@ -627,33 +673,33 @@
|
||||
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_custom").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;
|
||||
});
|
||||
// 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() {
|
||||
@ -687,7 +733,7 @@
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
|
||||
console.log(this.form)
|
||||
// console.log(this.form)
|
||||
|
||||
this.form.payType = this.selectDictLabel(this.payTypeIdOptions, this.form.payTypeId);
|
||||
this.form.preSale = this.selectDictLabel(this.preSaleIdOptions, this.form.preSaleId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user