Browse Source

[feat]

添加仓库前端页面新增收货人、收货电话、收货地址字段,设置为必填
修改仓库前端页面新增收货人、收货电话、收货地址字段,设置为必填
仓库信息实体类新增收货人、收货电话、收货地址字段
仓库数据表新增收货人、收货电话、收货地址字段
仓库mapper.xml层新增收货人、收货电话、收货地址字段
采购计划添加采购订单前端页面新增 收货人、收货电话、收货地址字段,设置为只读属性;三者数据来自选择仓库Id后自动填充;
采购订单Controller层新增 采购计划添加采购订单后端接口
采购订单iml层新增 采购计划添加采购订单后端后端方法,加上事务同时处理多张表
采购计划添加采购订单第二步新增 收货人、收货电话、收货地址
采购订单子表新增 批量新增采购订单子表数据方法
修改采购订单实体类的物料合计为Integer类型
dev
liuxiaoxu 1 week ago
parent
commit
f8ad7dd460
  1. 15
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java
  2. 30
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java
  3. 10
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/Vo/PurchasePlanTwo.java
  4. 5
      ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderChildMapper.java
  5. 5
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderService.java
  6. 101
      ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java
  7. 45
      ruoyi-admin/src/main/java/com/ruoyi/stock/domain/StockInfo.java
  8. 18
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml
  9. 358
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml
  10. 15
      ruoyi-admin/src/main/resources/mapper/stock/StockInfoMapper.xml
  11. 727
      ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/purchaseOrder.html
  12. 24
      ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/addPurchaseOrder.html
  13. 23
      ruoyi-admin/src/main/resources/templates/stock/stockInfo/add.html
  14. 22
      ruoyi-admin/src/main/resources/templates/stock/stockInfo/edit.html

15
ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java

