成品库存和成品操作完善
This commit is contained in:
parent
0fd63bebae
commit
bdcf096d99
|
|
@ -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.BusiSubTask;
|
||||
import com.ruoyi.busi.service.IBusiSubTaskService;
|
||||
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 2022-01-10
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/busi/subtask")
|
||||
public class BusiSubTaskController extends BaseController
|
||||
{
|
||||
private String prefix = "busi/subtask";
|
||||
|
||||
@Autowired
|
||||
private IBusiSubTaskService busiSubTaskService;
|
||||
|
||||
@RequiresPermissions("busi:subtask:view")
|
||||
@GetMapping()
|
||||
public String subtask()
|
||||
{
|
||||
return prefix + "/subtask";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询产品子任务列表
|
||||
*/
|
||||
@RequiresPermissions("busi:subtask:list")
|
||||
@PostMapping("/list")
|
||||
@ResponseBody
|
||||
public TableDataInfo list(BusiSubTask busiSubTask)
|
||||
{
|
||||
startPage();
|
||||
List<BusiSubTask> list = busiSubTaskService.selectBusiSubTaskList(busiSubTask);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出产品子任务列表
|
||||
*/
|
||||
@RequiresPermissions("busi:subtask:export")
|
||||
@Log(title = "产品子任务", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
@ResponseBody
|
||||
public AjaxResult export(BusiSubTask busiSubTask)
|
||||
{
|
||||
List<BusiSubTask> list = busiSubTaskService.selectBusiSubTaskList(busiSubTask);
|
||||
ExcelUtil<BusiSubTask> util = new ExcelUtil<BusiSubTask>(BusiSubTask.class);
|
||||
return util.exportExcel(list, "产品子任务数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品子任务
|
||||
*/
|
||||
@GetMapping("/add")
|
||||
public String add()
|
||||
{
|
||||
return prefix + "/add";
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保存产品子任务
|
||||
*/
|
||||
@RequiresPermissions("busi:subtask:add")
|
||||
@Log(title = "产品子任务", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/add")
|
||||
@ResponseBody
|
||||
public AjaxResult addSave(BusiSubTask busiSubTask)
|
||||
{
|
||||
return toAjax(busiSubTaskService.insertBusiSubTask(busiSubTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品子任务
|
||||
*/
|
||||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") String id, ModelMap mmap)
|
||||
{
|
||||
BusiSubTask busiSubTask = busiSubTaskService.selectBusiSubTaskById(id);
|
||||
mmap.put("busiSubTask", busiSubTask);
|
||||
return prefix + "/edit";
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保存产品子任务
|
||||
*/
|
||||
@RequiresPermissions("busi:subtask:edit")
|
||||
@Log(title = "产品子任务", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/edit")
|
||||
@ResponseBody
|
||||
public AjaxResult editSave(BusiSubTask busiSubTask)
|
||||
{
|
||||
return toAjax(busiSubTaskService.updateBusiSubTask(busiSubTask));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品子任务
|
||||
*/
|
||||
@RequiresPermissions("busi:subtask:remove")
|
||||
@Log(title = "产品子任务", businessType = BusinessType.DELETE)
|
||||
@PostMapping( "/remove")
|
||||
@ResponseBody
|
||||
public AjaxResult remove(String ids)
|
||||
{
|
||||
return toAjax(busiSubTaskService.deleteBusiSubTaskByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -37,7 +37,7 @@ public class BusiOrder extends BaseEntity
|
|||
|
||||
/** 订单价格 */
|
||||
@Excel(name = "订单价格")
|
||||
private BigDecimal price;
|
||||
private double price;
|
||||
|
||||
/** 类型 */
|
||||
@Excel(name = "类型")
|
||||
|
|
@ -90,15 +90,7 @@ public class BusiOrder extends BaseEntity
|
|||
{
|
||||
return identificationCode;
|
||||
}
|
||||
public void setPrice(BigDecimal price)
|
||||
{
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice()
|
||||
{
|
||||
return price;
|
||||
}
|
||||
public void setClassify(String classify)
|
||||
{
|
||||
this.classify = classify;
|
||||
|
|
@ -145,6 +137,14 @@ public class BusiOrder extends BaseEntity
|
|||
this.busiProductRequireList = busiProductRequireList;
|
||||
}
|
||||
|
||||
public double getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(double price) {
|
||||
this.price = price;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
|||
|
|
@ -26,9 +26,15 @@ public class BusiProductOperate extends BaseEntity
|
|||
/** 任务 */
|
||||
@Excel(name = "任务")
|
||||
private String taskId;
|
||||
private String subTaskId;
|
||||
|
||||
|
||||
private String orderId;
|
||||
private String color;
|
||||
private String size;
|
||||
private String orderName;
|
||||
private String lineName;
|
||||
private String lineId;
|
||||
|
||||
/** 操作数量 */
|
||||
@Excel(name = "操作数量")
|
||||
|
|
@ -36,7 +42,7 @@ public class BusiProductOperate extends BaseEntity
|
|||
|
||||
/** 价值 */
|
||||
@Excel(name = "价值")
|
||||
private BigDecimal productValue;
|
||||
private double productValue;
|
||||
|
||||
/** 每包数量 */
|
||||
private Long amountPerPackage;
|
||||
|
|
@ -45,6 +51,38 @@ public class BusiProductOperate extends BaseEntity
|
|||
@Excel(name = "操作类型")
|
||||
private String oprateType;
|
||||
|
||||
public String getLineId() {
|
||||
return lineId;
|
||||
}
|
||||
|
||||
public void setLineId(String lineId) {
|
||||
this.lineId = lineId;
|
||||
}
|
||||
|
||||
public String getOrderName() {
|
||||
return orderName;
|
||||
}
|
||||
|
||||
public void setOrderName(String orderName) {
|
||||
this.orderName = orderName;
|
||||
}
|
||||
|
||||
public String getLineName() {
|
||||
return lineName;
|
||||
}
|
||||
|
||||
public void setLineName(String lineName) {
|
||||
this.lineName = lineName;
|
||||
}
|
||||
|
||||
public String getSubTaskId() {
|
||||
return subTaskId;
|
||||
}
|
||||
|
||||
public void setSubTaskId(String subTaskId) {
|
||||
this.subTaskId = subTaskId;
|
||||
}
|
||||
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
|
@ -53,6 +91,22 @@ public class BusiProductOperate extends BaseEntity
|
|||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public String getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
public void setSize(String size) {
|
||||
this.size = size;
|
||||
}
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
|
|
@ -89,15 +143,7 @@ public class BusiProductOperate extends BaseEntity
|
|||
{
|
||||
return amount;
|
||||
}
|
||||
public void setProductValue(BigDecimal productValue)
|
||||
{
|
||||
this.productValue = productValue;
|
||||
}
|
||||
|
||||
public BigDecimal getProductValue()
|
||||
{
|
||||
return productValue;
|
||||
}
|
||||
public void setAmountPerPackage(Long amountPerPackage)
|
||||
{
|
||||
this.amountPerPackage = amountPerPackage;
|
||||
|
|
@ -117,6 +163,14 @@ public class BusiProductOperate extends BaseEntity
|
|||
return oprateType;
|
||||
}
|
||||
|
||||
public double getProductValue() {
|
||||
return productValue;
|
||||
}
|
||||
|
||||
public void setProductValue(double productValue) {
|
||||
this.productValue = productValue;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
|
|
|
|||
|
|
@ -19,9 +19,12 @@ public class BusiProductStock extends BaseEntity
|
|||
private String id;
|
||||
|
||||
/** 订单 */
|
||||
@Excel(name = "订单")
|
||||
private String orderId;
|
||||
|
||||
/** 订单 */
|
||||
@Excel(name = "订单")
|
||||
private String orderName;
|
||||
|
||||
/** 数量 */
|
||||
@Excel(name = "数量")
|
||||
private Long amount;
|
||||
|
|
@ -34,6 +37,14 @@ public class BusiProductStock extends BaseEntity
|
|||
@Excel(name = "颜色")
|
||||
private String color;
|
||||
|
||||
public String getOrderName() {
|
||||
return orderName;
|
||||
}
|
||||
|
||||
public void setOrderName(String orderName) {
|
||||
this.orderName = orderName;
|
||||
}
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
|
|
|
|||
|
|
@ -9,14 +9,14 @@ import com.ruoyi.common.core.domain.BaseEntity;
|
|||
* 产品子任务对象 busi_sub_task
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2021-12-30
|
||||
* @date 2022-01-10
|
||||
*/
|
||||
public class BusiSubTask extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** ID主键 */
|
||||
private Long id;
|
||||
private String id;
|
||||
|
||||
/** 任务ID */
|
||||
@Excel(name = "任务ID")
|
||||
|
|
@ -58,12 +58,12 @@ public class BusiSubTask extends BaseEntity
|
|||
this.color = color;
|
||||
}
|
||||
|
||||
public void setId(Long id)
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getId()
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.busi.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.busi.domain.BusiSubTask;
|
||||
|
||||
/**
|
||||
* 产品子任务Mapper接口
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2022-01-10
|
||||
*/
|
||||
public interface BusiSubTaskMapper
|
||||
{
|
||||
/**
|
||||
* 查询产品子任务
|
||||
*
|
||||
* @param id 产品子任务主键
|
||||
* @return 产品子任务
|
||||
*/
|
||||
public BusiSubTask selectBusiSubTaskById(String id);
|
||||
|
||||
/**
|
||||
* 查询产品子任务列表
|
||||
*
|
||||
* @param busiSubTask 产品子任务
|
||||
* @return 产品子任务集合
|
||||
*/
|
||||
public List<BusiSubTask> selectBusiSubTaskList(BusiSubTask busiSubTask);
|
||||
|
||||
/**
|
||||
* 新增产品子任务
|
||||
*
|
||||
* @param busiSubTask 产品子任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBusiSubTask(BusiSubTask busiSubTask);
|
||||
|
||||
/**
|
||||
* 修改产品子任务
|
||||
*
|
||||
* @param busiSubTask 产品子任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBusiSubTask(BusiSubTask busiSubTask);
|
||||
|
||||
/**
|
||||
* 删除产品子任务
|
||||
*
|
||||
* @param id 产品子任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiSubTaskById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除产品子任务
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiSubTaskByIds(String[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
package com.ruoyi.busi.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.busi.domain.BusiSubTask;
|
||||
|
||||
/**
|
||||
* 产品子任务Service接口
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2022-01-10
|
||||
*/
|
||||
public interface IBusiSubTaskService
|
||||
{
|
||||
/**
|
||||
* 查询产品子任务
|
||||
*
|
||||
* @param id 产品子任务主键
|
||||
* @return 产品子任务
|
||||
*/
|
||||
public BusiSubTask selectBusiSubTaskById(String id);
|
||||
|
||||
/**
|
||||
* 查询产品子任务列表
|
||||
*
|
||||
* @param busiSubTask 产品子任务
|
||||
* @return 产品子任务集合
|
||||
*/
|
||||
public List<BusiSubTask> selectBusiSubTaskList(BusiSubTask busiSubTask);
|
||||
|
||||
/**
|
||||
* 新增产品子任务
|
||||
*
|
||||
* @param busiSubTask 产品子任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBusiSubTask(BusiSubTask busiSubTask);
|
||||
|
||||
/**
|
||||
* 修改产品子任务
|
||||
*
|
||||
* @param busiSubTask 产品子任务
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBusiSubTask(BusiSubTask busiSubTask);
|
||||
|
||||
/**
|
||||
* 批量删除产品子任务
|
||||
*
|
||||
* @param ids 需要删除的产品子任务主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiSubTaskByIds(String ids);
|
||||
|
||||
/**
|
||||
* 删除产品子任务信息
|
||||
*
|
||||
* @param id 产品子任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBusiSubTaskById(String id);
|
||||
}
|
||||
|
|
@ -70,31 +70,34 @@ public class BusiMaterialOperateServiceImpl implements IBusiMaterialOperateServi
|
|||
} else {// 2为入库
|
||||
double stockAmount = busiMaterialStock.getAmountIn() - busiMaterialStock.getAmountOut();
|
||||
if(busiMaterialOperate.getAmount() > stockAmount){
|
||||
throw new ServiceException("出库或损耗超过库存,库存值:" + stockAmount);
|
||||
throw new ServiceException("操作超过库存,库存值:" + stockAmount);
|
||||
}
|
||||
busiMaterialStock.setAmountOut(busiMaterialOperate.getAmount() + busiMaterialStock.getAmountOut());
|
||||
}
|
||||
busiMaterialStockMapper.updateBusiMaterialStock(busiMaterialStock);
|
||||
busiMaterialStockMapper.updateBusiMaterialStock(busiMaterialStock);// 更新库存
|
||||
} else {// 没有库存则新建
|
||||
busiMaterialStock = new BusiMaterialStock();
|
||||
busiMaterialStock = createBusiMaterialStock(busiMaterialOperate);
|
||||
if ("1".equals(busiMaterialOperate.getOprateType())) {
|
||||
busiMaterialStock.setAmountIn(busiMaterialOperate.getAmount());
|
||||
} else {
|
||||
throw new ServiceException("尚未建立库存,请先操作物料入库");
|
||||
}
|
||||
busiMaterialStockMapper.insertBusiMaterialStock(busiMaterialStock); // 创建库存
|
||||
}
|
||||
|
||||
busiMaterialOperate.setMaterialStockId(busiMaterialStock.getId());
|
||||
return busiMaterialOperateMapper.insertBusiMaterialOperate(busiMaterialOperate);// 插入操作
|
||||
}
|
||||
|
||||
private BusiMaterialStock createBusiMaterialStock(BusiMaterialOperate busiMaterialOperate) {
|
||||
BusiMaterialStock busiMaterialStock = new BusiMaterialStock();
|
||||
busiMaterialStock.setColor(busiMaterialOperate.getColor());
|
||||
busiMaterialStock.setClassify(busiMaterialOperate.getClassify());
|
||||
busiMaterialStock.setOrderId(busiMaterialOperate.getOrderId());
|
||||
busiMaterialStock.setUnit(busiMaterialOperate.getUnit());
|
||||
busiMaterialStock.setCreateTime(new Date());
|
||||
busiMaterialStock.setCreateBy("system");
|
||||
|
||||
if ("1".equals(busiMaterialOperate.getOprateType())) {
|
||||
busiMaterialStock.setAmountIn(busiMaterialOperate.getAmount());
|
||||
} else {
|
||||
throw new ServiceException("尚未建立库存,请先操作物料入库");
|
||||
}
|
||||
busiMaterialStockMapper.insertBusiMaterialStock(busiMaterialStock);
|
||||
}
|
||||
|
||||
busiMaterialOperate.setMaterialStockId(busiMaterialStock.getId());
|
||||
// 插入操作流水
|
||||
return busiMaterialOperateMapper.insertBusiMaterialOperate(busiMaterialOperate);
|
||||
return busiMaterialStock;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,19 @@
|
|||
package com.ruoyi.busi.service.impl;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.ruoyi.busi.domain.*;
|
||||
import com.ruoyi.busi.mapper.BusiOrderMapper;
|
||||
import com.ruoyi.busi.mapper.BusiProductStockMapper;
|
||||
import com.ruoyi.busi.mapper.BusiSubTaskMapper;
|
||||
import com.ruoyi.common.exception.ServiceException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.busi.mapper.BusiProductOperateMapper;
|
||||
import com.ruoyi.busi.domain.BusiProductOperate;
|
||||
import com.ruoyi.busi.service.IBusiProductOperateService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
|
|
@ -18,10 +24,17 @@ import com.ruoyi.common.core.text.Convert;
|
|||
* @date 2022-01-08
|
||||
*/
|
||||
@Service
|
||||
public class BusiProductOperateServiceImpl implements IBusiProductOperateService
|
||||
{
|
||||
public class BusiProductOperateServiceImpl implements IBusiProductOperateService {
|
||||
@Autowired
|
||||
private BusiProductOperateMapper busiProductOperateMapper;
|
||||
@Autowired
|
||||
private BusiProductStockMapper busiProductStockMapper;
|
||||
|
||||
@Autowired
|
||||
private BusiOrderMapper busiOrderMapper;
|
||||
|
||||
@Autowired
|
||||
private BusiSubTaskMapper subTaskMapper;
|
||||
|
||||
/**
|
||||
* 查询成品操作流水
|
||||
|
|
@ -30,8 +43,7 @@ public class BusiProductOperateServiceImpl implements IBusiProductOperateService
|
|||
* @return 成品操作流水
|
||||
*/
|
||||
@Override
|
||||
public BusiProductOperate selectBusiProductOperateById(String id)
|
||||
{
|
||||
public BusiProductOperate selectBusiProductOperateById(String id) {
|
||||
return busiProductOperateMapper.selectBusiProductOperateById(id);
|
||||
}
|
||||
|
||||
|
|
@ -42,8 +54,7 @@ public class BusiProductOperateServiceImpl implements IBusiProductOperateService
|
|||
* @return 成品操作流水
|
||||
*/
|
||||
@Override
|
||||
public List<BusiProductOperate> selectBusiProductOperateList(BusiProductOperate busiProductOperate)
|
||||
{
|
||||
public List<BusiProductOperate> selectBusiProductOperateList(BusiProductOperate busiProductOperate) {
|
||||
return busiProductOperateMapper.selectBusiProductOperateList(busiProductOperate);
|
||||
}
|
||||
|
||||
|
|
@ -54,14 +65,85 @@ public class BusiProductOperateServiceImpl implements IBusiProductOperateService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBusiProductOperate(BusiProductOperate busiProductOperate)
|
||||
{
|
||||
public int insertBusiProductOperate(BusiProductOperate busiProductOperate) {
|
||||
List<BusiProductStock> busiProductStocks = queryBusiProductStocks(busiProductOperate);
|
||||
busiProductOperate.setProductValue(cacuValue(busiProductOperate));
|
||||
busiProductOperate.setCreateTime(DateUtils.getNowDate());
|
||||
|
||||
BusiProductStock busiProductStock;
|
||||
if (busiProductStocks.size() != 0) {
|
||||
busiProductStock = busiProductStocks.get(0);
|
||||
if ("1".equals(busiProductOperate.getOprateType())) { //1为入库
|
||||
busiProductStock.setAmount(busiProductStock.getAmount() + busiProductOperate.getAmount());
|
||||
updateCompletedAmount(busiProductOperate.getSubTaskId(), busiProductOperate.getAmount()); // 更新子任务完成量
|
||||
} else {// 出库或退回
|
||||
if (busiProductOperate.getAmount() > busiProductStock.getAmount()) {
|
||||
throw new ServiceException("操作值超过库存,当前库存值:" + busiProductStock.getAmount());
|
||||
}
|
||||
busiProductStock.setAmount(busiProductStock.getAmount() - busiProductOperate.getAmount());
|
||||
if ("3".equals(busiProductOperate.getOprateType())) { // 退回时,任务完成值还要减掉退回值,响应的操作值更新为负值,以方便后面统计
|
||||
busiProductOperate.setAmount(-busiProductOperate.getAmount());
|
||||
busiProductOperate.setProductValue(-busiProductOperate.getProductValue());
|
||||
updateCompletedAmount(busiProductOperate.getSubTaskId(), -busiProductOperate.getAmount()); // 更新子任务完成量
|
||||
}
|
||||
}
|
||||
busiProductStock.setUpdateTime(new Date());
|
||||
busiProductStockMapper.updateBusiProductStock(busiProductStock);
|
||||
} else {
|
||||
busiProductStock = createBusiProductStock(busiProductOperate);
|
||||
if ("1".equals(busiProductOperate.getOprateType())) { //1为入库
|
||||
busiProductStock.setAmount(busiProductOperate.getAmount());
|
||||
long completedAmount = busiProductOperate.getAmount();
|
||||
updateCompletedAmount(busiProductOperate.getSubTaskId(), completedAmount);
|
||||
busiProductStockMapper.insertBusiProductStock(busiProductStock); //插入库存
|
||||
} else { // 出库或退回
|
||||
throw new ServiceException("尚未建立库存,请先进行入库操作");
|
||||
}
|
||||
}
|
||||
|
||||
busiProductOperate.setProductStockId(busiProductStock.getId());
|
||||
return busiProductOperateMapper.insertBusiProductOperate(busiProductOperate);
|
||||
}
|
||||
|
||||
private void updateCompletedAmount(String subTaskId, long operateAmount) {
|
||||
BusiSubTask busiSubTask = subTaskMapper.selectBusiSubTaskById(subTaskId);
|
||||
long completedAmount = busiSubTask.getCompletedAmount();
|
||||
busiSubTask.setCompletedAmount(completedAmount + operateAmount);
|
||||
subTaskMapper.updateBusiSubTask(busiSubTask); // 更新子任务完成量
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算产值
|
||||
*
|
||||
* @param busiProductOperate
|
||||
* @return
|
||||
*/
|
||||
private double cacuValue(BusiProductOperate busiProductOperate) {
|
||||
BusiOrder order = busiOrderMapper.selectBusiOrderById(busiProductOperate.getOrderId());
|
||||
double price = order.getPrice();
|
||||
double value = busiProductOperate.getAmount() * price;
|
||||
return value;
|
||||
}
|
||||
|
||||
private BusiProductStock createBusiProductStock(BusiProductOperate busiProductOperate) {
|
||||
BusiProductStock busiProductStock;
|
||||
busiProductStock = new BusiProductStock();
|
||||
busiProductStock.setOrderId(busiProductOperate.getOrderId());
|
||||
busiProductStock.setColor(busiProductOperate.getColor());
|
||||
busiProductStock.setSize(busiProductOperate.getSize());
|
||||
busiProductStock.setCreateBy("system");
|
||||
busiProductStock.setCreateTime(new Date());
|
||||
return busiProductStock;
|
||||
}
|
||||
|
||||
private List<BusiProductStock> queryBusiProductStocks(BusiProductOperate busiProductOperate) {
|
||||
BusiProductStock stockQuery = new BusiProductStock();
|
||||
stockQuery.setOrderId(busiProductOperate.getOrderId());
|
||||
stockQuery.setColor(busiProductOperate.getColor());
|
||||
stockQuery.setSize(busiProductOperate.getSize());
|
||||
return busiProductStockMapper.selectBusiProductStockList(stockQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改成品操作流水
|
||||
*
|
||||
|
|
@ -69,8 +151,7 @@ public class BusiProductOperateServiceImpl implements IBusiProductOperateService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBusiProductOperate(BusiProductOperate busiProductOperate)
|
||||
{
|
||||
public int updateBusiProductOperate(BusiProductOperate busiProductOperate) {
|
||||
return busiProductOperateMapper.updateBusiProductOperate(busiProductOperate);
|
||||
}
|
||||
|
||||
|
|
@ -81,8 +162,7 @@ public class BusiProductOperateServiceImpl implements IBusiProductOperateService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBusiProductOperateByIds(String ids)
|
||||
{
|
||||
public int deleteBusiProductOperateByIds(String ids) {
|
||||
return busiProductOperateMapper.deleteBusiProductOperateByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
|
|
@ -93,8 +173,7 @@ public class BusiProductOperateServiceImpl implements IBusiProductOperateService
|
|||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBusiProductOperateById(String id)
|
||||
{
|
||||
public int deleteBusiProductOperateById(String id) {
|
||||
return busiProductOperateMapper.deleteBusiProductOperateById(id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,96 @@
|
|||
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 com.ruoyi.busi.mapper.BusiSubTaskMapper;
|
||||
import com.ruoyi.busi.domain.BusiSubTask;
|
||||
import com.ruoyi.busi.service.IBusiSubTaskService;
|
||||
import com.ruoyi.common.core.text.Convert;
|
||||
|
||||
/**
|
||||
* 产品子任务Service业务层处理
|
||||
*
|
||||
* @author WangCL
|
||||
* @date 2022-01-10
|
||||
*/
|
||||
@Service
|
||||
public class BusiSubTaskServiceImpl implements IBusiSubTaskService
|
||||
{
|
||||
@Autowired
|
||||
private BusiSubTaskMapper busiSubTaskMapper;
|
||||
|
||||
/**
|
||||
* 查询产品子任务
|
||||
*
|
||||
* @param id 产品子任务主键
|
||||
* @return 产品子任务
|
||||
*/
|
||||
@Override
|
||||
public BusiSubTask selectBusiSubTaskById(String id)
|
||||
{
|
||||
return busiSubTaskMapper.selectBusiSubTaskById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询产品子任务列表
|
||||
*
|
||||
* @param busiSubTask 产品子任务
|
||||
* @return 产品子任务
|
||||
*/
|
||||
@Override
|
||||
public List<BusiSubTask> selectBusiSubTaskList(BusiSubTask busiSubTask)
|
||||
{
|
||||
return busiSubTaskMapper.selectBusiSubTaskList(busiSubTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增产品子任务
|
||||
*
|
||||
* @param busiSubTask 产品子任务
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertBusiSubTask(BusiSubTask busiSubTask)
|
||||
{
|
||||
busiSubTask.setCreateTime(DateUtils.getNowDate());
|
||||
return busiSubTaskMapper.insertBusiSubTask(busiSubTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改产品子任务
|
||||
*
|
||||
* @param busiSubTask 产品子任务
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateBusiSubTask(BusiSubTask busiSubTask)
|
||||
{
|
||||
return busiSubTaskMapper.updateBusiSubTask(busiSubTask);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除产品子任务
|
||||
*
|
||||
* @param ids 需要删除的产品子任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBusiSubTaskByIds(String ids)
|
||||
{
|
||||
return busiSubTaskMapper.deleteBusiSubTaskByIds(Convert.toStrArray(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除产品子任务信息
|
||||
*
|
||||
* @param id 产品子任务主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteBusiSubTaskById(String id)
|
||||
{
|
||||
return busiSubTaskMapper.deleteBusiSubTaskById(id);
|
||||
}
|
||||
}
|
||||
|
|
@ -8,6 +8,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="id" column="id" />
|
||||
<result property="productStockId" column="product_stock_id" />
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="orderName" column="order_name" />
|
||||
<result property="size" column="size" />
|
||||
<result property="color" column="color" />
|
||||
<result property="lineName" column="line_name" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="productValue" column="product_value" />
|
||||
<result property="amountPerPackage" column="amount_per_package" />
|
||||
|
|
@ -18,21 +22,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectBusiProductOperateVo">
|
||||
select id, product_stock_id, task_id, amount, product_value, amount_per_package, oprate_type, create_by, create_time, remark from busi_product_operate
|
||||
select bpo.id, bpo.product_stock_id, bpo.task_id, bps.size,bps.color,bo.order_name,bpl.disname line_name, bpo.amount, bpo.product_value, bpo.amount_per_package, bpo.oprate_type, bpo.create_by, bpo.create_time, bpo.remark
|
||||
from busi_product_operate bpo
|
||||
INNER JOIN busi_product_stock bps on bps.id = bpo.product_stock_id
|
||||
LEFT JOIN busi_order bo on bps.order_id = bo.id
|
||||
LEFT JOIN busi_task bt on bt.id = bpo.task_id
|
||||
LEFT JOIN busi_prison_line bpl on bt.prison_line_id = bpl.id
|
||||
</sql>
|
||||
|
||||
<select id="selectBusiProductOperateList" parameterType="BusiProductOperate" resultMap="BusiProductOperateResult">
|
||||
<include refid="selectBusiProductOperateVo"/>
|
||||
<where>
|
||||
<if test="productStockId != null and productStockId != ''"> and product_stock_id = #{productStockId}</if>
|
||||
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
|
||||
<if test="oprateType != null and oprateType != ''"> and oprate_type = #{oprateType}</if>
|
||||
<if test="orderId != null and orderId != ''"> and bps.order_id = #{orderId}</if>
|
||||
<if test="lineId != null and lineId != ''"> and bt.prison_line_id = #{lineId}</if>
|
||||
<if test="color != null and color != ''"> and bps.color = #{color}</if>
|
||||
<if test="size != null and size != ''"> and bps.size = #{size}</if>
|
||||
<if test="oprateType != null and oprateType != ''"> and bpo.oprate_type = #{oprateType}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBusiProductOperateById" parameterType="String" resultMap="BusiProductOperateResult">
|
||||
<include refid="selectBusiProductOperateVo"/>
|
||||
where id = #{id}
|
||||
where bpo.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBusiProductOperate" parameterType="BusiProductOperate" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<resultMap type="BusiProductStock" id="BusiProductStockResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="orderId" column="order_id" />
|
||||
<result property="orderName" column="order_name" />
|
||||
<result property="amount" column="amount" />
|
||||
<result property="size" column="size" />
|
||||
<result property="color" column="color" />
|
||||
|
|
@ -17,21 +18,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectBusiProductStockVo">
|
||||
select id, order_id, amount, size, color, create_by, create_time, update_by, update_time from busi_product_stock
|
||||
select bps.id, bps.order_id,bo.order_name, bps.amount, bps.size, bps.color, bps.create_by, bps.create_time, bps.update_by, bps.update_time
|
||||
from busi_product_stock bps LEFT JOIN busi_order bo on bo.id = bps.order_id
|
||||
</sql>
|
||||
|
||||
<select id="selectBusiProductStockList" parameterType="BusiProductStock" resultMap="BusiProductStockResult">
|
||||
<include refid="selectBusiProductStockVo"/>
|
||||
<where>
|
||||
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
|
||||
<if test="size != null and size != ''"> and size = #{size}</if>
|
||||
<if test="color != null and color != ''"> and color = #{color}</if>
|
||||
<if test="orderId != null and orderId != ''"> and bps.order_id = #{orderId}</if>
|
||||
<if test="size != null and size != ''"> and bps.size = #{size}</if>
|
||||
<if test="color != null and color != ''"> and bps.color = #{color}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBusiProductStockById" parameterType="String" resultMap="BusiProductStockResult">
|
||||
<include refid="selectBusiProductStockVo"/>
|
||||
where id = #{id}
|
||||
where bps.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBusiProductStock" parameterType="BusiProductStock" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
|
|||
|
|
@ -0,0 +1,85 @@
|
|||
<?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.BusiSubTaskMapper">
|
||||
|
||||
<resultMap type="BusiSubTask" id="BusiSubTaskResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="taskId" column="task_id" />
|
||||
<result property="productRequireId" column="product_require_id" />
|
||||
<result property="targetAmount" column="target_amount" />
|
||||
<result property="completedAmount" column="completed_amount" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBusiSubTaskVo">
|
||||
select id, task_id, product_require_id, target_amount, completed_amount, create_by, create_time, status from busi_sub_task
|
||||
</sql>
|
||||
|
||||
<select id="selectBusiSubTaskList" parameterType="BusiSubTask" resultMap="BusiSubTaskResult">
|
||||
<include refid="selectBusiSubTaskVo"/>
|
||||
<where>
|
||||
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
|
||||
<if test="productRequireId != null and productRequireId != ''"> and product_require_id = #{productRequireId}</if>
|
||||
<if test="targetAmount != null "> and target_amount = #{targetAmount}</if>
|
||||
<if test="completedAmount != null "> and completed_amount = #{completedAmount}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBusiSubTaskById" parameterType="String" resultMap="BusiSubTaskResult">
|
||||
<include refid="selectBusiSubTaskVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBusiSubTask" parameterType="BusiSubTask" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into busi_sub_task
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null and taskId != ''">task_id,</if>
|
||||
<if test="productRequireId != null and productRequireId != ''">product_require_id,</if>
|
||||
<if test="targetAmount != null">target_amount,</if>
|
||||
<if test="completedAmount != null">completed_amount,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="taskId != null and taskId != ''">#{taskId},</if>
|
||||
<if test="productRequireId != null and productRequireId != ''">#{productRequireId},</if>
|
||||
<if test="targetAmount != null">#{targetAmount},</if>
|
||||
<if test="completedAmount != null">#{completedAmount},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBusiSubTask" parameterType="BusiSubTask">
|
||||
update busi_sub_task
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="taskId != null and taskId != ''">task_id = #{taskId},</if>
|
||||
<if test="productRequireId != null and productRequireId != ''">product_require_id = #{productRequireId},</if>
|
||||
<if test="targetAmount != null">target_amount = #{targetAmount},</if>
|
||||
<if test="completedAmount != null">completed_amount = #{completedAmount},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBusiSubTaskById" parameterType="String">
|
||||
delete from busi_sub_task where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBusiSubTaskByIds" parameterType="String">
|
||||
delete from busi_sub_task where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
|
@ -132,7 +132,7 @@
|
|||
} else if (value == "2") {
|
||||
return "<i class='fa fa-arrow-circle-up'>出库</i>";
|
||||
} else {
|
||||
return "<i class='fa fa-trash-o'>损耗</i>";
|
||||
return "<i class='fa fa-trash'>损耗</i>";
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
||||
<head>
|
||||
<th:block th:include="include :: header('新增成品操作流水')" />
|
||||
<th:block th:include="include :: header('成品入库')" />
|
||||
</head>
|
||||
<body class="white-bg">
|
||||
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
|
||||
|
|
@ -9,6 +9,7 @@
|
|||
<input type="hidden" name="oprateType" value="1" />
|
||||
<input id="taskId" type="hidden" name="taskId" />
|
||||
<input id="orderId" type="hidden" name="orderId"/>
|
||||
<input id="subTaskId" type="hidden" name="subTaskId"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产线:</label>
|
||||
|
|
@ -81,8 +82,10 @@
|
|||
$("#color").change(function(){
|
||||
var orderId = $("#color :selected").attr("orderId");
|
||||
var taskId = $("#color :selected").attr("taskId");
|
||||
var subTaskId = $("#color :selected").attr("subTaskId");
|
||||
$("#orderId").val(orderId);
|
||||
$("#taskId").val(taskId);
|
||||
$("#subTaskId").val(subTaskId);
|
||||
})
|
||||
/*监区产线-新增-选择父监区产线树*/
|
||||
function selectPrisonLineTree() {
|
||||
|
|
@ -131,7 +134,8 @@
|
|||
var text = $.table.getDictText(colorDatas, val);
|
||||
var orderId = data[i].orderId;
|
||||
var taskId = data[i].taskId;
|
||||
$("#color").append("<option orderId='" + orderId + "' taskId='" + taskId + "' 'value='" + val + "'>" + text + "</option>");
|
||||
var subTaskId = data[i].subTaskId;
|
||||
$("#color").append("<option orderId='" + orderId + "' taskId='" + taskId + + "' subTaskId='" + subTaskId + " 'value='" + val + "'>" + text + "</option>");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,144 @@
|
|||
<!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-productOperate-add">
|
||||
<input type="hidden" name="oprateType" value="1" />
|
||||
<input id="taskId" type="hidden" name="taskId" />
|
||||
<input id="orderId" type="hidden" name="orderId"/>
|
||||
<input id="subTaskId" type="hidden" name="subTaskId"/>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产线:</label>
|
||||
<div class="col-sm-8">
|
||||
<input id="lineTreeId" name="prisonLineId" type="hidden" />
|
||||
<input class="form-control" type="text" onclick="selectPrisonLineTree()" id="lineTreeName" readonly="true" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label" title="产品选择源于任务,若无对应的选项,请在任务中添加">产品选择:<i class="fa fa-question-circle-o"></i></label>
|
||||
<div class="col-sm-4">
|
||||
<select id="size" name="size" class="form-control required" >
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<select id="color" name="color" class="form-control required" >
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">操作数量:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="amount" class="form-control digits" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="form-group"> -->
|
||||
<!-- <label class="col-sm-3 control-label">价值:</label>-->
|
||||
<!-- <div class="col-sm-8">-->
|
||||
<!-- <input name="productValue" class="form-control" type="text">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">每包数量:</label>
|
||||
<div class="col-sm-6">
|
||||
<input name="amountPerPackage" class="form-control digits" type="text">
|
||||
</div>
|
||||
<div class="col-sm-2">
|
||||
<a class="btn btn-info" >生成二维码</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">备注信息:</label>
|
||||
<div class="col-sm-8">
|
||||
<textarea name="remark" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "busi/productOperate"
|
||||
var sizeDatas = [[${@dict.getType('busi_size')}]];
|
||||
var colorDatas = [[${@dict.getType('busi_color')}]];
|
||||
$("#form-productOperate-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-productOperate-add').serialize());
|
||||
}
|
||||
}
|
||||
|
||||
$("#size").change(function(){
|
||||
var lineId = $("#lineTreeId").val();
|
||||
var size = $("#size").val();
|
||||
queryColorList(lineId, size);
|
||||
})
|
||||
|
||||
$("#color").change(function(){
|
||||
var orderId = $("#color :selected").attr("orderId");
|
||||
var taskId = $("#color :selected").attr("taskId");
|
||||
var subTaskId = $("#color :selected").attr("subTaskId");
|
||||
$("#orderId").val(orderId);
|
||||
$("#taskId").val(taskId);
|
||||
$("#subTaskId").val(subTaskId);
|
||||
})
|
||||
/*监区产线-新增-选择父监区产线树*/
|
||||
function selectPrisonLineTree() {
|
||||
var options = {
|
||||
title: '产线选择',
|
||||
width: "380",
|
||||
url: ctx + "busi/prisonLine/selectPrisonLineTree/" + $("#lineTreeId").val()+"?status=1",
|
||||
callBack: function(index, layer){
|
||||
var body = $.modal.getChildFrame(index);
|
||||
console.log(body);
|
||||
$("#lineTreeId").val(body.find('#treeId').val());
|
||||
$("#lineTreeName").val(body.find('#treeName').val());
|
||||
$.modal.close(index);
|
||||
querySizeList(body.find('#treeId').val());
|
||||
}
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
/*产品任务尺码查询*/
|
||||
function querySizeList(lineId) {
|
||||
var url = prefix + "/selProductSizeByLineId?lineId=" + lineId;
|
||||
$.operate.ajaxPost(url, {}, function (result) {
|
||||
var data = result.data;
|
||||
$("#color").empty();
|
||||
$("#size").empty().append("<option value=''>请选择尺码</option>");
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var val = data[i].size;
|
||||
var text = $.table.getDictText(sizeDatas, val);
|
||||
$("#size").append("<option value='" + val + "'>" + text + "</option>");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/*产品任务颜色查询*/
|
||||
function queryColorList(lineId, size) {
|
||||
var url = prefix + "/selProductColorByLineIdAndSize";
|
||||
$.operate.ajaxPost(url, {
|
||||
lineId:lineId,
|
||||
size:size
|
||||
}, function (result) {
|
||||
var data = result.data;
|
||||
$("#color").empty().append("<option value=''>请选择颜色</option>");
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
var val = data[i].color;
|
||||
var text = $.table.getDictText(colorDatas, val);
|
||||
var orderId = data[i].orderId;
|
||||
var taskId = data[i].taskId;
|
||||
var subTaskId = data[i].subTaskId;
|
||||
$("#color").append("<option orderId='" + orderId + "' taskId='" + taskId + + "' subTaskId='" + subTaskId + " 'value='" + val + "'>" + text + "</option>");
|
||||
}
|
||||
})
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -11,18 +11,36 @@
|
|||
<div class="select-list">
|
||||
<ul>
|
||||
<li>
|
||||
<label>成品库存:</label>
|
||||
<input type="text" name="productStockId"/>
|
||||
<label>订单:</label>
|
||||
<input id="treeId" name="orderId" type="text" style="display: none;">
|
||||
<input id="treeName" name="orderName" type="text" readonly="true" onclick="selectOrder()" >
|
||||
</li>
|
||||
<li>
|
||||
<label>任务:</label>
|
||||
<input type="text" name="taskId"/>
|
||||
<label>尺码:</label>
|
||||
<select name="size" th:with="type=${@dict.getType('busi_size')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label>操作类型:</label>
|
||||
<label>颜色:</label>
|
||||
<select name="color" th:with="type=${@dict.getType('busi_color')}">
|
||||
<option value="">所有</option>
|
||||
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
<label>产线:</label>
|
||||
<input id="lineTreeId" name="lineId" type="text" style="display: none;" />
|
||||
<input type="text" onclick="selectPrisonLineTree()" id="lineTreeName" readonly>
|
||||
</li>
|
||||
<li>
|
||||
<label>操作:</label>
|
||||
<select name="oprateType">
|
||||
<option value="">所有</option>
|
||||
<option value="-1">代码生成请选择字典属性</option>
|
||||
<option value="1">入库</option>
|
||||
<option value="2">出库</option>
|
||||
<option value="3">退回</option>
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
|
|
@ -35,15 +53,21 @@
|
|||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="busi:productOperate:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
<a class="btn btn-success" onclick="addIn()" shiro:hasPermission="busi:productOperate:add">
|
||||
<i class="fa fa-arrow-circle-down"></i> 入库
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="busi:productOperate:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
<a class="btn btn-success" onclick="addOut()" shiro:hasPermission="busi:productOperate:add">
|
||||
<i class="fa fa-arrow-circle-up"></i> 出库
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="busi:productOperate:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
<a class="btn btn-success" onclick="addBack()" shiro:hasPermission="busi:productOperate:add">
|
||||
<i class="fa fa-reply"></i> 退回
|
||||
</a>
|
||||
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="busi:productOperate:edit">-->
|
||||
<!-- <i class="fa fa-edit"></i> 修改-->
|
||||
<!-- </a>-->
|
||||
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="busi:productOperate:remove">-->
|
||||
<!-- <i class="fa fa-remove"></i> 删除-->
|
||||
<!-- </a>-->
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="busi:productOperate:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
|
|
@ -57,6 +81,8 @@
|
|||
<script th:inline="javascript">
|
||||
var editFlag = [[${@permission.hasPermi('busi:productOperate:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('busi:productOperate:remove')}]];
|
||||
var sizeDatas = [[${@dict.getType('busi_size')}]];
|
||||
var colorDatas = [[${@dict.getType('busi_color')}]];
|
||||
var prefix = ctx + "busi/productOperate";
|
||||
|
||||
$(function() {
|
||||
|
|
@ -76,13 +102,28 @@
|
|||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'productStockId',
|
||||
title: '成品库存'
|
||||
field: 'orderName',
|
||||
title: '订单'
|
||||
},
|
||||
{
|
||||
field: 'taskId',
|
||||
title: '任务'
|
||||
field: 'size',
|
||||
title: '尺码',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(sizeDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'color',
|
||||
title: '颜色',
|
||||
formatter: function(value, row, index) {
|
||||
return $.table.selectDictLabel(colorDatas, value);
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'lineName',
|
||||
title: '产线'
|
||||
},
|
||||
|
||||
{
|
||||
field: 'amount',
|
||||
title: '操作数量'
|
||||
|
|
@ -93,25 +134,81 @@
|
|||
},
|
||||
{
|
||||
field: 'oprateType',
|
||||
title: '操作类型'
|
||||
title: '操作类型',
|
||||
formatter: function(value, row, index) {
|
||||
if (value == "1") {
|
||||
return "<i class='fa fa-arrow-circle-down'>入库</i>";
|
||||
} else if (value == "2") {
|
||||
return "<i class='fa fa-arrow-circle-up'>出库</i>";
|
||||
} else {
|
||||
return "<i class='fa fa-reply'>退回</i>";
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
title: '备注信息'
|
||||
},
|
||||
{
|
||||
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('');
|
||||
}
|
||||
field: 'createTime',
|
||||
title: '操作时间'
|
||||
// },
|
||||
// {
|
||||
// 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 selectOrder() {
|
||||
var options = {
|
||||
title: '选择订单',
|
||||
width: "380",
|
||||
height: "400",
|
||||
url: ctx + "busi/order/selectOrder/" ,
|
||||
callBack: function(index, layero){
|
||||
var body = $.modal.getChildFrame(index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
$.modal.close(index);
|
||||
}
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
/*监区产线-新增-选择父监区产线树*/
|
||||
function selectPrisonLineTree() {
|
||||
var options = {
|
||||
title: '监区产线选择',
|
||||
width: "380",
|
||||
url: ctx + "busi/prisonLine/selectPrisonLineTree/" + $("#lineTreeId").val(),
|
||||
callBack: function(index, layer){
|
||||
var body = $.modal.getChildFrame(index);
|
||||
console.log(body);
|
||||
$("#lineTreeId").val(body.find('#treeId').val());
|
||||
$("#lineTreeName").val(body.find('#treeName').val());
|
||||
$.modal.close(index);
|
||||
}
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
|
||||
function addIn(){
|
||||
$.modal.open("添加入库", prefix + "/add?operType=1");
|
||||
}
|
||||
function addOut(){
|
||||
$.modal.open("添加出库", prefix + "/add?operType=2");
|
||||
}
|
||||
function addBack(){
|
||||
$.modal.open("添加退回", prefix + "/add?operType=3");
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -12,7 +12,8 @@
|
|||
<ul>
|
||||
<li>
|
||||
<label>订单:</label>
|
||||
<input type="text" name="orderId"/>
|
||||
<input id="treeId" name="orderId" type="text" style="display: none;">
|
||||
<input id="treeName" name="orderName" type="text" readonly="true" onclick="selectOrder()" >
|
||||
</li>
|
||||
<li>
|
||||
<label>尺码:</label>
|
||||
|
|
@ -38,15 +39,15 @@
|
|||
</div>
|
||||
|
||||
<div class="btn-group-sm" id="toolbar" role="group">
|
||||
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="busi:productStock:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="busi:productStock:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="busi:productStock:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<!-- <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="busi:productStock:add">-->
|
||||
<!-- <i class="fa fa-plus"></i> 添加-->
|
||||
<!-- </a>-->
|
||||
<!-- <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="busi:productStock:edit">-->
|
||||
<!-- <i class="fa fa-edit"></i> 修改-->
|
||||
<!-- </a>-->
|
||||
<!-- <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="busi:productStock:remove">-->
|
||||
<!-- <i class="fa fa-remove"></i> 删除-->
|
||||
<!-- </a>-->
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="busi:productStock:export">
|
||||
<i class="fa fa-download"></i> 导出
|
||||
</a>
|
||||
|
|
@ -81,12 +82,12 @@
|
|||
visible: false
|
||||
},
|
||||
{
|
||||
field: 'orderId',
|
||||
field: 'orderName',
|
||||
title: '订单'
|
||||
},
|
||||
{
|
||||
field: 'amount',
|
||||
title: '数量'
|
||||
title: '库存量'
|
||||
},
|
||||
{
|
||||
field: 'size',
|
||||
|
|
@ -103,18 +104,39 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
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('');
|
||||
}
|
||||
field: 'updateTime',
|
||||
title: '更新时间'
|
||||
// },
|
||||
// {
|
||||
// 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 selectOrder() {
|
||||
var options = {
|
||||
title: '选择订单',
|
||||
width: "380",
|
||||
height: "400",
|
||||
url: ctx + "busi/order/selectOrder/" ,
|
||||
callBack: function(index, layero){
|
||||
var body = $.modal.getChildFrame(index);
|
||||
$("#treeId").val(body.find('#treeId').val());
|
||||
$("#treeName").val(body.find('#treeName').val());
|
||||
$.modal.close(index);
|
||||
}
|
||||
};
|
||||
$.modal.openOptions(options);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,59 @@
|
|||
<!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-subtask-add">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">任务ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="taskId" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品需求ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="productRequireId" 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="targetAmount" 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">
|
||||
<input name="completedAmount" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">完成状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box">
|
||||
<input type="radio" name="status" value="" required>
|
||||
<label th:for="status" th:text="未知"></label>
|
||||
</div>
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "busi/subtask"
|
||||
$("#form-subtask-add").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/add", $('#form-subtask-add').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
<!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-subtask-edit" th:object="${busiSubTask}">
|
||||
<input name="id" th:field="*{id}" type="hidden">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">任务ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="taskId" th:field="*{taskId}" class="form-control" type="text" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">产品需求ID:</label>
|
||||
<div class="col-sm-8">
|
||||
<input name="productRequireId" th:field="*{productRequireId}" 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="targetAmount" th:field="*{targetAmount}" 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">
|
||||
<input name="completedAmount" th:field="*{completedAmount}" class="form-control" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label is-required">完成状态:</label>
|
||||
<div class="col-sm-8">
|
||||
<div class="radio-box">
|
||||
<input type="radio" name="status" value="" required>
|
||||
<label th:for="status" th:text="未知"></label>
|
||||
</div>
|
||||
<span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 代码生成请选择字典属性</span>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<th:block th:include="include :: footer" />
|
||||
<script th:inline="javascript">
|
||||
var prefix = ctx + "busi/subtask";
|
||||
$("#form-subtask-edit").validate({
|
||||
focusCleanup: true
|
||||
});
|
||||
|
||||
function submitHandler() {
|
||||
if ($.validate.form()) {
|
||||
$.operate.save(prefix + "/edit", $('#form-subtask-edit').serialize());
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -0,0 +1,121 @@
|
|||
<!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>任务ID:</label>
|
||||
<input type="text" name="taskId"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>产品需求ID:</label>
|
||||
<input type="text" name="productRequireId"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>目标数量:</label>
|
||||
<input type="text" name="targetAmount"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>完成数量:</label>
|
||||
<input type="text" name="completedAmount"/>
|
||||
</li>
|
||||
<li>
|
||||
<label>完成状态:</label>
|
||||
<select name="status">
|
||||
<option value="">所有</option>
|
||||
<option value="-1">代码生成请选择字典属性</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:subtask:add">
|
||||
<i class="fa fa-plus"></i> 添加
|
||||
</a>
|
||||
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="busi:subtask:edit">
|
||||
<i class="fa fa-edit"></i> 修改
|
||||
</a>
|
||||
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="busi:subtask:remove">
|
||||
<i class="fa fa-remove"></i> 删除
|
||||
</a>
|
||||
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="busi:subtask: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:subtask:edit')}]];
|
||||
var removeFlag = [[${@permission.hasPermi('busi:subtask:remove')}]];
|
||||
var prefix = ctx + "busi/subtask";
|
||||
|
||||
$(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: 'taskId',
|
||||
title: '任务ID'
|
||||
},
|
||||
{
|
||||
field: 'productRequireId',
|
||||
title: '产品需求ID'
|
||||
},
|
||||
{
|
||||
field: 'targetAmount',
|
||||
title: '目标数量'
|
||||
},
|
||||
{
|
||||
field: 'completedAmount',
|
||||
title: '完成数量'
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: '完成状态'
|
||||
},
|
||||
{
|
||||
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);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue