Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
zhangsiqi 3 months ago
parent
commit
93d4ab764e
  1. 13
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java
  2. 38
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/vo/ErpMaterialPurchaseHistoryVo.java
  3. 6
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java
  4. 41
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java
  5. 5
      ruoyi-admin/src/main/java/com/ruoyi/purchase/mapper/PurchaseOrderChildMapper.java
  6. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java
  7. 8
      ruoyi-admin/src/main/resources/mapper/purchase/PurchaseOrderChildMapper.xml
  8. 4
      ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml
  9. 133
      ruoyi-admin/src/main/resources/templates/erp/material/detail.html

13
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpMaterialController.java

@ -10,6 +10,7 @@ import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.erp.domain.ErpMaterial; import com.ruoyi.erp.domain.ErpMaterial;
import com.ruoyi.erp.domain.ErpMaterialVo; import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.erp.domain.vo.ErpMaterialPurchaseHistoryVo;
import com.ruoyi.erp.domain.vo.ErpMaterialSalesHistoryVo; import com.ruoyi.erp.domain.vo.ErpMaterialSalesHistoryVo;
import com.ruoyi.erp.mapper.ErpMaterialMapper; import com.ruoyi.erp.mapper.ErpMaterialMapper;
import com.ruoyi.erp.service.IErpMaterialService; import com.ruoyi.erp.service.IErpMaterialService;
@ -484,4 +485,16 @@ public class ErpMaterialController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
/**
* 物料采购价格历史
* */
@PostMapping ("/getMaterialPurchaseHistoryList")
@ResponseBody
public TableDataInfo getMaterialPurchaseHistoryList(@RequestParam String materialNo){
startPage();
List<ErpMaterialPurchaseHistoryVo> list = erpMaterialService.selectErpMaterialPurchaseHistoryList(materialNo);
return getDataTable(list);
}
} }

38
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/vo/ErpMaterialPurchaseHistoryVo.java

@ -0,0 +1,38 @@
package com.ruoyi.erp.domain.vo;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
//物料采购价历史
@Data
public class ErpMaterialPurchaseHistoryVo {
//销售时间
private Date purchaseTime;
//物料数量
private BigDecimal materialNum;
//含税价格
private BigDecimal taxPrice;
//不含税价格
private BigDecimal noTaxPrice;
//含税总价
private BigDecimal taxSum;
//不含税总价
private BigDecimal noTaxSum;
//采购员
private String purchaseUser;
//关联销采购订单号
private String purchaseOrderCode;
}

6
ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpMaterialService.java

@ -2,6 +2,7 @@ package com.ruoyi.erp.service;
import com.ruoyi.erp.domain.ErpMaterial; import com.ruoyi.erp.domain.ErpMaterial;
import com.ruoyi.erp.domain.ErpMaterialVo; import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.erp.domain.vo.ErpMaterialPurchaseHistoryVo;
import com.ruoyi.erp.domain.vo.ErpMaterialSalesHistoryVo; import com.ruoyi.erp.domain.vo.ErpMaterialSalesHistoryVo;
import org.activiti.engine.runtime.ProcessInstance; import org.activiti.engine.runtime.ProcessInstance;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -145,4 +146,9 @@ public interface IErpMaterialService
* 查询物料销售价历史 * 查询物料销售价历史
* */ * */
List<ErpMaterialSalesHistoryVo> selectErpMaterialSalesHistoryList(String materialNo); List<ErpMaterialSalesHistoryVo> selectErpMaterialSalesHistoryList(String materialNo);
/**
* 查询物料采购价历史
* */
List<ErpMaterialPurchaseHistoryVo> selectErpMaterialPurchaseHistoryList(String materialNo);
} }

41
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpMaterialServiceImpl.java