@ -165,7 +165,9 @@ public class PurchaseOrderController extends BaseController
} }
/**
* 采购计划添加采购订单
* */
@RequiresPermissions("purchase:purchaseOrder:add") @RequiresPermissions("purchase:purchaseOrder:add")
@Log(title = "采购订单", businessType = BusinessType.INSERT) @Log(title = "采购订单", businessType = BusinessType.INSERT)
@PostMapping("/addPurchaseOrder") @PostMapping("/addPurchaseOrder")
@ -180,17 +182,8 @@ public class PurchaseOrderController extends BaseController
// 数据校验,确保前端传入数据格式正确 // 数据校验,确保前端传入数据格式正确
// 执行主表插入操作 // 执行主表插入操作
PurchasePlanOne purchasePlanOne = addPurchaseOrder.getPurchasePlanOne();
PurchasePlanTwo purchasePlanTwo = addPurchaseOrder.getPurchasePlanTwo();
List<PurchasePlanSelectSupplierVo> purchasePlanSelectSupplierVoList = addPurchaseOrder.getPurchasePlanSelectSupplierVoList();
List<PurchasePlanSelectMaterialVo> purchasePlanSelectMaterialVoList = addPurchaseOrder.getPurchasePlanSelectMaterialVoList(); return toAjax(purchaseOrderService.addPurchasePlanToPurchaseOrder(addPurchaseOrder));
System.out.println(addPurchaseOrder.getPurchasePlanOne());
return AjaxResult.success(); // 假设toAjax方法处理成功逻辑
} }
/** /**

30
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/PurchaseOrder.java

@ -47,7 +47,7 @@ public class PurchaseOrder extends BaseEntity
/** 物料合计 */ /** 物料合计 */
@Excel(name = "物料合计") @Excel(name = "物料合计")
private String materialSum; private Integer materialSum;
/** 实际采购总数 */ /** 实际采购总数 */
@Excel(name = "实际采购总数") @Excel(name = "实际采购总数")
@ -67,7 +67,7 @@ public class PurchaseOrder extends BaseEntity
/** 不含税总价(RMB) */ /** 不含税总价(RMB) */
@Excel(name = "不含税总价(RMB)") @Excel(name = "不含税总价(RMB)")
private BigDecimal normbSum; private BigDecimal noRmbSum;
/** 含税总价(RMB) */ /** 含税总价(RMB) */
@Excel(name = "含税总价(RMB)") @Excel(name = "含税总价(RMB)")
@ -203,15 +203,15 @@ public class PurchaseOrder extends BaseEntity
{ {
return supplierName; return supplierName;
} }
public void setMaterialSum(String materialSum)
{
this.materialSum = materialSum;
}
public String getMaterialSum() public Integer getMaterialSum() {
{
return materialSum; return materialSum;
} }
public void setMaterialSum(Integer materialSum) {
this.materialSum = materialSum;
}
public void setActualPurchaseSum(Integer actualPurchaseSum) public void setActualPurchaseSum(Integer actualPurchaseSum)
{ {
this.actualPurchaseSum = actualPurchaseSum; this.actualPurchaseSum = actualPurchaseSum;
@ -248,15 +248,15 @@ public class PurchaseOrder extends BaseEntity
{ {
return storageSum; return storageSum;
} }
public void setNormbSum(BigDecimal normbSum)
{ public BigDecimal getNoRmbSum() {
this.normbSum = normbSum; return noRmbSum;
} }
public BigDecimal getNormbSum() public void setNoRmbSum(BigDecimal noRmbSum) {
{ this.noRmbSum = noRmbSum;
return normbSum;
} }
public void setRmbSum(BigDecimal rmbSum) public void setRmbSum(BigDecimal rmbSum)
{ {
this.rmbSum = rmbSum; this.rmbSum = rmbSum;
@ -453,7 +453,7 @@ public class PurchaseOrder extends BaseEntity
.append("sharedInventoryOccupancySum", getSharedInventoryOccupancySum()) .append("sharedInventoryOccupancySum", getSharedInventoryOccupancySum())
.append("refundsExchangesSum", getRefundsExchangesSum()) .append("refundsExchangesSum", getRefundsExchangesSum())
.append("storageSum", getStorageSum()) .append("storageSum", getStorageSum())
.append("normbSum", getNormbSum()) .append("noRmbSum", getNoRmbSum())
.append("rmbSum", getRmbSum()) .append("rmbSum", getRmbSum())
.append("eceiptType", getEceiptType()) .append("eceiptType", getEceiptType())
.append("arrivedTime", getArrivedTime()) .append("arrivedTime", getArrivedTime())

10
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/Vo/PurchasePlanTwo.java

@ -32,6 +32,16 @@ public class PurchasePlanTwo {
/** 仓库名称*/ /** 仓库名称*/
private String warehouseName; private String warehouseName;
/** 收货人*/
private String receivePerson;
/** 收货人电话*/
private String receivePersonPhone;
/** 收货地址*/
private String receiveAddress;
/** 物料合计*/ /** 物料合计*/
private Integer materialSum; private Integer materialSum;

5
ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderChildMapper.java

@ -115,4 +115,9 @@ public interface PurchaseOrderChildMapper
* 通过料号查询采购订单子表列表 * 通过料号查询采购订单子表列表
* */ * */
List<PurchaseOrderChild> selectOrderChildListByMaterialNo(String materialCode); List<PurchaseOrderChild> selectOrderChildListByMaterialNo(String materialCode);
/**
* 批量新增采购订单子表数据
* */
int batchInsertPurchaseOrderChild(List<PurchaseOrderChild> purchaseOrderChildren);
} }

5
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/IPurchaseOrderService.java

@ -4,6 +4,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.purchase.domain.PurchaseOrder; import com.ruoyi.purchase.domain.PurchaseOrder;
import com.ruoyi.purchase.domain.PurchaseOrderVo; import com.ruoyi.purchase.domain.PurchaseOrderVo;
import com.ruoyi.purchase.domain.PurchasePlan; import com.ruoyi.purchase.domain.PurchasePlan;
import com.ruoyi.purchase.domain.Vo.AddPurchaseOrder;
import com.ruoyi.warehouse.domain.WarehouseStorageOrder; import com.ruoyi.warehouse.domain.WarehouseStorageOrder;
import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -100,4 +101,8 @@ public interface IPurchaseOrderService
AjaxResult uploadSingleFile(MultipartFile file,String purchaseOrderCode); AjaxResult uploadSingleFile(MultipartFile file,String purchaseOrderCode);
/**
* 采购计划添加采购订单
* */
int addPurchasePlanToPurchaseOrder(AddPurchaseOrder addPurchaseOrder);
} }

101
ruoyi-admin/src/main/java/com/ruoyi/purchase/service/impl/PurchaseOrderServiceImpl.java

@ -14,6 +14,7 @@ import com.ruoyi.common.core.page.PageDomain;
import com.ruoyi.common.core.page.TableSupport; import com.ruoyi.common.core.page.TableSupport;
import com.ruoyi.common.core.redis.RedisCache; import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.exception.BusinessException;
import com.ruoyi.common.service.ICommonService; import com.ruoyi.common.service.ICommonService;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.MoneyUtils; import com.ruoyi.common.utils.MoneyUtils;
@ -28,12 +29,11 @@ import com.ruoyi.financial.domain.FinancialAccountsPayable;
import com.ruoyi.financial.mapper.FinancialAccountsPayableMapper; import com.ruoyi.financial.mapper.FinancialAccountsPayableMapper;
import com.ruoyi.process.general.service.IProcessService; import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper; import com.ruoyi.process.todoitem.mapper.BizTodoItemMapper;
import com.ruoyi.purchase.domain.PurchaseOrder; import com.ruoyi.purchase.domain.*;
import com.ruoyi.purchase.domain.PurchaseOrderChild; import com.ruoyi.purchase.domain.Vo.*;
import com.ruoyi.purchase.domain.PurchaseOrderVo;
import com.ruoyi.purchase.domain.PurchasePlan;
import com.ruoyi.purchase.mapper.PurchaseOrderChildMapper; import com.ruoyi.purchase.mapper.PurchaseOrderChildMapper;
import com.ruoyi.purchase.mapper.PurchaseOrderMapper; import com.ruoyi.purchase.mapper.PurchaseOrderMapper;
import com.ruoyi.purchase.mapper.PurchasePlanChildMapper;
import com.ruoyi.purchase.mapper.PurchasePlanMapper; import com.ruoyi.purchase.mapper.PurchasePlanMapper;
import com.ruoyi.purchase.service.IPurchaseOrderService; import com.ruoyi.purchase.service.IPurchaseOrderService;
import com.ruoyi.system.domain.SysAttachFile; import com.ruoyi.system.domain.SysAttachFile;
@ -86,6 +86,12 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
@Autowired @Autowired
private PurchaseOrderMapper purchaseOrderMapper; private PurchaseOrderMapper purchaseOrderMapper;
@Autowired
private PurchaseOrderChildMapper purchaseOrderChildMapper;
@Autowired
private PurchasePlanChildMapper purchasePlanChildMapper;
@Autowired @Autowired
private RedisCache redisCache; private RedisCache redisCache;
@ -119,11 +125,6 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
@Autowired @Autowired
private ISysRoleService roleService; private ISysRoleService roleService;
@Autowired
private PurchaseOrderChildMapper purchaseOrderChildService;
@Autowired
private PurchasePlanMapper purchasePlanService;
@Autowired @Autowired
private FinancialAccountsPayableMapper financialAccountsPayableMapper; private FinancialAccountsPayableMapper financialAccountsPayableMapper;
@ -234,6 +235,86 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
{ {
return 1; return 1;
} }
/**
* 采购计划添加采购订单
* */
@Transactional(rollbackFor = Exception.class)
@Override
public int addPurchasePlanToPurchaseOrder(AddPurchaseOrder addPurchaseOrder) {
String loginName = ShiroUtils.getLoginName();
PurchasePlanTwo purchasePlanTwo = addPurchaseOrder.getPurchasePlanTwo();
PurchasePlanOne purchasePlanOne = addPurchaseOrder.getPurchasePlanOne();
List<PurchasePlanSelectSupplierVo> purchasePlanSelectSupplierVoList = addPurchaseOrder.getPurchasePlanSelectSupplierVoList();
List<PurchasePlanSelectMaterialVo> purchasePlanSelectMaterialVoList = addPurchaseOrder.getPurchasePlanSelectMaterialVoList();
PurchaseOrder purchaseOrder = new PurchaseOrder();
purchaseOrder.setPurchaseOrderCode(redisCache.generateBillNo("CG"));
purchaseOrder.setPurchasePlanCode(purchasePlanOne.getPurchasePlanCodes());
purchaseOrder.setPaymentStatus("0");
purchaseOrder.setSupplierCode(purchasePlanTwo.getSupplierCode());
purchaseOrder.setSupplierName(purchasePlanTwo.getSupplierName());
purchaseOrder.setWarehouseStorageStatus("6"); //待入库
purchaseOrder.setPurchaseBuyer(loginName);
purchaseOrder.setMaterialSum(purchasePlanTwo.getMaterialSum());
purchaseOrder.setActualPurchaseSum(purchasePlanTwo.getThisPurchaseSum());
purchaseOrder.setSharedInventoryOccupancySum(purchasePlanTwo.getSharedInventoryOccupancySum());
purchaseOrder.setNoRmbSum(purchasePlanTwo.getNoRmbSum());
purchaseOrder.setRmbSum(purchasePlanTwo.getRmbSum());
purchaseOrder.setStockNo(purchasePlanTwo.getWarehouseCode());
purchaseOrder.setStockName(purchasePlanTwo.getWarehouseName());
purchaseOrder.setReceivePerson(purchasePlanTwo.getReceivePerson());
purchaseOrder.setReceivePersonPhone(purchasePlanTwo.getReceivePersonPhone());
purchaseOrder.setReceiveAddress(purchasePlanTwo.getReceiveAddress());
purchaseOrder.setCreateTime(new Date());
purchaseOrder.setCreateBy(loginName);
buildPurchaseChild(purchasePlanSelectMaterialVoList, purchaseOrder);
int result = purchaseOrderMapper.insertPurchaseOrder(purchaseOrder);
if (result <= 0){
throw new BusinessException("添加采购订单数据失败");
}
return result;
}
//新增采购订单子表
private void buildPurchaseChild(List<PurchasePlanSelectMaterialVo> purchasePlanSelectMaterialVoList, PurchaseOrder purchaseOrder) {
List<PurchaseOrderChild> purchaseOrderChildren = new ArrayList<>();
for (PurchasePlanSelectMaterialVo purchasePlanSelectMaterialVo : purchasePlanSelectMaterialVoList) {
PurchaseOrderChild purchaseOrderChild = new PurchaseOrderChild();
Long purchasePlanChildId = purchasePlanSelectMaterialVo.getPurchasePlanChildId();
PurchasePlanChild purchasePlanChild = purchasePlanChildMapper.selectPurchasePlanChildById(purchasePlanChildId);
purchaseOrderChild.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode());
purchaseOrderChild.setMaterialNo(purchasePlanSelectMaterialVo.getMaterialNo());
purchaseOrderChild.setMaterialName(purchasePlanSelectMaterialVo.getMaterialName());
purchaseOrderChild.setMaterialBrand(purchasePlanSelectMaterialVo.getMaterialBrand());
purchaseOrderChild.setMaterialDescribe(purchasePlanSelectMaterialVo.getMaterialDescribe());
purchaseOrderChild.setMaterialModel(purchasePlanSelectMaterialVo.getMaterialModel());
purchasePlanChild.setMaterialProcessMethod(purchasePlanChild.getMaterialProcessMethod());
purchaseOrderChild.setMaterialUnit(purchasePlanChild.getMaterialUnit());
purchaseOrderChild.setMaterialPhotourl(purchasePlanChild.getMaterialPhotourl());
purchaseOrderChild.setMaterialType(purchasePlanChild.getMaterialType());
purchaseOrderChild.setWarehouseDept(purchasePlanChild.getWarehouseDept());
purchaseOrderChild.setPlanDeliveryTime(purchasePlanSelectMaterialVo.getPlanDeliveryTime());
purchaseOrderChild.setSharedInventoryOccupancyNum(purchasePlanSelectMaterialVo.getSharedInventoryOccupancyNum());
purchaseOrderChild.setMaterialNormbSum(purchasePlanSelectMaterialVo.getMaterialNoRmbSum());
purchaseOrderChild.setMaterialRmbSum(purchasePlanSelectMaterialVo.getMaterialRmbSum());
purchaseOrderChild.setPlanPurchaseNum(purchasePlanSelectMaterialVo.getThisPurchaseNum());
purchaseOrderChild.setActualPurchaseNum(purchasePlanSelectMaterialVo.getThisPurchaseNum());
purchaseOrderChild.setCreateBy(ShiroUtils.getLoginName());
purchaseOrderChild.setCreateTime(new Date());
purchaseOrderChildren.add(purchaseOrderChild);
}
int result = purchaseOrderChildMapper.batchInsertPurchaseOrderChild(purchaseOrderChildren);
if (result <= 0){
throw new BusinessException("新增采购订单子表数据失败");
}
}
//生成应付账款,根据物料的供应商划分应付供应商,供应商的物料价格合计。 //生成应付账款,根据物料的供应商划分应付供应商,供应商的物料价格合计。
public int purchaseOrderPayment(PurchaseOrder purchaseOrder) { public int purchaseOrderPayment(PurchaseOrder purchaseOrder) {
//获取物料供应商的信息,采购订单的供应商数量 //获取物料供应商的信息,采购订单的供应商数量
@ -508,7 +589,7 @@ public class PurchaseOrderServiceImpl implements IPurchaseOrderService
PurchaseOrderChild purchaseOrderChild = new PurchaseOrderChild(); PurchaseOrderChild purchaseOrderChild = new PurchaseOrderChild();
purchaseOrderChild.setPurchaseOrderCode(purchaseOrderCode); purchaseOrderChild.setPurchaseOrderCode(purchaseOrderCode);
//purchaseOrderChild.setSupplierCode(supplierCode); //purchaseOrderChild.setSupplierCode(supplierCode);
List<PurchaseOrderChild> purchaseOrderChildList = purchaseOrderChildService.selectChildListBySupplierCodeAndOrderCode(purchaseOrderChild); List<PurchaseOrderChild> purchaseOrderChildList = purchaseOrderChildMapper.selectChildListBySupplierCodeAndOrderCode(purchaseOrderChild);
List<Map<String, Object>> detailList = new ArrayList<>(); List<Map<String, Object>> detailList = new ArrayList<>();

45
ruoyi-admin/src/main/java/com/ruoyi/stock/domain/StockInfo.java

@ -37,6 +37,24 @@ public class StockInfo extends BaseEntity
@Excel(name = "仓库地址") @Excel(name = "仓库地址")
private String stockAddr; private String stockAddr;
/** 收货人 */
@FieldCompare(chineseName = "收货人")
@Excel(name = "收货人")
private String receivePerson;
/** 收货人电话 */
@FieldCompare(chineseName = "收货人电话")
@Excel(name = "收货人电话")
private String receivePersonPhone;
/** 收货人地址*/
@FieldCompare(chineseName = "收货人地址")
@Excel(name = "收货人地址")
private String receiveAddress;
/** 仓库管理人 */ /** 仓库管理人 */
@FieldCompare(chineseName = "仓库管理人") @FieldCompare(chineseName = "仓库管理人")
@Excel(name = "仓库管理人") @Excel(name = "仓库管理人")
@ -91,6 +109,30 @@ public class StockInfo extends BaseEntity
this.stockAddr = stockAddr; this.stockAddr = stockAddr;
} }
public String getReceivePerson() {
return receivePerson;
}
public void setReceivePerson(String receivePerson) {
this.receivePerson = receivePerson;
}
public String getReceivePersonPhone() {
return receivePersonPhone;
}
public void setReceivePersonPhone(String receivePersonPhone) {
this.receivePersonPhone = receivePersonPhone;
}
public String getReceiveAddress() {
return receiveAddress;
}
public void setReceiveAddress(String receiveAddress) {
this.receiveAddress = receiveAddress;
}
public String getStockManager() { public String getStockManager() {
return stockManager; return stockManager;
} }
@ -131,6 +173,9 @@ public class StockInfo extends BaseEntity
.append("stockNO", getStockNO()) .append("stockNO", getStockNO())
.append("stockName", getStockName()) .append("stockName", getStockName())
.append("stockAddr", getStockAddr()) .append("stockAddr", getStockAddr())
.append("receivePerson", getReceivePerson())
.append("receivePersonPhone", getReceivePersonPhone())
.append("receiveAddress", getReceiveAddress())
.append("stockManager", getStockManager()) .append("stockManager", getStockManager())
.append("stockmemo", getStockMemo()) .append("stockmemo", getStockMemo())
.append("firstAddTime", getFirstAddTime()) .append("firstAddTime", getFirstAddTime())

