订单管理初始化
This commit is contained in:
parent
e820df43e3
commit
df1baa40f7
|
|
@ -0,0 +1,126 @@
|
|||
package com.ruoyi.busi.controller;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.busi.domain.BusiOrder;
|
||||
import com.ruoyi.busi.service.IBusiOrderService;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 订单Controller
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-21
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/busi/order")
|
||||
public class BusiOrderController extends BaseController
|
||||
{
|
||||
private String prefix = "busi/order";
|
||||
|
||||
@Autowired
|
||||
private IBusiOrderService busiOrderService;
|
||||
|
||||
@RequiresPermissions("busi:order:view")
|
||||
@GetMapping()
|
||||
public String order()
|
||||
{
|
||||
return prefix + "/order";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*/
|
||||
@RequiresPermissions("busi:order:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BusiOrder busiOrder)
|
||||
{
|
||||
startPage();
|
||||
List<BusiOrder> list = busiOrderService.selectBusiOrderList(busiOrder);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出订单列表
|
||||
*/
|
||||
@RequiresPermissions("busi:order:export")
|
||||
@Log(title = "订单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BusiOrder busiOrder)
|
||||
{
|
||||
List<BusiOrder> list = busiOrderService.selectBusiOrderList(busiOrder);
|
||||
ExcelUtil<BusiOrder> util = new ExcelUtil<BusiOrder>(BusiOrder.class);
|
||||
return util.exportExcel(list, "订单数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存订单
|
||||
*/
|
||||
@RequiresPermissions("busi:order:add")
|
||||
@Log(title = "订单", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BusiOrder busiOrder)
|
||||
{
|
||||
return toAjax(busiOrderService.insertBusiOrder(busiOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*/
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") String id, ModelMap mmap)
|
||||
{
|
||||
BusiOrder busiOrder = busiOrderService.selectBusiOrderById(id);
|
||||
mmap.put("busiOrder", busiOrder);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存订单
|
||||
*/
|
||||
@RequiresPermissions("busi:order:edit")
|
||||
@Log(title = "订单", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BusiOrder busiOrder)
|
||||
{
|
||||
return toAjax(busiOrderService.updateBusiOrder(busiOrder));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*/
|
||||
@RequiresPermissions("busi:order:remove")
|
||||
@Log(title = "订单", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(busiOrderService.deleteBusiOrderByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,167 @@
|
|||
package com.ruoyi.busi.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 订单对象 busi_order
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-21
|
||||
*/
|
||||
public class BusiOrder extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID主键 */
|
||||
private String id;
|
||||
|
||||
/** 客户公司ID */
|
||||
private String companyId;
|
||||
|
||||
/** 客户公司名称 */
|
||||
@Excel(name = "客户公司")
|
||||
private String companyName;
|
||||
|
||||
/** 订单名称 */
|
||||
@Excel(name = "订单名称")
|
||||
private String orderName;
|
||||
|
||||
/** 款号标识码 */
|
||||
@Excel(name = "款号标识码")
|
||||
private String identificationCode;
|
||||
|
||||
/** 订单价格 */
|
||||
@Excel(name = "订单价格")
|
||||
private BigDecimal price;
|
||||
|
||||
/** 类型 */
|
||||
@Excel(name = "类型")
|
||||
private String classify;
|
||||
|
||||
/** 转换比例(米/件) */
|
||||
@Excel(name = "转换比例(米/件)")
|
||||
private BigDecimal ratio;
|
||||
|
||||
/** 状态 */
|
||||
@Excel(name = "状态")
|
||||
private String status;
|
||||
|
||||
/** 产品需求信息 */
|
||||
private List<BusiProductRequire> busiProductRequireList;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setCompanyId(String companyId)
|
||||
{
|
||||
this.companyId = companyId;
|
||||
}
|
||||
|
||||
public String getCompanyId()
|
||||
{
|
||||
return companyId;
|
||||
}
|
||||
public void setOrderName(String orderName)
|
||||
{
|
||||
this.orderName = orderName;
|
||||
}
|
||||
|
||||
public String getOrderName()
|
||||
{
|
||||
return orderName;
|
||||
}
|
||||
public void setIdentificationCode(String identificationCode)
|
||||
{
|
||||
this.identificationCode = identificationCode;
|
||||
}
|
||||
|
||||
public String getIdentificationCode()
|
||||
{
|
||||
return identificationCode;
|
||||
}
|
||||
public void setPrice(BigDecimal price)
|
||||
{
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice()
|
||||
{
|
||||
return price;
|
||||
}
|
||||
public void setClassify(String classify)
|
||||
{
|
||||
this.classify = classify;
|
||||
}
|
||||
|
||||
public String getClassify()
|
||||
{
|
||||
return classify;
|
||||
}
|
||||
public void setRatio(BigDecimal ratio)
|
||||
{
|
||||
this.ratio = ratio;
|
||||
}
|
||||
|
||||
public BigDecimal getRatio()
|
||||
{
|
||||
return ratio;
|
||||
}
|
||||
public void setStatus(String status)
|
||||
{
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getStatus()
|
||||
{
|
||||
return status;
|
||||
}
|
||||
|
||||
public String getCompanyName() {
|
||||
return companyName;
|
||||
}
|
||||
|
||||
public void setCompanyName(String companyName) {
|
||||
this.companyName = companyName;
|
||||
}
|
||||
|
||||
public List<BusiProductRequire> getBusiProductRequireList()
|
||||
{
|
||||
return busiProductRequireList;
|
||||
}
|
||||
|
||||
public void setBusiProductRequireList(List<BusiProductRequire> busiProductRequireList)
|
||||
{
|
||||
this.busiProductRequireList = busiProductRequireList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("companyId", getCompanyId())
|
||||
.append("companyName", getCompanyName())
|
||||
.append("orderName", getOrderName())
|
||||
.append("identificationCode", getIdentificationCode())
|
||||
.append("price", getPrice())
|
||||
.append("classify", getClassify())
|
||||
.append("ratio", getRatio())
|
||||
.append("status", getStatus())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("busiProductRequireList", getBusiProductRequireList())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,114 @@
|
|||
package com.ruoyi.busi.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 产品需求对象 busi_product_require
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-21
|
||||
*/
|
||||
public class BusiProductRequire extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID主键 */
|
||||
private String id;
|
||||
|
||||
/** 订单名称 */
|
||||
@Excel(name = "订单名称")
|
||||
private String orderId;
|
||||
|
||||
/** 数量 */
|
||||
@Excel(name = "数量")
|
||||
private Long amount;
|
||||
|
||||
/** 尺码 */
|
||||
@Excel(name = "尺码")
|
||||
private String size;
|
||||
|
||||
/** 颜色 */
|
||||
@Excel(name = "颜色")
|
||||
private String color;
|
||||
|
||||
/** 截止日期 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "截止日期", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
private Date endDate;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setOrderId(String orderId)
|
||||
{
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getOrderId()
|
||||
{
|
||||
return orderId;
|
||||
}
|
||||
public void setAmount(Long amount)
|
||||
{
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public Long getAmount()
|
||||
{
|
||||
return amount;
|
||||
}
|
||||
public void setSize(String size)
|
||||
{
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public String getSize()
|
||||
{
|
||||
return size;
|
||||
}
|
||||
public void setColor(String color)
|
||||
{
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public String getColor()
|
||||
{
|
||||
return color;
|
||||
}
|
||||
public void setEndDate(Date endDate)
|
||||
{
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public Date getEndDate()
|
||||
{
|
||||
return endDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("orderId", getOrderId())
|
||||
.append("amount", getAmount())
|
||||
.append("size", getSize())
|
||||
.append("color", getColor())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("endDate", getEndDate())
|
||||
.toString();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
package com.ruoyi.busi.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.busi.domain.BusiOrder;
|
||||
import com.ruoyi.busi.domain.BusiProductRequire;
|
||||
|
||||
/**
|
||||
* 订单Mapper接口
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-21
|
||||
*/
|
||||
public interface BusiOrderMapper
|
||||
{
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 订单
|
||||
*/
|
||||
public BusiOrder selectBusiOrderById(String id);
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*
|
||||
* @param busiOrder 订单
|
||||
* @return 订单集合
|
||||
*/
|
||||
public List<BusiOrder> selectBusiOrderList(BusiOrder busiOrder);
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
* @param busiOrder 订单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBusiOrder(BusiOrder busiOrder);
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*
|
||||
* @param busiOrder 订单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBusiOrder(BusiOrder busiOrder);
|
||||
|
||||
/**
|
||||
* 删除订单
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiOrderById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiOrderByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 批量删除产品需求
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiProductRequireByOrderIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 批量新增产品需求
|
||||
*
|
||||
* @param busiProductRequireList 产品需求列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchBusiProductRequire(List<BusiProductRequire> busiProductRequireList);
|
||||
|
||||
|
||||
/**
|
||||
* 通过订单主键删除产品需求信息
|
||||
*
|
||||
* @param id 订单ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiProductRequireByOrderId(String id);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.busi.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.busi.domain.BusiOrder;
|
||||
|
||||
/**
|
||||
* 订单Service接口
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-21
|
||||
*/
|
||||
public interface IBusiOrderService
|
||||
{
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 订单
|
||||
*/
|
||||
public BusiOrder selectBusiOrderById(String id);
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*
|
||||
* @param busiOrder 订单
|
||||
* @return 订单集合
|
||||
*/
|
||||
public List<BusiOrder> selectBusiOrderList(BusiOrder busiOrder);
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
* @param busiOrder 订单
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBusiOrder(BusiOrder busiOrder);
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*
|
||||
* @param busiOrder 订单
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBusiOrder(BusiOrder busiOrder);
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*
|
||||
* @param ids 需要删除的订单主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiOrderByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除订单信息
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiOrderById(String id);
|
||||
}
|
||||
|
|
@ -0,0 +1,134 @@
|
|||
package com.ruoyi.busi.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.ruoyi.busi.domain.BusiProductRequire;
|
||||
import com.ruoyi.busi.mapper.BusiOrderMapper;
|
||||
import com.ruoyi.busi.domain.BusiOrder;
|
||||
import com.ruoyi.busi.service.IBusiOrderService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 订单Service业务层处理
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-21
|
||||
*/
|
||||
@Service
|
||||
public class BusiOrderServiceImpl implements IBusiOrderService
|
||||
{
|
||||
@Autowired
|
||||
private BusiOrderMapper busiOrderMapper;
|
||||
|
||||
/**
|
||||
* 查询订单
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 订单
|
||||
*/
|
||||
@Override
|
||||
public BusiOrder selectBusiOrderById(String id)
|
||||
{
|
||||
return busiOrderMapper.selectBusiOrderById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询订单列表
|
||||
*
|
||||
* @param busiOrder 订单
|
||||
* @return 订单
|
||||
*/
|
||||
@Override
|
||||
public List<BusiOrder> selectBusiOrderList(BusiOrder busiOrder)
|
||||
{
|
||||
return busiOrderMapper.selectBusiOrderList(busiOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增订单
|
||||
*
|
||||
* @param busiOrder 订单
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insertBusiOrder(BusiOrder busiOrder)
|
||||
{
|
||||
busiOrder.setCreateTime(DateUtils.getNowDate());
|
||||
int rows = busiOrderMapper.insertBusiOrder(busiOrder);
|
||||
insertBusiProductRequire(busiOrder);
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改订单
|
||||
*
|
||||
* @param busiOrder 订单
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int updateBusiOrder(BusiOrder busiOrder)
|
||||
{
|
||||
busiOrder.setUpdateTime(DateUtils.getNowDate());
|
||||
busiOrderMapper.deleteBusiProductRequireByOrderId(busiOrder.getId());
|
||||
insertBusiProductRequire(busiOrder);
|
||||
return busiOrderMapper.updateBusiOrder(busiOrder);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除订单
|
||||
*
|
||||
* @param ids 需要删除的订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteBusiOrderByIds(String ids)
|
||||
{
|
||||
busiOrderMapper.deleteBusiProductRequireByOrderIds(Convert.toStrArray(ids));
|
||||
return busiOrderMapper.deleteBusiOrderByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除订单信息
|
||||
*
|
||||
* @param id 订单主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBusiOrderById(String id)
|
||||
{
|
||||
busiOrderMapper.deleteBusiProductRequireByOrderId(id);
|
||||
return busiOrderMapper.deleteBusiOrderById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品需求信息
|
||||
*
|
||||
* @param busiOrder 订单对象
|
||||
*/
|
||||
public void insertBusiProductRequire(BusiOrder busiOrder)
|
||||
{
|
||||
List<BusiProductRequire> busiProductRequireList = busiOrder.getBusiProductRequireList();
|
||||
String id = busiOrder.getId();
|
||||
if (StringUtils.isNotNull(busiProductRequireList))
|
||||
{
|
||||
List<BusiProductRequire> list = new ArrayList<BusiProductRequire>();
|
||||
for (BusiProductRequire busiProductRequire : busiProductRequireList)
|
||||
{
|
||||
busiProductRequire.setOrderId(id);
|
||||
list.add(busiProductRequire);
|
||||
}
|
||||
if (list.size() > 0)
|
||||
{
|
||||
busiOrderMapper.batchBusiProductRequire(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,57 +1,58 @@
|
|||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: 12345678
|
||||
# 从库数据源
|
||||
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: admin
|
||||
login-password: 123456
|
||||
filter:
|
||||
stat:
|
||||
enabled: true
|
||||
# 慢SQL记录
|
||||
log-slow-sql: true
|
||||
slow-sql-millis: 1000
|
||||
merge-sql: true
|
||||
wall:
|
||||
config:
|
||||
# 数据源配置
|
||||
spring:
|
||||
datasource:
|
||||
type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: com.mysql.cj.jdbc.Driver
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
url: jdbc:mysql://localhost:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://49.234.33.172:3306/ry?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: 12345678
|
||||
# 从库数据源
|
||||
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: admin
|
||||
login-password: 123456
|
||||
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,141 @@
|
|||
<?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.busi.mapper.BusiOrderMapper">
|
||||
|
||||
<resultMap type="BusiOrder" id="BusiOrderResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="companyId" column="company_id" />
|
||||
<result property="companyName" column="company_name" />
|
||||
<result property="orderName" column="order_name" />
|
||||
<result property="identificationCode" column="identification_code" />
|
||||
<result property="price" column="price" />
|
||||
<result property="classify" column="classify" />
|
||||
<result property="ratio" column="ratio" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="BusiOrderBusiProductRequireResult" type="BusiOrder" extends="BusiOrderResult">
|
||||
<collection property="busiProductRequireList" notNullColumn="sub_id" javaType="java.util.List" resultMap="BusiProductRequireResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="BusiProductRequire" id="BusiProductRequireResult">
|
||||
<result property="id" column="sub_id" />
|
||||
<result property="orderId" column="sub_order_id" />
|
||||
<result property="amount" column="sub_amount" />
|
||||
<result property="size" column="sub_size" />
|
||||
<result property="color" column="sub_color" />
|
||||
<result property="createBy" column="sub_create_by" />
|
||||
<result property="createTime" column="sub_create_time" />
|
||||
<result property="updateBy" column="sub_update_by" />
|
||||
<result property="updateTime" column="sub_update_time" />
|
||||
<result property="endDate" column="sub_end_date" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBusiOrderVo">
|
||||
select A.id, A.company_id, B.co_name company_name, A.order_name, A.identification_code, A.price, A.classify, A.ratio, A.status, A.create_by, A.create_time, A.update_by, A.update_time
|
||||
from busi_order A LEFT JOIN busi_customer_company B on A.company_id = B.id
|
||||
</sql>
|
||||
|
||||
<select id="selectBusiOrderList" parameterType="BusiOrder" resultMap="BusiOrderResult">
|
||||
<include refid="selectBusiOrderVo"/>
|
||||
<where>
|
||||
<if test="companyId != null and companyId != ''"> and A.company_id = #{companyId}</if>
|
||||
<if test="orderName != null and orderName != ''"> and A.order_name like concat('%', #{orderName}, '%')</if>
|
||||
<if test="identificationCode != null and identificationCode != ''"> and A.identification_code like concat('%', #{identificationCode}, '%')</if>
|
||||
<if test="classify != null and classify != ''"> and A.classify = #{classify}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBusiOrderById" parameterType="String" resultMap="BusiOrderBusiProductRequireResult">
|
||||
select a.id, a.company_id, c.co_name company_name, a.order_name, a.identification_code, a.price, a.classify, a.ratio, a.status, a.create_by, a.create_time, a.update_by, a.update_time,
|
||||
b.id as sub_id, b.order_id as sub_order_id, b.amount as sub_amount, b.size as sub_size, b.color as sub_color, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time, b.end_date as sub_end_date
|
||||
from busi_order a
|
||||
left join busi_product_require b on b.order_id = a.id
|
||||
left join busi_customer_company c on a.company_id = c.id
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBusiOrder" parameterType="BusiOrder" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into busi_order
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="companyId != null and companyId != ''">company_id,</if>
|
||||
<if test="orderName != null and orderName != ''">order_name,</if>
|
||||
<if test="identificationCode != null and identificationCode != ''">identification_code,</if>
|
||||
<if test="price != null">price,</if>
|
||||
<if test="classify != null and classify != ''">classify,</if>
|
||||
<if test="ratio != null">ratio,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="companyId != null and companyId != ''">#{companyId},</if>
|
||||
<if test="orderName != null and orderName != ''">#{orderName},</if>
|
||||
<if test="identificationCode != null and identificationCode != ''">#{identificationCode},</if>
|
||||
<if test="price != null">#{price},</if>
|
||||
<if test="classify != null and classify != ''">#{classify},</if>
|
||||
<if test="ratio != null">#{ratio},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBusiOrder" parameterType="BusiOrder">
|
||||
update busi_order
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="companyId != null and companyId != ''">company_id = #{companyId},</if>
|
||||
<if test="orderName != null and orderName != ''">order_name = #{orderName},</if>
|
||||
<if test="identificationCode != null and identificationCode != ''">identification_code = #{identificationCode},</if>
|
||||
<if test="price != null">price = #{price},</if>
|
||||
<if test="classify != null and classify != ''">classify = #{classify},</if>
|
||||
<if test="ratio != null">ratio = #{ratio},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBusiOrderById" parameterType="String">
|
||||
delete from busi_order where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBusiOrderByIds" parameterType="String">
|
||||
delete from busi_order where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBusiProductRequireByOrderIds" parameterType="String">
|
||||
delete from busi_product_require where order_id in
|
||||
<foreach item="orderId" collection="array" open="(" separator="," close=")">
|
||||
#{orderId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBusiProductRequireByOrderId" parameterType="String">
|
||||
delete from busi_product_require where order_id = #{orderId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchBusiProductRequire">
|
||||
insert into busi_product_require( id, order_id, amount, size, color, create_by, create_time, update_by, update_time, end_date) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.id}, #{item.orderId}, #{item.amount}, #{item.size}, #{item.color}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime}, #{item.endDate})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -21,8 +21,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectBusiPrisonLineVo">
|
||||
select A.id, A.pid,b.disname as pname, A.disname, A.leader, A.person_number, A.status, A.classify, A.create_by, A.create_time, A.update_by, A.update_time from busi_prison_line A
|
||||
LEFT JOIN busi_prison_line B on a.pid = b.id
|
||||
select A.id, A.pid,B.disname as pname, A.disname, A.leader, A.person_number, A.status, A.classify, A.create_by, A.create_time, A.update_by, A.update_time from busi_prison_line A
|
||||
LEFT JOIN busi_prison_line B on A.pid = B.id
|
||||
</sql>
|
||||
|
||||
<select id="selectBusiPrisonLineList" parameterType="BusiPrisonLine" resultMap="BusiPrisonLineResult">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,181 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增订单')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-order-add">
|
||||
<input id="treeId" name="companyId" type="hidden">
|
||||
<h4 class="form-header h4">订单信息</h4>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">客户公司:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="treeName" name="companyName" readonly="true" onclick="selectCompany()" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">订单名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="orderName" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">款号标识码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="identificationCode" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">订单价格:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="price" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="classify" class="form-control m-b" th:with="type=${@dict.getType('busi_order_type')}" required>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required" title="分料时,布匹长度由米转换为件时使用">转换比例(米/件):<i class="fa fa-question-circle-o"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<input name="ratio" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group hidden">
|
||||
<label class="col-sm-3 control-label">状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box" th:each="dict : ${@dict.getType('busi_order_status')}">
|
||||
<input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
|
||||
<label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h4 class="form-header h4">产品需求信息</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<button type="button" class="btn btn-white btn-sm" onclick="addColumn()"><i class="fa fa-plus"> 增加</i></button>
|
||||
<button type="button" class="btn btn-white btn-sm" onclick="sub.delColumn()"><i class="fa fa-minus"> 删除</i></button>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "busi/order"
|
||||
var sizeDatas = [[${@dict.getType('busi_size')}]];
|
||||
var colorDatas = [[${@dict.getType('busi_color')}]];
|
||||
$("#form-order-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-order-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
pagination: false,
|
||||
showSearch: false,
|
||||
showRefresh: false,
|
||||
showToggle: false,
|
||||
showColumns: false,
|
||||
sidePagination: "client",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'index',
|
||||
align: 'center',
|
||||
title: "序号",
|
||||
formatter: function (value, row, index) {
|
||||
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
|
||||
return columnIndex + $.table.serialNumber(index);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'amount',
|
||||
align: 'center',
|
||||
title: '数量',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiProductRequireList[%s].amount' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'size',
|
||||
align: 'center',
|
||||
title: '尺码',
|
||||
formatter: function(value, row, index) {
|
||||
var name = $.common.sprintf("busiProductRequireList[%s].size", index);
|
||||
return $.common.dictToSelect(sizeDatas, value, name);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'color',
|
||||
align: 'center',
|
||||
title: '颜色',
|
||||
formatter: function(value, row, index) {
|
||||
var name = $.common.sprintf("busiProductRequireList[%s].color", index);
|
||||
return $.common.dictToSelect(colorDatas, value, name);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'endDate',
|
||||
align: 'center',
|
||||
title: '截止日期',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' type='text' name='busiProductRequireList[%s].endDate' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
|
||||
function addColumn() {
|
||||
var count = $("#" + table.options.id).bootstrapTable('getData').length;
|
||||
sub.editColumn();
|
||||
|
||||
$("#" + table.options.id).bootstrapTable('insertRow', {
|
||||
index: count,
|
||||
row: {
|
||||
index: $.table.serialNumber(count),
|
||||
amount: "",
|
||||
size: "",
|
||||
color: "",
|
||||
endDate: ""
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/*客户公司选择*/
|
||||
function selectCompany() {
|
||||
var options = {
|
||||
title: '选择客户公司',
|
||||
width: "380",
|
||||
height: "400",
|
||||
url: ctx + "busi/company/selectCompany/",
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
function doSubmit(index, layero){
|
||||
var body = $.modal.getChildFrame(index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
$.modal.close(index);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,184 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('修改订单')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
<form class="form-horizontal m" id="form-order-edit" th:object="${busiOrder}">
|
||||
<h4 class="form-header h4">订单信息</h4>
|
||||
<input name="id" th:field="*{id}" type="hidden">
|
||||
<input id="treeId" name="companyId" th:field="*{companyId}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">客户公司:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="treeName" name="companyName" readonly="true" onclick="selectCompany()" th:field="*{companyName}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">订单名称:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="orderName" th:field="*{orderName}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">款号标识码:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="identificationCode" th:field="*{identificationCode}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">订单价格:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="price" th:field="*{price}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">类型:</label>
|
||||
<div class="col-sm-8">
|
||||
<select name="classify" class="form-control m-b" th:with="type=${@dict.getType('busi_order_type')}" required>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{classify}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required" title="分料时,布匹长度由米转换为件时使用">转换比例(米/件):<i class="fa fa-question-circle-o"></i></label>
|
||||
<div class="col-sm-8">
|
||||
<input name="ratio" th:field="*{ratio}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<!--<div class="form-group">
|
||||
<label class="col-sm-3 control-label">状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box" th:each="dict : ${@dict.getType('busi_order_status')}">
|
||||
<input type="radio" th:id="${'status_' + dict.dictCode}" name="status" th:value="${dict.dictValue}" th:field="*{status}">
|
||||
<label th:for="${'status_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
<h4 class="form-header h4">产品需求信息</h4>
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<!-- <button type="button" class="btn btn-white btn-sm" onclick="addColumn()"><i class="fa fa-plus"> 增加</i></button>-->
|
||||
<!-- <button type="button" class="btn btn-white btn-sm" onclick="sub.delColumn()"><i class="fa fa-minus"> 删除</i></button>-->
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table" ></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "busi/order";
|
||||
var sizeDatas = [[${@dict.getType('busi_size')}]];
|
||||
var colorDatas = [[${@dict.getType('busi_color')}]];
|
||||
$("#form-order-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-order-edit').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
data: [[${busiOrder.busiProductRequireList}]],
|
||||
pagination: false,
|
||||
showSearch: false,
|
||||
showRefresh: false,
|
||||
showToggle: false,
|
||||
showColumns: false,
|
||||
sidePagination: "client",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'index',
|
||||
align: 'center',
|
||||
title: "序号",
|
||||
formatter: function (value, row, index) {
|
||||
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
|
||||
return columnIndex + $.table.serialNumber(index);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'amount',
|
||||
align: 'center',
|
||||
title: '数量',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input class='form-control' readonly type='text' name='busiProductRequireList[%s].amount' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'size',
|
||||
align: 'center',
|
||||
title: '尺码',
|
||||
formatter: function(value, row, index) {
|
||||
var name = $.common.sprintf("busiProductRequireList[%s].size", index);
|
||||
return $.common.dictToSelect(sizeDatas, value, name);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'color',
|
||||
align: 'center',
|
||||
title: '颜色',
|
||||
formatter: function(value, row, index) {
|
||||
var name = $.common.sprintf("busiProductRequireList[%s].color", index);
|
||||
return $.common.dictToSelect(colorDatas, value, name);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'endDate',
|
||||
align: 'center',
|
||||
title: '截止日期',
|
||||
formatter: function(value, row, index) {
|
||||
var html = $.common.sprintf("<input readonly class='form-control' type='text' name='busiProductRequireList[%s].endDate' value='%s'>", index, value);
|
||||
return html;
|
||||
}
|
||||
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
|
||||
});
|
||||
|
||||
function addColumn() {
|
||||
var count = $("#" + table.options.id).bootstrapTable('getData').length;
|
||||
sub.editColumn();
|
||||
|
||||
$("#" + table.options.id).bootstrapTable('insertRow', {
|
||||
index: count,
|
||||
row: {
|
||||
index: $.table.serialNumber(count),
|
||||
amount: "",
|
||||
size: "",
|
||||
color: "",
|
||||
endDate: ""
|
||||
}
|
||||
});
|
||||
}
|
||||
/*选择客户公司*/
|
||||
function selectCompany() {
|
||||
var options = {
|
||||
title: '选择客户公司',
|
||||
width: "380",
|
||||
height: "400",
|
||||
url: ctx + "busi/company/selectCompany/",
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var body = $.modal.getChildFrame(index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
$.modal.close(index);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,153 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
|
||||
<head>
|
||||
<th:block th:include="include :: header('订单列表')" />
|
||||
</head>
|
||||
<body class="gray-bg">
|
||||
<div class="container-div">
|
||||
<div class="row">
|
||||
<div class="col-sm-12 search-collapse">
|
||||
<form id="formId">
|
||||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>客户公司:</label>
|
||||
<input id="treeId" name="companyId" type="text" style="display: none;">
|
||||
<input id="treeName" name="companyName" type="text" readonly="true" onclick="selectCompany()" >
|
||||
</li>
|
||||
<li>
|
||||
<label>订单名称:</label>
|
||||
<input type="text" name="orderName"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>款号标码:</label>
|
||||
<input type="text" name="identificationCode"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>类型:</label>
|
||||
<select name="classify" th:with="type=${@dict.getType('busi_order_type')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a>
|
||||
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="busi:order:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="busi:order:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="busi:order:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="busi:order:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-sm-12 select-table table-striped">
|
||||
<table id="bootstrap-table"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('busi:order:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('busi:order:remove')}]];
|
||||
var classifyDatas = [[${@dict.getType('busi_order_type')}]];
|
||||
var statusDatas = [[${@dict.getType('busi_order_status')}]];
|
||||
var prefix = ctx + "busi/order";
|
||||
|
||||
$(function() {
|
||||
var options = {
|
||||
url: prefix + "/list",
|
||||
createUrl: prefix + "/add",
|
||||
updateUrl: prefix + "/edit/{id}",
|
||||
removeUrl: prefix + "/remove",
|
||||
exportUrl: prefix + "/export",
|
||||
modalName: "订单",
|
||||
columns: [{
|
||||
checkbox: true
|
||||
},
|
||||
{
|
||||
field: 'id',
|
||||
title: 'ID主键',
|
||||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'companyName',
|
||||
title: '客户公司'
|
||||
},
|
||||
{
|
||||
field: 'orderName',
|
||||
title: '订单名称'
|
||||
},
|
||||
{
|
||||
field: 'identificationCode',
|
||||
title: '款号标识码'
|
||||
},
|
||||
{
|
||||
field: 'price',
|
||||
title: '订单价格'
|
||||
},
|
||||
{
|
||||
field: 'classify',
|
||||
title: '类型',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(classifyDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'ratio',
|
||||
title: '转换比例(米/件)'
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(statusDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
align: 'center',
|
||||
formatter: function(value, row, index) {
|
||||
var actions = [];
|
||||
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
|
||||
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
|
||||
return actions.join('');
|
||||
}
|
||||
}]
|
||||
};
|
||||
$.table.init(options);
|
||||
});
|
||||
/*选择客户公司*/
|
||||
function selectCompany() {
|
||||
var options = {
|
||||
title: '选择客户公司',
|
||||
width: "380",
|
||||
height: "400",
|
||||
url: ctx + "busi/company/selectCompany/",
|
||||
callBack: doSubmit
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function doSubmit(index, layero){
|
||||
var body = $.modal.getChildFrame(index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
$.modal.close(index);
|
||||
$.table.search();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
</li>
|
||||
<li>
|
||||
<label>状态:</label>
|
||||
<select name="status" th:with="type=${@dict.getType('busi_line_status')}">
|
||||
<select name="status" onchange="$.treeTable.search()" th:with="type=${@dict.getType('busi_line_status')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -3,6 +3,11 @@ insert into sys_dict_type values(12, '颜色', 'busi_color', '0', 'admin
|
|||
insert into sys_dict_type values(13, '客户角色', 'busi_role', '0', 'admin', sysdate(), '', null, '客户角色列表');
|
||||
insert into sys_dict_type values(14, '产线状态', 'busi_line_status', '0', 'admin', sysdate(), '', null, '产线状态');
|
||||
insert into sys_dict_type values(15, '类型', 'busi_line_type', '0', 'admin', sysdate(), '', null, '监区产线类型');
|
||||
insert into sys_dict_type values(16, '订单类型', 'busi_order_type', '0', 'admin', sysdate(), '', null, '订单类型');
|
||||
insert into sys_dict_type values(17, '订单状态', 'busi_order_status', '0', 'admin', sysdate(), '', null, '订单状态');
|
||||
insert into sys_dict_type values(18, '物料类型', 'busi_material_type', '0', 'admin', sysdate(), '', null, '物料类型');
|
||||
insert into sys_dict_type values(19, '物料单位', 'busi_material_unit', '0', 'admin', sysdate(), '', null, '物料单位');
|
||||
|
||||
|
||||
-- 尺码字典
|
||||
insert into sys_dict_data values (30, 1, 'XXXXXS', '1', 'busi_size', '', '', 'N', '0', 'admin', sysdate(), '', null, '');
|
||||
|
|
@ -37,7 +42,7 @@ insert into sys_dict_data values (57, 13, '铁色', '13', 'busi_color', '', '',
|
|||
insert into sys_dict_data values (58, 14, '粉色', '14', 'busi_color', '', '', 'N', '0', 'admin', sysdate(), '', null, '');
|
||||
|
||||
-- 客户角色字典
|
||||
insert into sys_dict_data values (59, 1, '负责人', '1', 'busi_role', '', '', 'N', '0', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_dict_data values (59, 1, '负责人', '1', 'busi_role', '', '', 'Y', '0', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_dict_data values (60, 2, '跟单人员', '2', 'busi_role', '', '', 'N', '0', 'admin', sysdate(), '', null, '');
|
||||
|
||||
-- 产线状态字典
|
||||
|
|
@ -48,6 +53,25 @@ insert into sys_dict_data values (62, 1, '生产中', '1', 'busi_line_status', '
|
|||
insert into sys_dict_data values (63, 1, '监区', 'J', 'busi_line_type', '', '', 'N', '0', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_dict_data values (64, 2, '产线', 'C', 'busi_line_type', '', '', 'Y', '0', 'admin', sysdate(), '', null, '');
|
||||
|
||||
-- 订单类型
|
||||
insert into sys_dict_data values (65, 1, '外套', '1', 'busi_order_type', '', '', 'Y', '0', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_dict_data values (66, 2, '裤子', '2', 'busi_order_type', '', '', 'N', '0', 'admin', sysdate(), '', null, '');
|
||||
|
||||
-- 订单状态
|
||||
insert into sys_dict_data values (67, 1, '创建', '1', 'busi_order_status', '', '', 'Y', '0', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_dict_data values (68, 2, '生产中', '2', 'busi_order_status', '', '', 'N', '0', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_dict_data values (69, 3, '完成', '3', 'busi_order_status', '', '', 'N', '0', 'admin', sysdate(), '', null, '');
|
||||
|
||||
-- 物料类型
|
||||
insert into sys_dict_data values (70, 1, '布', '1', 'busi_material_type', '', '', 'Y', '0', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_dict_data values (71, 2, '拉链', '2', 'busi_material_type', '', '', 'N', '0', 'admin', sysdate(), '', null, '');
|
||||
|
||||
-- 物料单位
|
||||
insert into sys_dict_data values (72, 1, '米', '1', 'busi_material_unit', '', '', 'Y', '0', 'admin', sysdate(), '', null, '');
|
||||
insert into sys_dict_data values (73, 2, '件', '2', 'busi_material_unit', '', '', 'N', '0', 'admin', sysdate(), '', null, '');
|
||||
|
||||
|
||||
|
||||
-- 一级菜单
|
||||
insert into sys_menu values ('117', '生产信息', '0', '1', '#', '', 'M', '0', '1', '', 'fa fa-wrench', 'admin', sysdate(), '', null, '生产信息菜单');
|
||||
insert into sys_menu values ('118', '物料信息', '0', '2', '#', '', 'M', '0', '1', '', 'fa fa-cubes', 'admin', sysdate(), '', null, '物料信息菜单');
|
||||
|
|
|
|||
25
sql/tmp.sql
25
sql/tmp.sql
|
|
@ -69,3 +69,28 @@ values('监区产线删除', @parentId, '4', '#', 'F', '0', 'busi:prisonLine:r
|
|||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('监区产线导出', @parentId, '5', '#', 'F', '0', 'busi:prisonLine:export', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
|
||||
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('订单维护', '119', '1', '/busi/order', 'C', '0', 'busi:order:view', '#', 'admin', sysdate(), '', null, '订单菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('订单查询', @parentId, '1', '#', 'F', '0', 'busi:order:list', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('订单新增', @parentId, '2', '#', 'F', '0', 'busi:order:add', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('订单修改', @parentId, '3', '#', 'F', '0', 'busi:order:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('订单删除', @parentId, '4', '#', 'F', '0', 'busi:order:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, url, menu_type, visible, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('订单导出', @parentId, '5', '#', 'F', '0', 'busi:order:export', '#', 'admin', sysdate(), '', null, '');
|
||||
|
|
|
|||
Loading…
Reference in New Issue