@ -11,11 +11,17 @@ import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.erp.domain.ErpMaterial; import com.ruoyi.erp.domain.ErpMaterial;
import com.ruoyi.erp.domain.ErpMaterialVo; import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.erp.domain.vo.ErpMaterialPurchaseHistoryVo;
import com.ruoyi.erp.domain.vo.ErpMaterialSalesHistoryVo; import com.ruoyi.erp.domain.vo.ErpMaterialSalesHistoryVo;
import com.ruoyi.erp.mapper.ErpMaterialMapper; import com.ruoyi.erp.mapper.ErpMaterialMapper;
import com.ruoyi.erp.service.IErpMaterialService; import com.ruoyi.erp.service.IErpMaterialService;
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.PurchaseOrderChild;
import com.ruoyi.purchase.mapper.PurchaseOrderChildMapper;
import com.ruoyi.purchase.mapper.PurchaseOrderMapper;
import com.ruoyi.purchase.mapper.PurchasePlanChildMapper;
import com.ruoyi.system.domain.*; import com.ruoyi.system.domain.*;
import com.ruoyi.system.domain.Vo.ExportCustomerQuoteChildVo; import com.ruoyi.system.domain.Vo.ExportCustomerQuoteChildVo;
import com.ruoyi.system.mapper.SysSalesOrderChildMapper; import com.ruoyi.system.mapper.SysSalesOrderChildMapper;
@ -79,13 +85,20 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
@Autowired @Autowired
private ISysRoleService roleService; private ISysRoleService roleService;
@Autowired @Autowired
private SysSalesOrderChildMapper sysSalesOrderChildMapper; private SysSalesOrderChildMapper sysSalesOrderChildMapper;
@Autowired @Autowired
private SysSalesOrderMapper sysSalesOrderMapper; private SysSalesOrderMapper sysSalesOrderMapper;
@Autowired
private PurchaseOrderMapper purchaseOrderMapper;
@Autowired
private PurchaseOrderChildMapper purchaseOrderChildMapper;
private final static String RMB = "1"; //RMB private final static String RMB = "1"; //RMB
/** /**
@ -547,6 +560,32 @@ public class ErpMaterialServiceImpl implements IErpMaterialService
return erpMaterialSalesHistoryVos; return erpMaterialSalesHistoryVos;
} }
/**
* 查询物料采购价历史
* */
@Override
public List<ErpMaterialPurchaseHistoryVo> selectErpMaterialPurchaseHistoryList(String materialNo) {
List<ErpMaterialPurchaseHistoryVo> erpMaterialPurchaseHistoryVos = new ArrayList<>();
List<PurchaseOrderChild> purchaseOrderChildList = purchaseOrderChildMapper.selectOrderChildListByMaterialNo(materialNo);
for (PurchaseOrderChild purchaseOrderChild : purchaseOrderChildList) {
ErpMaterialPurchaseHistoryVo erpMaterialPurchaseHistoryVo = new ErpMaterialPurchaseHistoryVo();
String purchaseOrderCode = purchaseOrderChild.getPurchaseOrderCode();
PurchaseOrder purchaseOrder = purchaseOrderMapper.selectPurchaseOrderByOrderCode(purchaseOrderCode);
erpMaterialPurchaseHistoryVo.setMaterialNum(purchaseOrderChild.getMaterialNum());
erpMaterialPurchaseHistoryVo.setPurchaseUser(purchaseOrder.getPurchaseBuyer());
erpMaterialPurchaseHistoryVo.setPurchaseOrderCode(purchaseOrder.getPurchaseOrderCode());
erpMaterialPurchaseHistoryVo.setPurchaseTime(purchaseOrderChild.getCreateTime());
erpMaterialPurchaseHistoryVo.setTaxPrice(purchaseOrderChild.getMaterialRmb());
erpMaterialPurchaseHistoryVo.setNoTaxPrice(purchaseOrderChild.getMaterialNoRmb());
erpMaterialPurchaseHistoryVo.setTaxSum(purchaseOrderChild.getMaterialRmbSum());
erpMaterialPurchaseHistoryVo.setNoTaxSum(purchaseOrderChild.getMaterialNoRmbSum());
erpMaterialPurchaseHistoryVos.add(erpMaterialPurchaseHistoryVo);
}
return erpMaterialPurchaseHistoryVos;
}
//区分不同币种的金额 //区分不同币种的金额
private void setMaterialPrice(ErpMaterialSalesHistoryVo vo, SysSalesOrderVo sysSalesOrderVo, SysSalesOrderChild child) { private void setMaterialPrice(ErpMaterialSalesHistoryVo vo, SysSalesOrderVo sysSalesOrderVo, SysSalesOrderChild child) {
if (RMB.equals(sysSalesOrderVo.getCommonCurrency())) { if (RMB.equals(sysSalesOrderVo.getCommonCurrency())) {

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

@ -110,4 +110,9 @@ public interface PurchaseOrderChildMapper
List<PurchaseOrderChild> selectChildListBySupplierCodeAndOrderCode(PurchaseOrderChild purchaseOrderChild); List<PurchaseOrderChild> selectChildListBySupplierCodeAndOrderCode(PurchaseOrderChild purchaseOrderChild);
/**
* 通过料号查询采购订单子表列表
* */
List<PurchaseOrderChild> selectOrderChildListByMaterialNo(String materialCode);
} }

4
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysCustomerServiceImpl.java

@ -185,6 +185,10 @@ public class SysCustomerServiceImpl implements ISysCustomerService
if(currency.contains("2")){ if(currency.contains("2")){
sysCustomer.setUsdFlag("1"); sysCustomer.setUsdFlag("1");
} }
//默认为仅报价
sysCustomer.setCustomerSign("1");
//添加联系人 //添加联系人
// sysContacts.setCustomerName(sysCustomer.getCustomerContact()); // sysContacts.setCustomerName(sysCustomer.getCustomerContact());
// sysContacts.setCellPhone(sysCustomer.getContactNumber()); // sysContacts.setCellPhone(sysCustomer.getContactNumber());

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

@ -116,6 +116,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select> </select>
<select id="selectOrderChildListByMaterialNo" parameterType="String" resultMap="PurchaseOrderChildResult">
<include refid="selectPurchaseOrderChildVo"/>
where material_code = #{materialCode}
</select>
<insert id="insertPurchaseOrderChild" parameterType="PurchaseOrderChild" useGeneratedKeys="true" keyProperty="purchaseOrderChildId"> <insert id="insertPurchaseOrderChild" parameterType="PurchaseOrderChild" useGeneratedKeys="true" keyProperty="purchaseOrderChildId">
insert into purchase_order_child insert into purchase_order_child
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -300,4 +306,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
FROM purchase_order_child where purchase_order_code = #{purchaseOrderCode} FROM purchase_order_child where purchase_order_code = #{purchaseOrderCode}
GROUP BY purchase_order_code,material_code GROUP BY purchase_order_code,material_code
</select> </select>
</mapper> </mapper>

4
ruoyi-admin/src/main/resources/mapper/system/SysCustomerMapper.xml

@ -223,6 +223,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="rmbFlag != null">rmb_flag,</if> <if test="rmbFlag != null">rmb_flag,</if>
<if test="usdFlag != null">usd_flag</if> <if test="usdFlag != null">usd_flag</if>
<if test="cancelRemark != null">cancel_remark,</if> <if test="cancelRemark != null">cancel_remark,</if>
<if test="customerSign != null">customer_sign,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="enterpriseCode!=null and enterpriseCode != ''">#{enterpriseCode},</if> <if test="enterpriseCode!=null and enterpriseCode != ''">#{enterpriseCode},</if>
@ -278,6 +279,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="rmbFlag != null"> #{rmbFlag},</if> <if test="rmbFlag != null"> #{rmbFlag},</if>
<if test="usdFlag != null"> #{usdFlag} </if> <if test="usdFlag != null"> #{usdFlag} </if>
<if test="cancelRemark != null">#{cancelRemark},</if> <if test="cancelRemark != null">#{cancelRemark},</if>
<if test="customerSign != null">#{customerSign}</if>
</trim> </trim>
</insert> </insert>
@ -325,7 +327,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="useStatus!=null" >use_status = #{useStatus},</if> <if test="useStatus!=null" >use_status = #{useStatus},</if>
<if test="identifyingPeople!=null">identifying_people = #{identifyingPeople},</if> <if test="identifyingPeople!=null">identifying_people = #{identifyingPeople},</if>
<if test="customerRemarks!=null">customer_remarks = #{customerRemarks},</if> <if test="customerRemarks!=null">customer_remarks = #{customerRemarks},</if>
<if test="customerSign!=null">customer_sign = #{customer_sign},</if> <if test="customerSign!=null">customer_sign = #{customerSign},</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="updateTime!=null">update_time = #{updateTime},</if>
<if test="instanceId != null">instance_id = #{instanceId},</if> <if test="instanceId != null">instance_id = #{instanceId},</if>

133
ruoyi-admin/src/main/resources/templates/erp/material/detail.html

@ -106,13 +106,13 @@
<div class="addressList sh"> <div class="addressList sh">
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<div class="details" style="padding: 8px 0;font-size: 18px">销售价历史</div> <div class="details" style="padding: 8px 0;font-size: 18px">销售价历史</div>
<table id="xiaoshou-table"></table> <table id="sales-table"></table>
</div> </div>
</div> </div>
<div class="addressList sh"> <div class="addressList sh">
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<div class="details" style="padding: 8px 0;font-size: 18px">采购价历史</div> <div class="details" style="padding: 8px 0;font-size: 18px">采购价历史</div>
<table id="purser-table"></table> <table id="purchase-table"></table>
</div> </div>
</div> </div>
<div class="addressList sh"> <div class="addressList sh">
@ -332,9 +332,9 @@
}; };
$.table.init(option1); $.table.init(option1);
// 销售价历史 // 销售价历史
$('#xiaoshou-table').bootstrapTable('destroy'); $('#sales-table').bootstrapTable('destroy');
var option2 ={ var option2 ={
id: "xiaoshou-table", id: "sales-table",
url: prefix + "/getMaterialSalesHistoryList", url: prefix + "/getMaterialSalesHistoryList",
showSearch: false, showSearch: false,
showRefresh: false, showRefresh: false,
@ -429,18 +429,6 @@
field: 'salesOrderCode', field: 'salesOrderCode',
title: '关联单号' title: '关联单号'
}, },
// {
// field: 'total',
// title: '合计',
// footerFormatter: function() {
// //统计总分数
// var count = 0;
// $.each(data.rows, function (index, item) {
// count += item.materialNum;
// });
// return count;
// }
// }
] ]
}; };
$.table.init(option2); $.table.init(option2);
@ -449,9 +437,10 @@
//采购价历史 //采购价历史
$('#purser-table').bootstrapTable('destroy'); $('#purchase-table').bootstrapTable('destroy');
var option3 = { var option3 = {
id: 'purser-table', id: 'purchase-table',
url: prefix + "/getMaterialPurchaseHistoryList",
showSearch: false, showSearch: false,
showRefresh: false, showRefresh: false,
showToggle: false, showToggle: false,
@ -459,81 +448,95 @@
uniqueId: "id", uniqueId: "id",
pagination: false, // 设置不分页 pagination: false, // 设置不分页
sidePagination: "client", sidePagination: "client",
pageNumber:5,
showFooter: true,
queryParams: function (params) { queryParams: function (params) {
//console.log("123"); //console.log("123");
var curParams = { var curParams = {
// 传递参数查询参数 materialNo: materialNo
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
materialCode: materialNo
}; };
return curParams return curParams
}, },
columns: [{ columns: [
checkbox: true
},
{
field: 'purchaseOrderId',
title: '采购订单id'
},
{
field: 'purchaseOrderNumber',
title: '订购单号'
},
{
field: 'supplierCode',
title: '供应商代码'
},
{
field: 'supplierName',
title: '供应商名称'
},
{ {
field: 'rawSubsidiaryCode', field: 'index',
title: '原辅料代码' title: '索引',
visible: false
}, },
{ {
field: 'rawSubsidiaryName', field: 'purchaseTime',
title: '原辅料名称' title: '采购时间'
}, },
{ {
field: 'specificationModel', field: 'materialNum',
title: '规格型号' title: '数量',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].materialNum);
}
return sum;
}
}, },
{ {
field: 'commonCurrency', field: 'taxPrice',
title: '币别', title: '含税价格',
formatter: function(value, row, index) { footerFormatter: function (value) {
return $.table.selectDictLabel(commonCurrencyDatas, value); var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].taxPrice);
}
return sum;
} }
}, },
{ {
field: 'purchasingUnit', field: 'noTaxPrice',
title: '采购单位' title: '不含税价格',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].noTaxPrice);
}
return sum;
}
}, },
{ {
field: 'purchasePrice', field: 'taxSum',
title: '采购单价' title: '含税总价',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].taxSum);
}
return sum;
}
}, },
{ {
field: 'materialQuantity', field: 'noTaxSum',
title: '数量' title: '不含税总价',
footerFormatter: function (value) {
var sum = 0;
for (var i in value) {
sum += parseFloat(value[i].noTaxSum);
}
return sum;
}
}, },
{ {
field: 'amountMoney', field: 'purchaseUser',
title: '金额' title: '采购员',
}, },
{ {
field: 'deliveryTime', field: 'purchaseOrderCode',
title: '交期' title: '关联单号'
}, },
{
field: 'purchaseExplain',
title: '说明'
}
] ]
}; };
$.table.init(option3); $.table.init(option3);
//操作历史 //操作历史
$('#oper-table').bootstrapTable('destroy'); $('#oper-table').bootstrapTable('destroy');
var option4 = { var option4 = {

Loading…
Cancel
Save