18
ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml

@ -97,6 +97,24 @@
</trim> </trim>
</insert> </insert>
<insert id="batchInsertPurchaseOrderChild" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="purchaseOrderChildId">
insert into purchase_order_child
(purchase_order_code, material_no, material_name, material_type, material_photoUrl, material_brand, material_unit,
material_describe, material_process_method, material_model, warehouse_dept, material_noRmb_sum, material_rmb_sum,
plan_purchase_num, actual_purchase_num, shared_inventory_occupancy_num, plan_delivery_time, create_by, create_time
)
values
<foreach collection="list" item="item" index="index" open="(" close=")" separator="),(">
#{item.purchaseOrderCode}, #{item.materialNo}, #{item.materialName}, #{item.materialType}, #{item.materialPhotourl},
#{item.materialBrand}, #{item.materialUnit}, #{item.materialDescribe}, #{item.materialProcessMethod}, #{item.materialModel},
#{item.warehouseDept}, #{item.materialNormbSum}, #{item.materialRmbSum}, #{item.planPurchaseNum}, #{item.actualPurchaseNum},
#{item.sharedInventoryOccupancyNum}, #{item.planDeliveryTime}, #{item.createBy}, #{item.createTime}
</foreach>
</insert>
<update id="updatePurchaseOrderChild" parameterType="PurchaseOrderChild"> <update id="updatePurchaseOrderChild" parameterType="PurchaseOrderChild">
update purchase_order_child update purchase_order_child
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">

358
ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderMapper.xml

