Browse Source

[feat]基础信息:请购单列表新增修改列表信息,新增信息列表获取

dev
zhangsiqi 6 months ago
parent
commit
21e570be77
  1. 6
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrderChild.java
  2. 36
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseRequisitioningOrderServiceImpl.java
  3. 4
      ruoyi-admin/src/main/resources/mapper/system/BaseRequisitioningOrderChildMapper.xml
  4. 28
      ruoyi-admin/src/main/resources/templates/system/requisitioning/edit.html

6
ruoyi-admin/src/main/java/com/ruoyi/system/domain/BaseRequisitioningOrderChild.java

@ -78,7 +78,7 @@ public class BaseRequisitioningOrderChild extends BaseEntity
/** 物料的不含税总价(RMB) */
@Excel(name = "物料的不含税总价(RMB)")
private Long materialRmbSum;
private BigDecimal materialRmbSum;
/** 删除状态 */
@Excel(name = "删除状态")
@ -223,12 +223,12 @@ public class BaseRequisitioningOrderChild extends BaseEntity
{
return materialNoRmbSum;
}
public void setMaterialRmbSum(Long materialRmbSum)
public void setMaterialRmbSum(BigDecimal materialRmbSum)
{
this.materialRmbSum = materialRmbSum;
}
public Long getMaterialRmbSum()
public BigDecimal getMaterialRmbSum()
{
return materialRmbSum;
}

36
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/BaseRequisitioningOrderServiceImpl.java

@ -1,5 +1,7 @@
package com.ruoyi.system.service.impl;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.List;
@ -8,6 +10,7 @@ import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.domain.BaseRequisitioningOrderChild;
import com.ruoyi.system.mapper.BaseRequisitioningOrderChildMapper;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BaseRequisitioningOrderMapper;
@ -71,17 +74,36 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
String loginName = ShiroUtils.getLoginName();
baseRequisitioningOrder.setCreateBy(loginName);
baseRequisitioningOrder.setCreateTime(DateUtils.getNowDate());
if (baseRequisitioningOrder.getRequisitioningCode() == null) {
baseRequisitioningOrder.setRequisitioningCode(redisCache.generateBillNo("QG"));
}
baseRequisitioningOrder.setRequisitioningCode(redisCache.generateBillNo("QG"));
List<BaseRequisitioningOrderChild> childList = baseRequisitioningOrder.getBaseRequisitioningOrderChildList();
int childSize = childList.size();
Long materialSum = 0L;
BigDecimal materialRmbSum = new BigDecimal(0);
BigDecimal materialNoRmbSum = new BigDecimal(0);
//物料合计
Integer childSize = childList.size();
if (childSize > 0) {
for (BaseRequisitioningOrderChild child : childList) {
//物料数量
materialSum += child.getMaterialNum();
//物料不含税总价(RMB)
materialRmbSum = child.getMaterialRmbSum().setScale(2, RoundingMode.HALF_UP).add(materialNoRmbSum);
//物料含税总价(RMB)
materialNoRmbSum = child.getMaterialNoRmbSum().setScale(2, RoundingMode.HALF_UP).add(materialNoRmbSum);
child.setQuoteId(baseRequisitioningOrder.getRequisitioningCode());
child.setCreateBy(loginName);
child.setCreateTime(DateUtils.getNowDate());
baseRequisitioningOrderChildMapper.insertBaseRequisitioningOrderChild(child);
}
}
baseRequisitioningOrder.setAuditStatus("1");
baseRequisitioningOrder.setUseStatus("1");
baseRequisitioningOrder.setMaterialAmount(Long.valueOf(childSize));
baseRequisitioningOrder.setMaterialSum(materialSum);
baseRequisitioningOrder.setRmbSum(materialRmbSum);
baseRequisitioningOrder.setNoRmbSum(materialNoRmbSum);
return baseRequisitioningOrderMapper.insertBaseRequisitioningOrder(baseRequisitioningOrder);
}
@ -101,9 +123,15 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
String requisitioningCode = baseRequisitioningOrder.getRequisitioningCode();
baseRequisitioningOrderChildMapper.deleteBaseRequisitioningOrderChildByQuoteId(baseRequisitioningOrder.getRequisitioningCode());
List<BaseRequisitioningOrderChild> childList = baseRequisitioningOrder.getBaseRequisitioningOrderChildList();
Long materialSum = 0L;
BigDecimal materialRmbSum = new BigDecimal(0);
BigDecimal materialNoRmbSum = new BigDecimal(0);
int childSize = childList.size();
if (childSize > 0) {
for (BaseRequisitioningOrderChild child: childList) {
materialSum += child.getMaterialNum();
materialRmbSum = child.getMaterialRmbSum().setScale(2, RoundingMode.HALF_UP).add(materialNoRmbSum);
materialNoRmbSum = child.getMaterialNoRmbSum().setScale(2, RoundingMode.HALF_UP).add(materialNoRmbSum);
child.setQuoteId(requisitioningCode);
child.setCreateBy(loginName);
child.setCreateTime(DateUtils.getNowDate());
@ -112,6 +140,12 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
baseRequisitioningOrderChildMapper.insertBaseRequisitioningOrderChild(child);
}
}
baseRequisitioningOrder.setAuditStatus("1");
baseRequisitioningOrder.setUseStatus("1");
baseRequisitioningOrder.setMaterialAmount(Long.valueOf(childSize));
baseRequisitioningOrder.setMaterialSum(materialSum);
baseRequisitioningOrder.setRmbSum(materialRmbSum);
baseRequisitioningOrder.setNoRmbSum(materialNoRmbSum);
return baseRequisitioningOrderMapper.updateBaseRequisitioningOrder(baseRequisitioningOrder);
}

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