@ -1,125 +1,64 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.purchase.mapper.PurchaseOrderMapper"> <mapper namespace="com.ruoyi.purchase.mapper.PurchaseOrderMapper">
<resultMap type="PurchaseOrderVo" id="PurchaseOrderResult">
<result property="purchaseOrderId" column="purchase_order_id" /> <resultMap type="PurchaseOrderVo" id="PurchaseOrderResult">
<result property="purchaseOrderCode" column="purchase_order_code" /> <result property="purchaseOrderId" column="purchase_order_id" />
<result property="purchaseBuyer" column="purchase_buyer" /> <result property="purchaseOrderCode" column="purchase_order_code" />
<result property="useStatus" column="use_status" /> <result property="purchasePlanCode" column="purchase_plan_code" />
<result property="auditStatus" column="audit_status" /> <result property="warehouseStorageStatus" column="warehouse_storage_status" />
<result property="eceiptStatus" column="eceipt_status" /> <result property="paymentStatus" column="payment_status" />
<result property="paymentStatus" column="payment_status" /> <result property="supplierCode" column="supplier_code" />
<result property="supplierNum" column="supplier_num" /> <result property="supplierName" column="supplier_name" />
<result property="materialAmount" column="material_amount" /> <result property="materialSum" column="material_sum" />
<result property="materialSum" column="material_sum" /> <result property="actualPurchaseSum" column="actual_purchase_sum" />
<result property="noRmbSum" column="noRmbSum" /> <result property="sharedInventoryOccupancySum" column="shared_inventory_occupancy_sum" />
<result property="rmbSum" column="rmbSum" /> <result property="refundsExchangesSum" column="refunds_exchanges_sum" />
<result property="supplierCode" column="supplier_code" /> <result property="storageSum" column="storage_sum" />
<result property="supplierName" column="supplier_name" /> <result property="noRmbSum" column="noRmb_sum" />
<result property="eceiptType" column="eceipt_type" /> <result property="rmbSum" column="rmb_sum" />
<result property="arrivedTime" column="arrived_time" /> <result property="eceiptType" column="eceipt_type" />
<result property="customerContact" column="customer_contact" /> <result property="arrivedTime" column="arrived_time" />
<result property="contactNumber" column="contact_number" /> <result property="stockNo" column="stock_no" />
<result property="customerFax" column="customer_fax" /> <result property="stockName" column="stock_name" />
<result property="deliveryAddress" column="delivery_address" /> <result property="receivePerson" column="receive_person" />
<result property="paymentTerms" column="payment_terms" /> <result property="receivePersonPhone" column="receive_person_phone" />
<result property="deliveryConditions" column="delivery_conditions" /> <result property="receiveAddress" column="receive_address" />
<result property="deliveryMethod" column="delivery_method" /> <result property="purchaseBuyer" column="purchase_buyer" />
<result property="purchaseName" column="purchase_name" /> <result property="useStatus" column="use_status" />
<result property="billingDate" column="billing_date" /> <result property="auditStatus" column="audit_status" />
<result property="taxRate" column="tax_rate" /> <result property="createBy" column="create_by" />
<result property="purchaseCategory" column="purchase_category" /> <result property="createTime" column="create_time" />
<result property="purchaseCommander" column="purchase_commander" /> <result property="updateBy" column="update_by" />
<result property="customerOrderNumber" column="customer_order_number" /> <result property="updateTime" column="update_time" />
<result property="remarkContent" column="remark_content" /> <result property="delFlag" column="del_flag" />
<result property="closeCaseNo" column="close_case_no" /> <result property="instanceId" column="instance_id" />
<result property="closeCaseName" column="close_case_name" /> <result property="instanceType" column="instance_type" />
<result property="closeCaseTime" column="close_case_time" /> <result property="submitInstanceId" column="submit_instance_id" />
<result property="standbyOne" column="standby_one" /> <result property="cancelInstanceId" column="cancel_instance_id" />
<result property="standbyTwo" column="standby_two" /> <result property="restoreInstanceId" column="restore_instance_id" />
<result property="delFlag" column="del_flag" /> <result property="applyTitle" column="apply_title" />
<result property="stockNo" column="stock_no" /> <result property="applyUser" column="apply_user" />
<result property="stockName" column="stock_name" /> <result property="applyTime" column="apply_time" />
<result property="stockAddress" column="stock_address" />
<result property="stockContact" column="stock_contact" />
<result property="stockPhone" column="stock_phone" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="instanceId" column="instance_id" />
<result property="instanceType" column="instance_type" />
<result property="instanceTypeName" column="instance_type_name" />
<result property="submitInstanceId" column="submit_instance_id" />
<result property="cancelInstanceId" column="cancel_instance_id" />
<result property="restoreInstanceId" column="restore_instance_id" />
<result property="applyTitle" column="apply_title" />
<result property="applyUser" column="apply_user" />
<result property="applyTime" column="apply_time" />
<result property="delFlag" column="del_flag" />
</resultMap> </resultMap>
<sql id="selectPurchaseOrderVo"> <sql id="selectPurchaseOrderVo">
select purchase_order_id, purchase_order_code, supplier_code, supplier_name, select purchase_order_id, purchase_order_code, purchase_plan_code, warehouse_storage_status, payment_status, supplier_code, supplier_name, material_sum, actual_purchase_sum, shared_inventory_occupancy_sum, refunds_exchanges_sum, storage_sum, noRmb_sum, rmb_sum, eceipt_type, arrived_time, stock_no, stock_name, receive_person, receive_person_phone, receive_address, purchase_buyer, use_status, audit_status, create_by, create_time, update_by, update_time, del_flag, instance_id, instance_type, submit_instance_id, cancel_instance_id, restore_instance_id, apply_title, apply_user, apply_time from purchase_order
arrived_time, eceipt_type,eceipt_status, payment_status, supplier_num, material_amount,
material_sum, noRmbSum, rmbSum, use_status, audit_status, purchase_buyer,
customer_contact, contact_number, customer_fax, delivery_address, payment_terms,
delivery_conditions, delivery_method, purchase_name, billing_date, tax_rate,
purchase_category, purchase_commander, customer_order_number, remark_content,
close_case_no, close_case_name, close_case_time,confirm_no,confirm_time,confirm_name,
del_flag, stock_no, stock_name, stock_address, stock_contact, stock_phone,
approve_time, standby_one, standby_two,create_time, create_by, update_time, update_by,
instance_id, instance_type, submit_instance_id, cancel_instance_id,
restore_instance_id, apply_title, apply_user, apply_time
from purchase_order
</sql> </sql>
<select id="selectPurchaseOrderList" parameterType="PurchaseOrder" resultMap="PurchaseOrderResult"> <select id="selectPurchaseOrderList" parameterType="PurchaseOrder" resultMap="PurchaseOrderResult">
select pur.purchase_order_id, pur.purchase_order_code, pur.supplier_code, pur.supplier_name, <include refid="selectPurchaseOrderVo"/>
pur.arrived_time, pur.eceipt_type, pur.eceipt_status, pur.payment_status, pur.supplier_num, pur.material_amount,
pur.material_sum, pur.noRmbSum, pur.rmbSum, pur.use_status, pur.audit_status, pur.purchase_buyer,
pur.customer_contact, pur.contact_number, pur.customer_fax, pur.delivery_address, pur.payment_terms,
pur.delivery_conditions, pur.delivery_method, pur.purchase_name, pur.billing_date, pur.tax_rate,
pur.purchase_category, pur.purchase_commander, pur.customer_order_number, pur.remark_content,
pur.close_case_no, pur.close_case_name, pur.close_case_time, pur.del_flag, pur.stock_no, pur.stock_name,
pur.stock_address, pur.stock_contact, pur.stock_phone, pur.create_time, pur.create_by, pur.update_time, pur.update_by,
pur.instance_id, pur.instance_type, p.dict_label as instance_type_name, pur.submit_instance_id, pur.cancel_instance_id,
pur.restore_instance_id, pur.apply_title, pur.apply_user, pur.apply_time
from purchase_order as pur
left join(
select dict_value,dict_label from sys_dict_data
where dict_type = 'processType'
) as p
on pur.instance_type = p.dict_value
<where> <where>
pur.del_flag = '0' <if test="purchaseOrderCode != null and purchaseOrderCode != ''"> and purchase_order_code like concat('%', #{purchaseOrderCode}, '%')</if>
<if test="purchaseOrderCode != null and purchaseOrderCode != ''"> and pur.purchase_order_code like concat('%', #{purchaseOrderCode}, '%')</if> <if test="purchasePlanCode != null and purchasePlanCode != ''"> and purchase_plan_code = #{purchasePlanCode}</if>
<if test="purchaseBuyer != null and purchaseBuyer != ''"> and pur.purchase_buyer = #{purchaseBuyer}</if> <if test="warehouseStorageStatus != null and warehouseStorageStatus != ''"> and warehouse_storage_status = #{warehouseStorageStatus}</if>
<if test="supplierCode != null and supplierCode != ''"> <if test="paymentStatus != null and paymentStatus != ''"> and payment_status = #{paymentStatus}</if>
and pur.purchase_order_code in ( select purchase_order_code from purchase_order_child where supplier_code = #{supplierCode}) <if test="supplierCode != null and supplierCode != ''"> and supplier_code like concat('%', #{supplierCode}, '%')</if>
</if> <if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="supplierName != null and supplierName != ''"> <if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
and pur.purchase_order_code in ( select purchase_order_code from purchase_order_child where supplier_name = #{supplierName})
</if>
<if test="auditStatus != null and auditStatus != ''">and pur.audit_status = #{auditStatus}</if>
<if test="useStatus != null and useStatus != ''">and pur.use_status = #{useStatus}</if>
<if test="eceiptStatus != null and eceiptStatus !='' ">and pur.eceipt_status = #{eceiptStatus}</if>
<if test="paymentStatus != null and paymentStatus != '' ">and pur.payment_status = #{paymentStatus}</if>
<if test="instanceId != null and instanceId != ''"> and pur.instance_id = #{instanceId}</if>
<if test="instanceType != null and instanceType != ''"> and pur.instance_type = #{instanceType}</if>
<if test="submitInstanceId != null and submitInstanceId != ''"> and pur.submit_instance_id = #{submitInstanceId}</if>
<if test="cancelInstanceId != null and cancelInstanceId != ''"> and pur.cancel_instance_id = #{cancelInstanceId}</if>
<if test="restoreInstanceId != null and restoreInstanceId != ''"> and pur.restore_instance_id = #{restoreInstanceId}</if>
<if test="applyTitle != null and applyTitle != ''"> and pur.apply_title = #{applyTitle}</if>
<if test="applyUser != null and applyUser != ''"> and pur.apply_user = #{applyUser}</if>
<if test="applyTime != null "> and pur.apply_time = #{applyTime}</if>
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''">
and pur.create_time between #{params.beginCreateTime} and #{params.endCreateTime}
</if>
</where> </where>
order by pur.audit_status asc, pur.create_time desc
</select> </select>
<select id="selectPurchaseOrderById" parameterType="Long" resultMap="PurchaseOrderResult"> <select id="selectPurchaseOrderById" parameterType="Long" resultMap="PurchaseOrderResult">
@ -131,39 +70,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into purchase_order insert into purchase_order
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="purchaseOrderCode != null">purchase_order_code,</if> <if test="purchaseOrderCode != null">purchase_order_code,</if>
<if test="customerContact != null">customer_contact,</if> <if test="purchasePlanCode != null">purchase_plan_code,</if>
<if test="contactNumber != null">contact_number,</if> <if test="warehouseStorageStatus != null">warehouse_storage_status,</if>
<if test="customerFax != null">customer_fax,</if> <if test="paymentStatus != null">payment_status,</if>
<if test="deliveryAddress != null">delivery_address,</if> <if test="supplierCode != null">supplier_code,</if>
<if test="paymentTerms != null">payment_terms,</if> <if test="supplierName != null">supplier_name,</if>
<if test="deliveryConditions != null">delivery_conditions,</if> <if test="materialSum != null">material_sum,</if>
<if test="deliveryMethod != null">delivery_method,</if> <if test="actualPurchaseSum != null">actual_purchase_sum,</if>
<if test="purchaseName != null">purchase_name,</if> <if test="sharedInventoryOccupancySum != null">shared_inventory_occupancy_sum,</if>
<if test="billingDate != null">billing_date,</if> <if test="refundsExchangesSum != null">refunds_exchanges_sum,</if>
<if test="taxRate != null">tax_rate,</if> <if test="storageSum != null">storage_sum,</if>
<if test="purchaseCategory != null">purchase_category,</if> <if test="noRmbSum != null">noRmb_sum,</if>
<if test="purchaseCommander != null">purchase_commander,</if> <if test="rmbSum != null">rmb_sum,</if>
<if test="customerOrderNumber != null">customer_order_number,</if> <if test="eceiptType != null">eceipt_type,</if>
<if test="remarkContent != null">remark_content,</if>
<if test="standbyOne != null">standby_one,</if>
<if test="standbyTwo != null">standby_two,</if>
<if test="stockNo!= null">stock_no,</if>
<if test="stockName!= null">stock_name,</if>
<if test="stockAddress!= null">stock_address,</if>
<if test="stockContact!= null">stock_contact,</if>
<if test="stockPhone!= null">stock_phone,</if>
<if test="arrivedTime != null">arrived_time,</if> <if test="arrivedTime != null">arrived_time,</if>
<if test="eceiptStatus != null">eceipt_status,</if> <if test="stockNo != null">stock_no,</if>
<if test="stockName != null">stock_name,</if>
<if test="receivePerson != null">receive_person,</if>
<if test="receivePersonPhone != null">receive_person_phone,</if>
<if test="receiveAddress != null">receive_address,</if>
<if test="purchaseBuyer != null">purchase_buyer,</if>
<if test="useStatus != null">use_status,</if> <if test="useStatus != null">use_status,</if>
<if test="auditStatus != null">audit_status,</if> <if test="auditStatus != null">audit_status,</if>
<if test="paymentStatus != null">payment_status,</if>
<if test="supplierNum != null">supplier_num,</if>
<if test="materialAmount != null">material_amount,</if>
<if test="materialSum != null">material_sum,</if>
<if test="noRmbSum != null">noRmbSum,</if>
<if test="rmbSum != null">rmbSum,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</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>
<if test="delFlag != null">del_flag,</if>
<if test="instanceId != null">instance_id,</if> <if test="instanceId != null">instance_id,</if>
<if test="instanceType != null">instance_type,</if> <if test="instanceType != null">instance_type,</if>
<if test="submitInstanceId != null">submit_instance_id,</if> <if test="submitInstanceId != null">submit_instance_id,</if>
@ -172,43 +105,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyTitle != null">apply_title,</if> <if test="applyTitle != null">apply_title,</if>
<if test="applyUser != null">apply_user,</if> <if test="applyUser != null">apply_user,</if>
<if test="applyTime != null">apply_time,</if> <if test="applyTime != null">apply_time,</if>
<if test="delFlag != null" >del_flag,</if> </trim>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="purchaseOrderCode != null">#{purchaseOrderCode},</if> <if test="purchaseOrderCode != null">#{purchaseOrderCode},</if>
<if test="customerContact != null">#{customerContact},</if> <if test="purchasePlanCode != null">#{purchasePlanCode},</if>
<if test="contactNumber != null">#{contactNumber},</if> <if test="warehouseStorageStatus != null">#{warehouseStorageStatus},</if>
<if test="customerFax != null">#{customerFax},</if>
<if test="deliveryAddress != null">#{deliveryAddress},</if>
<if test="paymentTerms != null">#{paymentTerms},</if>
<if test="deliveryConditions != null">#{deliveryConditions},</if>
<if test="deliveryMethod != null">#{deliveryMethod},</if>
<if test="purchaseName != null">#{purchaseName},</if>
<if test="billingDate != null">#{billingDate},</if>
<if test="taxRate != null">#{taxRate},</if>
<if test="purchaseCategory != null">#{purchaseCategory},</if>
<if test="purchaseCommander != null">#{purchaseCommander},</if>
<if test="customerOrderNumber != null">#{customerOrderNumber},</if>
<if test="remarkContent != null">#{remarkContent},</if>
<if test="standbyOne != null">#{standbyOne},</if>
<if test="standbyTwo != null">#{standbyTwo},</if>
<if test="stockNo!= null">#{stockNo},</if>
<if test="stockName!= null">#{stockName},</if>
<if test="stockAddress!= null">#{stockAddress},</if>
<if test="stockContact!= null">#{stockContact},</if>
<if test="stockPhone!= null">#{stockPhone},</if>
<if test="arrivedTime != null">#{arrivedTime},</if>
<if test="eceiptStatus != null">#{eceiptStatus},</if>
<if test="useStatus != null">#{useStatus},</if>
<if test="auditStatus != null">#{auditStatus},</if>
<if test="paymentStatus != null">#{paymentStatus},</if> <if test="paymentStatus != null">#{paymentStatus},</if>
<if test="supplierNum != null">#{supplierNum},</if> <if test="supplierCode != null">#{supplierCode},</if>
<if test="materialAmount != null">#{materialAmount},</if> <if test="supplierName != null">#{supplierName},</if>
<if test="materialSum != null">#{materialSum},</if> <if test="materialSum != null">#{materialSum},</if>
<if test="actualPurchaseSum != null">#{actualPurchaseSum},</if>
<if test="sharedInventoryOccupancySum != null">#{sharedInventoryOccupancySum},</if>
<if test="refundsExchangesSum != null">#{refundsExchangesSum},</if>
<if test="storageSum != null">#{storageSum},</if>
<if test="noRmbSum != null">#{noRmbSum},</if> <if test="noRmbSum != null">#{noRmbSum},</if>
<if test="rmbSum != null">#{rmbSum},</if> <if test="rmbSum != null">#{rmbSum},</if>
<if test="createTime != null">#{createTime},</if> <if test="eceiptType != null">#{eceiptType},</if>
<if test="arrivedTime != null">#{arrivedTime},</if>
<if test="stockNo != null">#{stockNo},</if>
<if test="stockName != null">#{stockName},</if>
<if test="receivePerson != null">#{receivePerson},</if>
<if test="receivePersonPhone != null">#{receivePersonPhone},</if>
<if test="receiveAddress != null">#{receiveAddress},</if>
<if test="purchaseBuyer != null">#{purchaseBuyer},</if>
<if test="useStatus != null">#{useStatus},</if>
<if test="auditStatus != null">#{auditStatus},</if>
<if test="createBy != null">#{createBy},</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>
<if test="delFlag != null">#{delFlag},</if>
<if test="instanceId != null">#{instanceId},</if> <if test="instanceId != null">#{instanceId},</if>
<if test="instanceType != null">#{instanceType},</if> <if test="instanceType != null">#{instanceType},</if>
<if test="submitInstanceId != null">#{submitInstanceId},</if> <if test="submitInstanceId != null">#{submitInstanceId},</if>
@ -217,55 +143,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyTitle != null">#{applyTitle},</if> <if test="applyTitle != null">#{applyTitle},</if>
<if test="applyUser != null">#{applyUser},</if> <if test="applyUser != null">#{applyUser},</if>
<if test="applyTime != null">#{applyTime},</if> <if test="applyTime != null">#{applyTime},</if>
<if test="delFlag != null" >#{delFlag},</if> </trim>
</trim>
</insert> </insert>
<update id="updatePurchaseOrder" parameterType="PurchaseOrder"> <update id="updatePurchaseOrder" parameterType="PurchaseOrder">
update purchase_order update purchase_order
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="purchaseOrderCode != null">purchase_order_code = #{purchaseOrderCode},</if> <if test="purchaseOrderCode != null">purchase_order_code = #{purchaseOrderCode},</if>
<if test="supplierCode != null and supplierCode != ''">supplier_code = #{supplierCode},</if> <if test="purchasePlanCode != null">purchase_plan_code = #{purchasePlanCode},</if>
<if test="supplierName != null and supplierName != ''">supplier_name = #{supplierName},</if> <if test="warehouseStorageStatus != null">warehouse_storage_status = #{warehouseStorageStatus},</if>
<if test="customerContact != null">customer_contact = #{customerContact},</if> <if test="paymentStatus != null">payment_status = #{paymentStatus},</if>
<if test="contactNumber != null">contact_number = #{contactNumber},</if> <if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="customerFax != null">customer_fax = #{customerFax},</if> <if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="deliveryAddress != null">delivery_address = #{deliveryAddress},</if> <if test="materialSum != null">material_sum = #{materialSum},</if>
<if test="paymentTerms != null">payment_terms = #{paymentTerms},</if> <if test="actualPurchaseSum != null">actual_purchase_sum = #{actualPurchaseSum},</if>
<if test="deliveryConditions != null">delivery_conditions = #{deliveryConditions},</if> <if test="sharedInventoryOccupancySum != null">shared_inventory_occupancy_sum = #{sharedInventoryOccupancySum},</if>
<if test="deliveryMethod != null">delivery_method = #{deliveryMethod},</if> <if test="refundsExchangesSum != null">refunds_exchanges_sum = #{refundsExchangesSum},</if>
<if test="purchaseName != null">purchase_name = #{purchaseName},</if> <if test="storageSum != null">storage_sum = #{storageSum},</if>
<if test="billingDate != null">billing_date = #{billingDate},</if> <if test="noRmbSum != null">noRmb_sum = #{noRmbSum},</if>
<if test="taxRate != null">tax_rate = #{taxRate},</if> <if test="rmbSum != null">rmb_sum = #{rmbSum},</if>
<if test="purchaseCategory != null">purchase_category = #{purchaseCategory},</if> <if test="eceiptType != null">eceipt_type = #{eceiptType},</if>
<if test="purchaseCommander != null">purchase_commander = #{purchaseCommander},</if>
<if test="customerOrderNumber != null">customer_order_number = #{customerOrderNumber},</if>
<if test="remarkContent != null">remark_content = #{remarkContent},</if>
<if test="closeCaseNo != null">close_case_no = #{closeCaseNo},</if>
<if test="closeCaseName != null">close_case_name = #{closeCaseName},</if>
<if test="closeCaseTime != null">close_case_time = #{closeCaseTime},</if>
<if test="standbyOne != null">standby_one = #{standbyOne},</if>
<if test="standbyTwo != null">standby_two = #{standbyTwo},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="stockNo!= null">stock_no = #{stockNo},</if>
<if test="stockName!= null">stock_name = #{stockName},</if>
<if test="stockAddress!= null">stock_address = #{stockAddress},</if>
<if test="stockContact!= null">stock_contact = #{stockContact},</if>
<if test="stockPhone!= null">stock_phone = #{stockPhone},</if>
<if test="arrivedTime != null">arrived_time = #{arrivedTime},</if> <if test="arrivedTime != null">arrived_time = #{arrivedTime},</if>
<if test="eceiptStatus != null">eceipt_status = #{eceiptStatus},</if> <if test="stockNo != null">stock_no = #{stockNo},</if>
<if test="stockName != null">stock_name = #{stockName},</if>
<if test="receivePerson != null">receive_person = #{receivePerson},</if>
<if test="receivePersonPhone != null">receive_person_phone = #{receivePersonPhone},</if>
<if test="receiveAddress != null">receive_address = #{receiveAddress},</if>
<if test="purchaseBuyer != null">purchase_buyer = #{purchaseBuyer},</if>
<if test="useStatus != null">use_status = #{useStatus},</if> <if test="useStatus != null">use_status = #{useStatus},</if>
<if test="auditStatus != null">audit_status = #{auditStatus},</if> <if test="auditStatus != null">audit_status = #{auditStatus},</if>
<if test="paymentStatus != null">payment_status = #{paymentStatus},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="supplierNum != null">supplier_num = #{supplierNum},</if>
<if test="materialAmount != null">material_amount = #{materialAmount},</if>
<if test="materialSum != null">material_sum = #{materialSum},</if>
<if test="noRmbSum != null">noRmbSum = #{noRmbSum},</if>
<if test="rmbSum != null">rmbSum = #{rmbSum},</if>
<if test="createBy != null">create_by= #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime !=null">update_time = #{updateTime},</if> <if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateBy !=null">update_by = #{updateBy},</if> <if test="updateTime != null">update_time = #{updateTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
<if test="instanceId != null">instance_id = #{instanceId},</if> <if test="instanceId != null">instance_id = #{instanceId},</if>
<if test="instanceType != null">instance_type = #{instanceType},</if> <if test="instanceType != null">instance_type = #{instanceType},</if>
<if test="submitInstanceId != null">submit_instance_id = #{submitInstanceId},</if> <if test="submitInstanceId != null">submit_instance_id = #{submitInstanceId},</if>
@ -274,7 +185,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="applyTitle != null">apply_title = #{applyTitle},</if> <if test="applyTitle != null">apply_title = #{applyTitle},</if>
<if test="applyUser != null">apply_user = #{applyUser},</if> <if test="applyUser != null">apply_user = #{applyUser},</if>
<if test="applyTime != null">apply_time = #{applyTime},</if> <if test="applyTime != null">apply_time = #{applyTime},</if>
<if test="delFlag != null">del_flag = #{delFlag},</if>
</trim> </trim>
where purchase_order_id = #{purchaseOrderId} where purchase_order_id = #{purchaseOrderId}
</update> </update>
@ -282,9 +192,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<delete id="deletePurchaseOrderById" parameterType="Long"> <delete id="deletePurchaseOrderById" parameterType="Long">
delete from purchase_order where purchase_order_id = #{purchaseOrderId} delete from purchase_order where purchase_order_id = #{purchaseOrderId}
</delete> </delete>
<select id="checkPurchaseOrderCodeUnique" resultType="java.lang.Integer">
select count(1) from purchase_order where purchase_ordre_code = #{purchaseOrderCode} limit 1
</select>
<delete id="deletePurchaseOrderByIds" parameterType="String"> <delete id="deletePurchaseOrderByIds" parameterType="String">
delete from purchase_order where purchase_order_id in delete from purchase_order where purchase_order_id in
<foreach item="purchaseOrderId" collection="array" open="(" separator="," close=")"> <foreach item="purchaseOrderId" collection="array" open="(" separator="," close=")">
@ -292,24 +200,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach> </foreach>
</delete> </delete>
<!-- <select id="selectCountByDay" resultType="Integer">--> <update id="cancelPurchaseOrderById" parameterType="Long">
<!-- select count(*) from purchase_order where to_days(billing_date) = to_days(now());--> update purchase_order set del_flag = '1' where purchase_order_id = #{purchaseOrderId}
<!-- </select>--> </update>
<select id="selectOrderByIdDesc" resultMap="PurchaseOrderResult">
<include refid="selectPurchaseOrderVo"/>
WHERE purchase_order_code like '%PO%' ORDER BY purchase_order_id DESC
</select>
<select id="selectPurchaseOrderByOrderCode" parameterType="String" resultMap="PurchaseOrderResult">
<include refid="selectPurchaseOrderVo"/>
where purchase_order_code = #{purchaseOrderCode}
</select>
<delete id="deleteSysCustomerQuoteByIds" parameterType="String"> <update id="restorePurchaseOrderById" parameterType="Long">
update sys_customer_quote set use_status = '1' sys_customer_quote where id in update purchase_order set del_flag = '0' where purchase_order_id = #{purchaseOrderId}
<foreach item="id" collection="array" open="(" separator="," close=")"> </update>
#{id}
</foreach>
</delete>
</mapper> </mapper>

15
ruoyi-admin/src/main/resources/mapper/stock/StockInfoMapper.xml

@ -9,6 +9,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="stockNO" column="StockNO" /> <result property="stockNO" column="StockNO" />
<result property="stockName" column="Stockname" /> <result property="stockName" column="Stockname" />
<result property="stockAddr" column="stockAddr" /> <result property="stockAddr" column="stockAddr" />
<result property="receiveAddress" column="receive_address" />
<result property="receivePerson" column="receive_person" />
<result property="receivePersonPhone" column="receive_person_phone" />
<result property="stockManager" column="stockmanager" /> <result property="stockManager" column="stockmanager" />
<result property="stockMemo" column="stockmemo" /> <result property="stockMemo" column="stockmemo" />
<result property="firstAddTime" column="first_add_time" /> <result property="firstAddTime" column="first_add_time" />
@ -20,6 +23,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
StockNo, StockNo,
Stockname, Stockname,
stockAddr, stockAddr,
receive_address,
receive_person,
receive_person_phone,
stockmanager, stockmanager,
stockmemo, stockmemo,
first_add_time, first_add_time,
@ -59,6 +65,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="stockNO != null and stockNO != ''">StockNO,</if> <if test="stockNO != null and stockNO != ''">StockNO,</if>
<if test="stockName != null and stockName != ''">Stockname,</if> <if test="stockName != null and stockName != ''">Stockname,</if>
<if test="stockAddr != null and stockAddr != ''">stockAddr,</if> <if test="stockAddr != null and stockAddr != ''">stockAddr,</if>
<if test="receiveAddress != null">receive_address,</if>
<if test="receivePerson != null">receive_person,</if>
<if test="receivePersonPhone != null">receive_person_phone,</if>
<if test="stockManager != null">stockmanager,</if> <if test="stockManager != null">stockmanager,</if>
<if test="stockMemo != null">stockmemo,</if> <if test="stockMemo != null">stockmemo,</if>
<if test="firstAddTime != null">first_add_time,</if> <if test="firstAddTime != null">first_add_time,</if>
@ -67,6 +76,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="stockNO != null and stockNO != ''">#{stockNO},</if> <if test="stockNO != null and stockNO != ''">#{stockNO},</if>
<if test="stockName != null and stockName != ''">#{stockName},</if> <if test="stockName != null and stockName != ''">#{stockName},</if>
<if test="stockAddr != null and stockAddr != ''">#{stockAddr},</if> <if test="stockAddr != null and stockAddr != ''">#{stockAddr},</if>
<if test="receiveAddress != null">#{receiveAddress},</if>
<if test="receivePerson != null">#{receivePerson},</if>
<if test="receivePersonPhone != null">#{receivePersonPhone},</if>
<if test="stockManager != null">#{stockManager},</if> <if test="stockManager != null">#{stockManager},</if>
<if test="stockMemo != null">#{stockMemo},</if> <if test="stockMemo != null">#{stockMemo},</if>
<if test="firstAddTime != null">#{firstAddTime},</if> <if test="firstAddTime != null">#{firstAddTime},</if>
@ -79,6 +91,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="stockNO != null and stockNO != ''">StockNO = #{stockNO},</if> <if test="stockNO != null and stockNO != ''">StockNO = #{stockNO},</if>
<if test="stockName != null and stockName != ''">Stockname = #{stockName},</if> <if test="stockName != null and stockName != ''">Stockname = #{stockName},</if>
<if test="stockAddr != null and stockAddr != ''">StockAddr = #{stockAddr},</if> <if test="stockAddr != null and stockAddr != ''">StockAddr = #{stockAddr},</if>
<if test="receiveAddress != null">receive_address = #{receiveAddress},</if>
<if test="receivePerson != null">receive_person = #{receivePerson},</if>
<if test="receivePersonPhone != null">receive_person_phone = #{receivePersonPhone},</if>
<if test="stockManager != null">stockmanager = #{stockManager},</if> <if test="stockManager != null">stockmanager = #{stockManager},</if>
<if test="stockMemo != null">stockmemo = #{stockMemo},</if> <if test="stockMemo != null">stockmemo = #{stockMemo},</if>
<if test="updateInfoTime != null">update_info_time = #{updateInfoTime},</if> <if test="updateInfoTime != null">update_info_time = #{updateInfoTime},</if>

727
ruoyi-admin/src/main/resources/templates/purchase/purchaseOrder/purchaseOrder.html

@ -2,547 +2,218 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head> <head>
<th:block th:include="include :: header('采购订单列表')" /> <th:block th:include="include :: header('采购订单列表')" />
<th:block th:include="include :: datetimepicker-css"/>
<th:block th:include="include :: bootstrap-select-css"/>
<th:block th:include="include :: bootstrap-fileinput-css" />
<script type="text/javascript" th:src="@{/js/axios.min.js}"></script>
</head> </head>
<body class="gray-bg"> <body class="gray-bg">
<div class="container-div"> <div class="container-div">
<div class="row"> <div class="row">
<div class="col-sm-12 search-collapse"> <div class="col-sm-12 search-collapse">
<form id="formId"> <form id="formId">
<div class="select-list"> <div class="select-list">
<ul> <ul>
<li> <li>
<label>采购单号:</label> <label>采购订购单号:</label>
<input type="text" name="purchaseOrderCode"/> <input type="text" name="purchaseOrderCode"/>
</li> </li>
<li> <li>
<label>采购员:</label> <label>采购计划单号:</label>
<input type="text" name="supplierNumber"/> <input type="text" name="purchasePlanCode"/>
</li>
</li> <li>
<li> <label>采购入库状态:</label>
<label>供应商代码:</label> <select name="warehouseStorageStatus" th:with="type=${@dict.getType('eceiptStatus')}">
<input name="supplierCode" class="form-control" type="text"/> <option value="">所有</option>
</li> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
<li> </select>
<label>供应商名称:</label> </li>
<input type="text" name="supplierName"/> <li>
</li> <label>打款结案状态:</label>
<li> <select name="paymentStatus" th:with="type=${@dict.getType('sys_pay_close')}">
<label>审核状态:</label> <option value="">所有</option>
<select name="auditStatus" th:with="type=${@dict.getType('auditStatus')}"> <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
<option value="">所有</option> </select>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> </li>
</select> <li>
</li> <label>供应商ID:</label>
<li> <input type="text" name="supplierCode"/>
<label>使用状态:</label> </li>
<select name="useStatus" th:with="type=${@dict.getType('useStatus')}"> <li>
<option value="">所有</option> <label>供应商名称:</label>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> <input type="text" name="supplierName"/>
</select> </li>
</li> <li class="select-time">
<li> <label>录入时间:</label>
<label>收货状态:</label> <input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
<select name="eceiptStatus" th:with="type=${@dict.getType('sys_eceipt_status')}"> <span>-</span>
<option value="">所有</option> <input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option> </li>
</select> <li>
</li> <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<li> <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
<label>打款结案状态:</label> </li>
<select name="paymentStatus" th:with="type=${@dict.getType('sys_pay_close')}"> </ul>
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li class="select-time">
<label>录入时间:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginBillingDate]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endBillingDate]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<!-- 导入合同按钮 -->
<a class="btn btn-warning" onclick="importContract()" shiro:hasPermission="purchase:purchaseOrder:importContract">
<i class="fa fa-download"></i> 导入合同
</a>
<a class="btn btn-warning" onclick="exportContract()" shiro:hasPermission="purchase:purchaseOrder:exportContract">
<i class="fa fa-download"></i> 导出合同
</a>
<a class="btn btn-primary" onclick="reviewCloseCase()" shiro:hasPermission="purchase:purchaseOrder:close">
<i class="fa fa-hand-grab-o"></i> 结案
</a>
</div>
<div class="col-sm-12 select-table table-striped" style="white-space: nowrap">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<!--订单结案-->
<div class="modal fade" id="closeCaseModal">
<div class="modal-dialog">
<div class="modal-content message_align">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
<h4 class="modal-title">结案信息</h4>
</div>
<div class="modal-body" style="height: 180px">
<form id="form-closeCase-edit">
<div class="form-group" hidden = "hidden">
<label class="col-sm-3 control-label is-required">采购订单ID:</label>
<div class="col-sm-8">
<input name="purchaseOrderId" class="form-control" type="text" required readonly>
</div>
</div>
<div class="form-group" >
<label class="col-sm-3 control-label is-required">采购单号:</label>
<div class="col-sm-8">
<input name="purchaseOrderCode" class="form-control" type="text" required readonly>
</div>
</div>
<table id="closeCaseTable"> </table>
<div class="form-row">
<label class="col-sm-3 control-label is-required">备注:</label>
<div class="col-sm-8">
<textarea id="remark" name="remark" class="form-control" rows="6"></textarea>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
<button type="button" onclick="closeCaseSubmit()" class="btn btn-success" data-dismiss="modal">确定</button>
</div> </div>
</div> </form>
</div> </div>
</div>
<!-- 导入合同模态框 --> <div class="btn-group-sm" id="toolbar" role="group">
<div class="modal inmodal fade" id="importContractModal" tabindex="-1" aria-labelledby="importContractModalLabel" role="dialog" aria-hidden="true"> <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="purchase:purchaseOrder:add">
<div class="modal-dialog"> <i class="fa fa-plus"></i> 添加
<div class="modal-content"> </a>
<div class="modal-header"> <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="purchase:purchaseOrder:edit">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span> <i class="fa fa-edit"></i> 修改
</button> </a>
<h4 class="modal-title">导入合同</h4> <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="purchase:purchaseOrder:remove">
</div> <i class="fa fa-remove"></i> 删除
<div class="modal-body"> </a>
<div class="file-loading"> <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="purchase:purchaseOrder:export">
<input id="singleFile" name="file" type="file"> <i class="fa fa-download"></i> 导出
<!-- 添加隐藏的输入框 --> </a>
<input id="fileIdStr" name="fileIdStr" type="text" hidden> </div>
</div> <div class="col-sm-12 select-table table-striped">
</div> <table id="bootstrap-table"></table>
<div class="modal-footer">
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
</div>
</div>
</div> </div>
</div> </div>
</div>
<th:block th:include="include :: footer" /> <th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js"/> <script th:inline="javascript">
<th:block th:include="include :: select2-js"/> var editFlag = [[${@permission.hasPermi('purchase:purchaseOrder:edit')}]];
<th:block th:include="include :: bootstrap-fileinput-js" /> var removeFlag = [[${@permission.hasPermi('purchase:purchaseOrder:remove')}]];
<th:block th:include="include:: zh-js" /> var cancelFlag = [[${@permission.hasPermi('purchase:purchaseOrder:cancel')}]];
<script th:src="@{/js/activiti.js}"></script> var restoreFlag = [[${@permission.hasPermi('purchase:purchaseOrder:restore')}]];
<script th:inline="javascript"> var warehouseStorageStatusDatas = [[${@dict.getType('eceiptStatus')}]];
var editFlag = [[${@permission.hasPermi('purchase:purchaseOrder:edit')}]]; var paymentStatusDatas = [[${@dict.getType('sys_pay_close')}]];
var addPurchaseOrderStorageFlag = [[${@permission.hasPermi('purchase:purchaseOrder:addPurchaseOrderStorage')}]]; var useStatusDatas = [[${@dict.getType('useStatus')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]]; var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var useStatusDatas = [[${@dict.getType('useStatus')}]]; var prefix = ctx + "purchase/purchaseOrder";
var eceiptStatusDatas = [[${@dict.getType('sys_eceipt_status')}]];
var paymentStatusDatas = [[${@dict.getType('sys_pay_close')}]]; $(function() {
var loginName = [[${@permission.getPrincipalProperty('loginName')}]]; var options = {
var prefix = ctx + "purchase/purchaseOrder"; url: prefix + "/list",
$(function() { createUrl: prefix + "/add",
var options = { updateUrl: prefix + "/edit/{id}",
url: prefix + "/list", removeUrl: prefix + "/remove",
createUrl: prefix + "/add", cancelUrl: prefix + "/cancel/{id}",
updateUrl: prefix + "/edit/{id}", restoreUrl: prefix + "/restore/{id}",
detailUrl: prefix + "/detail/{id}", exportUrl: prefix + "/export",
removeUrl: prefix + "/remove", modalName: "采购订单",
exportUrl: prefix + "/export", columns: [{
clickToSelect: true, checkbox: true
pageList: [5, 10, 25, 50], },
pageSize: 10, {
sortable: true, // 是否启用排序 title: '采购订单id',
sortStable: true, // 设置为 true 将获得稳定的排序 field: 'purchaseOrderId',
modalName: "采购订单", visible: false
detailView: true,
// fixedColumns: true, // 是否启用冻结列(左侧)
// fixedNumber: 2, // 列冻结的个数(左侧)
// rightFixedColumns: true, // 是否启用冻结列(右侧)
// fixedRightNumber: 1, // 列冻结的个数(右侧)
method: 'post',
contentType: "application/x-www-form-urlencoded",
onExpandRow : function(index,row,$detail){
$detail.html('<table class="table-container" id="purchase_order_child_'+row.id+'"></table>').find('table');
// 一阶
initChildTable(index,row,$detail);
}, },
columns: [ {
{checkbox: true}, title: '采购订购单号',
{title: '采购订单id',field: 'purchaseOrderId', visible: false}, field: 'purchaseOrderCode',
{title: '流程实例ID',field: 'instanceId',visible: false}, },
{ title: '流程提交实例ID',field: 'submitInstanceId',visible: false}, {
{ title:'流程作废实例ID',field: 'cancelInstanceId',visible: false}, title: '采购计划单号',
{title: '流程恢复实例ID',field: 'restoreInstanceId', visible: false}, field: 'purchasePlanCode',
{ title: '流程实例类型', field: 'instanceTypeName',visible: false}, },
{title: '申请人ID',field: 'applyUser', visible: false}, {
{ title: '采购入库状态',
field: 'applyUserName', field: 'warehouseStorageStatus',
title: '<span style="color: red;">申请人</span>', formatter: function(value, row, index) {
formatter: function(value, row, index) { return $.table.selectDictLabel(warehouseStorageStatusDatas, value);
return '<span style="color: red;">' + (value ? value : "-") + '</span>';
}
},
{field: 'applyTime',title: '申请时间'
},
{title: '当前任务ID',field: 'taskId',visible: false},
{ title: '待办用户ID',field: 'todoUserId', visible: false},
{ title: '当前任务名称',field: 'taskName',
align: 'center',
formatter: function(value, row, index) {
return '<span class="badge badge-primary">' + value + '</span>';
}
},
{title:'审核状态',field: 'auditStatus',formatter: function (value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value);
}},
{title:'使用状态',field: 'useStatus',formatter: function (value, row, index) {
return $.table.selectDictLabel(useStatusDatas, value);
}},
{title:'收货状态',field: 'eceiptStatus',formatter: function (value, row, index) {
return $.table.selectDictLabel(eceiptStatusDatas, value);}
},
{title:'打款结案状态',field:'paymentStatus',formatter: function (value, row, index) {
return $.table.selectDictLabel(paymentStatusDatas, value);
}},
{title:'采购单号',field: 'purchaseOrderCode'},
{title:'供应商数量',field: 'supplierNum'},
{title:'仓库ID',field: 'stockNo'},
{title:'物料合计',field: 'materialAmount'},
{title:'数量合计',field: 'materialSum'},
{title:'不含税总价(RMB)',field: 'noRmbSum'},
{title:'含税总价(RMB)',field: 'rmbSum'},
{title: '录入时间',field: 'createTime', },
{title: '上次更新时间',field: 'updateTime',},
{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.purchaseOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// actions.push('<a class="btn btn-danger btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.purchaseOrderId + '\')"><i class="fa fa-detail"></i>详情</a>')
if(row.auditStatus=="1" && row.useStatus=="1") {
// 作废
actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.purchaseOrderId + '\')"><i class="fa fa-remove"></i> 作废</a>');
// 入库通知
actions.push('<a class="btn btn-success btn-xs ' + addPurchaseOrderStorageFlag + '" href="javascript:void(0)" onclick="$.modal.open(\'添加入库通知检验单\',\'' + prefix+"/addPurchaseOrderStorage/"+row.purchaseOrderCode + '\')">入库通知</a> ');
}
//审核拒绝
if(row.auditStatus=="2" && row.applyUser == loginName){
//编辑
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.purchaseOrderId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
}
//else{actions.push('<a class="btn btn-default btn-xs" href="javascript:void(0)" disabled><i class="fa fa-edit"></i> 编辑</a> ');}
// 有流程实例id
if(row.useStatus=="2"){
// 恢复
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.purchaseOrderId + '\')"><i class="fa fa-window-restore"></i> 恢复</a> ');
}
// 有流程实例id
if (row.instanceId) {
// 有待办人展示审批按钮,
if (row.todoUserId) {
var todoUserIdList = row.todoUserId.split(",");
if(todoUserIdList.includes(loginName)){
var nodeName = row.taskName=='驳回调整'?' 调整申请':' 审批';
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="showVerifyDialog(\'' + prefix + '\',\'' + row.taskId + '\', \'' + row.taskName+"-"+ row.instanceTypeName +"申请" + '\')"><i class="fa fa-edit"></i> '+nodeName+'</a> ');
}
}
// 审批历史
actions.push('<a class="btn btn-warning btn-xs" href="javascript:void(0)" onclick="showHistoryDialog(\'' + row.instanceId + '\')"><i class="fa fa-list"></i> 审批历史</a> ');
// 进度查看
actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="showProcessImgDialog(\'' + row.instanceId + '\')"><i class="fa fa-image"></i> 进度查看</a> ');
}
actions.push('<a class="btn btn-success btn-xs ' +
editFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.purchaseOrderId + '\')"><i class="fa fa-edit"></i>详情</a> ');
return actions.join('');
}
} }
], },
rowStyle: function (row, index) { {
if (row.auditStatus=="0") { title: '打款结案状态',
// 如果审核状态为待审核,则设置为红色 field: 'paymentStatus',
return {css:{"color":"red"}}; formatter: function(value, row, index) {
return $.table.selectDictLabel(paymentStatusDatas, value);
} }
// 否则使用默认样式
return {};
}
};
$.table.init(options);
});
initChildTable = function(index, row, $detail) {
$("#"+"purchase_order_child_"+row.id).bootstrapTable({
url: ctx + "purchase/purchaseOrderChild/totalList",
method: 'post',
contentType: "application/x-www-form-urlencoded",
queryParams : {
purchaseOrderCode: row.purchaseOrderCode,
}, },
singleSelect:true, {
onCheck: function(row, $element) { title: '供应商ID',
$("#"+"purchase_order_child_"+row.id).bootstrapTable('check', $element.index()); field: 'supplierCode',
}, },
columns: [ {
{checkbox: true}, title: '供应商名称',
{title: '供应商ID',field: 'supplierCode',}, field: 'supplierName',
{title: '供应商名称',field: 'supplierName',},
{title: '物料合计',field: 'materialAmount',},
{title: '数量合计',field: 'materialSum',},
{title: '不含税总价(RMB)',field: 'materialNoRmbSum',},
{title: '含税总价(RMB)',field: 'materialRmbSum',},
{title:'收货状态',field: 'eceiptStatus',formatter: function (value, row, index) {
$.table.selectDictLabel(eceiptStatusDatas, value);}
},
{title:'打款状态',field: 'paymentStatus',formatter: function (value, row, index) {
$.table.selectDictLabel(paymentStatusDatas, value);}
},
{title: '交货时间',field: 'deliveryTime',visible: false},
]
});
};
//导出合同
function exportContract() {
// 获取选中的行
const selectedRows = $("#bootstrap-table").bootstrapTable('getSelections');
if (selectedRows.length !== 1) {
showWarning("请先选择一条采购订单");
return;
}
const row = selectedRows[0];
// 定义状态码常量
const AUDIT_STATUS_APPROVED = "1"; // 审核通过
const USE_STATUS_DELETED = "2"; // 作废
// 检查是否作废
if (row.useStatus === USE_STATUS_DELETED) {
showWarning("该采购订单已作废");
return;
}
// 检查是否审核通过
if (row.auditStatus !== AUDIT_STATUS_APPROVED) {
showWarning("该采购订单未审核通过");
return;
}
// 获取子表的 ID
const childTableId = "#purchase_order_child_" + row.id;
// 获取子表中选中的行
const selectedChildRows = $(childTableId).bootstrapTable('getSelections');
if (selectedChildRows.length !== 1) {
showWarning("请先选择子表中的一行");
return;
}
const selectedChildRow = selectedChildRows[0];
// 使用 $.modal.confirm 显示确认对话框
$.modal.confirm("确定导出这条数据的合同吗?", function() {
// 如果用户点击确定,继续导出
var supplierCode = selectedChildRow.supplierCode;
// 如果一切正常,继续导出
var purchaseOrderCode = row.purchaseOrderCode;
window.location.href = prefix + "/exportContract/" + purchaseOrderCode + "?supplierCode=" + encodeURIComponent(supplierCode);
$('#bootstrap-table').bootstrapTable('refresh'); // 刷新表格
});
}
// 显示警告消息的通用函数
function showWarning(message) {
$.modal.msgWarning(message);
}
// 将选中的行数据存储到全局变量
var globalSelectedRow = null;
// 导入合同
function importContract(){
// 获取选中的行
const selectedRows = $("#bootstrap-table").bootstrapTable('getSelections');
if (selectedRows.length !== 1) {
showWarning("请先选择一条采购订单");
return;
}
const row = selectedRows[0];
// 定义状态码常量
const AUDIT_STATUS_APPROVED = "1"; // 审核通过
const USE_STATUS_DELETED = "2"; // 作废
// 检查是否作废
if (row.useStatus === USE_STATUS_DELETED) {
showWarning("该采购订单已作废");
return;
}
// 检查是否审核通过
if (row.auditStatus !== AUDIT_STATUS_APPROVED) {
showWarning("该采购订单未审核通过");
return;
}
if (selectedRows.length ===1) {
// $("#purchaseOrderId").val(data[0].purchaseOrderId)
$("#importContractModal").modal("show");
// 存储选中的行数据
globalSelectedRow = row;
}
}
//导入合同
$(document).ready(function () {
// 单图上传
$("#singleFile").fileinput({
uploadUrl: prefix + "/uploadSingleFile",
language: 'zh', // 设置语言
dropZoneEnabled: true, // 是否显示拖拽区域
maxFileSize: 20480, // 上传文件最大值,单位kb
allowedFileExtensions: ['jpg', 'png', 'gif', 'jpeg'], // 指定上传文件类型
maxFileCount: 1,
initialPreviewAsData: true,
uploadExtraData: function() {
// 返回额外的数据
return {
img_key: "1000",
img_keywords: "happy, nature",
purchaseOrderCode: globalSelectedRow.purchaseOrderCode
};
}
}).on('fileuploaded', function (event, data, previewId, index) {
var response = data.response;
var attachFileId = response.data.id;
if (response.code === web_status.SUCCESS) {
$('#fileIdStr').val(attachFileId);
$.modal.msgSuccess("上传成功");
// 在这里可以处理上传成功后的操作
var selectedRowData = globalSelectedRow;
// 使用 selectedRowData 进行进一步的操作
console.log(selectedRowData);
// 绑定保存按钮的点击事件
$('#saveImport').on('click', function() {
// 这里可以添加保存逻辑
console.log("保存按钮被点击");
console.log("选中行的数据:", selectedRowData);
console.log("附件ID:", attachFileId);
});
} else {
$.modal.alertError(response.msg);
}
});
});
// 订单结案
function reviewCloseCase(){
let data = $("#bootstrap-table").bootstrapTable("getSelections");
let userName = [[${@permission.getPrincipalProperty('userName')}]];
if (data.length ===1) {
$("#purchaseOrderId").val(data[0].purchaseOrderId)
$("#closeCaseNo").val(data[0].closeCaseNo).trigger("change")
$("#closeCaseName").val(userName)
$("#closeCaseTime").datetimepicker("setDate", new Date());
$("#closeCaseModal").modal("show");
}else {
$.modal.alert("请选择一条数据");
}
}
// 订单结案
function closeCaseSubmit(){
$.ajax({
url: prefix + "/edit",
type: "post",
resultType: "json",
data: $('#form-closeCase-edit').serialize(),
success: function (resp) {
// console.log(resp)
$("#closeCaseModal").modal("hide");
$("#bootstrap-table").bootstrapTable('refresh');
$.modal.msgSuccess("操作成功!")
}, },
error: function () { {
$.modal.msgError("出错了!"); title: '物料合计',
} field: 'materialSum',
});
}
function tableSet(data) {
var options = {
id: "closeCaseTable",
modalName: "采购订单",
search: false,
showExport: false,
showSearch: false,
showRefresh: false,
showColumns: false,
showToggle: false,
showFooter: false,
columns: [
{title: '采购订单编号',field: 'purchaseOrderCode',align: 'center',visible: false,},
{title: '采购单子表ID',field: 'purchaseOrderChildId', align: 'center',},
{title: '供应商名称',field: 'supplierName', align: 'center',},
{title: '供应商名称',field: 'supplierName',align: 'center',},
{title: '打款结案状态',field: 'paymentStatus',align: 'center',
formatter: function (value, row, index) {return $.table.selectDictLabel(paymentStatusDatas, value);}
}, },
], {
} title: '实际采购总数',
} field: 'actualPurchaseSum',
},
{
title: '共享库存占用总数',
</script> field: 'sharedInventoryOccupancySum',
},
{
title: '退换货数',
field: 'refundsExchangesSum',
},
{
title: '入库数',
field: 'storageSum',
},
{
title: '不含税总价(RMB)',
field: 'noRmbSum',
},
{
title: '含税总价(RMB)',
field: 'rmbSum',
},
{
title: '采购员',
field: 'purchaseBuyer',
},
{
title: '使用状态',
field: 'useStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(useStatusDatas, value);
}
},
{
title: '审核状态',
field: 'auditStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(auditStatusDatas, value);
}
},
{
title: '录入人',
field: 'createBy',
},
{
title: '录入时间',
field: 'createTime',
},
{
title: '更新人',
field: 'updateBy',
},
{
title: '上次更新时间',
field: 'updateTime',
},
{
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.purchaseOrderId + '\')"><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.purchaseOrderId + '\')"><i class="fa fa-remove"></i>删除</a> ');
if(row.delFlag == '0'){
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}else{
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
}
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body> </body>
</html> </html>

24
ruoyi-admin/src/main/resources/templates/purchase/purchasePlan/addPurchaseOrder.html

@ -177,8 +177,25 @@ animation-fill-mode: none;
<div class="col-sm-2"> <div class="col-sm-2">
<input id="warehouseName" name="warehouseName" class="form-control" type="text" readonly> <input id="warehouseName" name="warehouseName" class="form-control" type="text" readonly>
</div> </div>
</div>
<div class="form-group row">
<label for="receivePerson" class="col-sm-2 control-label">收货人:</label>
<div class="col-sm-2">
<input id="receivePerson" name="receivePerson" class="form-control" type="text" readonly>
</div>
<label for="receivePersonPhone" class="col-sm-2 control-label">收货电话:</label>
<div class="col-sm-2">
<input id="receivePersonPhone" name="receivePersonPhone" class="form-control" type="text" readonly>
</div>
<label for="receiveAddress" class="col-sm-2 control-label">收货地址:</label>
<div class="col-sm-2">
<input id="receiveAddress" name="receiveAddress" class="form-control" type="text" readonly>
</div>
</div> </div>
</div> </div>
<!--选择和填写采购数--> <!--选择和填写采购数-->
<div class="container"> <div class="container">
@ -729,6 +746,10 @@ animation-fill-mode: none;
$.modal.alertWarning('未能获取到仓库名称!'); $.modal.alertWarning('未能获取到仓库名称!');
} }
$('input[name="warehouseName"]').val(data.data.stockName); $('input[name="warehouseName"]').val(data.data.stockName);
$('input[name="receivePerson"]').val(data.data.receivePerson);
$('input[name="receivePersonPhone"]').val(data.data.receivePersonPhone);
$('input[name="receiveAddress"]').val(data.data.receiveAddress);
}, },
error: function(jqXHR, textStatus, errorThrown) { error: function(jqXHR, textStatus, errorThrown) {
console.error('Error:', textStatus, errorThrown); console.error('Error:', textStatus, errorThrown);
@ -738,6 +759,9 @@ animation-fill-mode: none;
} else { } else {
// 如果没有选择仓库ID,清空仓库名称输入框 // 如果没有选择仓库ID,清空仓库名称输入框
$('input[name="warehouseName"]').val(''); $('input[name="warehouseName"]').val('');
$('input[name="receivePerson"]').val('');
$('input[name="receivePersonPhone"]').val('');
$('input[name="receiveAddress"]').val('');
} }
}); });
}); });

23
ruoyi-admin/src/main/resources/templates/stock/stockInfo/add.html

@ -24,6 +24,29 @@
<input name="stockAddr" class="form-control" type="text" required> <input name="stockAddr" class="form-control" type="text" required>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">收货人:</label>
<div class="col-sm-8">
<input name="receivePerson" 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="receivePersonPhone" 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="receiveAddress" class="form-control" type="text" required>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">仓库管理人:</label> <label class="col-sm-3 control-label">仓库管理人:</label>
<div class="col-sm-8"> <div class="col-sm-8">

22
ruoyi-admin/src/main/resources/templates/stock/stockInfo/edit.html

@ -25,6 +25,28 @@
<input name="stockAddr" th:field="*{stockAddr}" class="form-control" type="text" required> <input name="stockAddr" th:field="*{stockAddr}" class="form-control" type="text" required>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">收货人:</label>
<div class="col-sm-8">
<input name="receivePerson" th:field="*{receivePerson}" 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="receivePersonPhone" th:field="*{receivePersonPhone}" 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="receiveAddress" th:field="*{receiveAddress}" class="form-control" type="text" required>
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">仓库管理人:</label> <label class="col-sm-3 control-label">仓库管理人:</label>
<div class="col-sm-8"> <div class="col-sm-8">

Loading…
Cancel
Save