@ -50,7 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialModel != null and materialModel != ''"> and material_model = #{materilaModel}</if>
<if test="specifications != null and specifications != ''"> and specifications = #{specifications}</if>
<if test="brand != null and brand != ''"> and brand = #{brand}</if>
<if test="describe != null and describe != ''"> and describe = #{describe}</if>
<if test="describe != null and describe != ''"> and `describe` = #{describe}</if>
<if test="materialNum != null "> and materialNum = #{materialNum}</if>
<if test="materialRmb != null "> and materialRmb = #{materialRmb}</if>
<if test="materialNoRmb != null "> and materialNoRmb = #{materialNoRmb}</if>
@ -82,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialModel != null">material_model,</if>
<if test="specifications != null">specifications,</if>
<if test="brand != null">brand,</if>
<if test="describe != null">describe,</if>
<if test="describe != null">`describe`,</if>
<if test="materialNum != null">materialNum,</if>
<if test="materialRmb != null">materialRmb,</if>
<if test="materialNoRmb != null">materialNoRmb,</if>

28
ruoyi-admin/src/main/resources/templates/system/requisitioning/edit.html

@ -2,6 +2,8 @@
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改请购单')" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: bootstrap-editable-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -55,15 +57,28 @@
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var baseRequisitioningOrder = [[${baseRequisitioningOrder}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var auditStatusDatas = [[${@dict.getType('auditStatus')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var prefix = ctx + "system/requisitioning";
$("#form-requisitioning-edit").validate({focusCleanup: true});
$(function() {
var options = {
id:'bootstrap-sub-table-requisitionChild',
// url: ctx + "system/quoteChild/list",
url: ctx + "system/requesitioningChild/list",
pagination: false,
sidePagination: "client",
queryParams: function(params) {
var temp = {
requisitioningCode: baseRequisitioningOrder.requisitioningCode,
};
return temp;
},
model: "物料报价信息",
columns: [
{checkbox: true},
@ -171,17 +186,6 @@
$.operate.save(prefix + "/edit", $('#form-requisitioning-edit').serialize());
}
}
function getDeptSelect(){
}
function getPostSelect(){
}
function getUserName(){
}
</script>
</body>
</html>
Loading…
Cancel
Save