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. 48
      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) */ /** 物料的不含税总价(RMB) */
@Excel(name = "物料的不含税总价(RMB)") @Excel(name = "物料的不含税总价(RMB)")
private Long materialRmbSum; private BigDecimal materialRmbSum;
/** 删除状态 */ /** 删除状态 */
@Excel(name = "删除状态") @Excel(name = "删除状态")
@ -223,12 +223,12 @@ public class BaseRequisitioningOrderChild extends BaseEntity
{ {
return materialNoRmbSum; return materialNoRmbSum;
} }
public void setMaterialRmbSum(Long materialRmbSum) public void setMaterialRmbSum(BigDecimal materialRmbSum)
{ {
this.materialRmbSum = materialRmbSum; this.materialRmbSum = materialRmbSum;
} }
public Long getMaterialRmbSum() public BigDecimal getMaterialRmbSum()
{ {
return materialRmbSum; 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; package com.ruoyi.system.service.impl;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@ -8,6 +10,7 @@ import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.system.domain.BaseRequisitioningOrderChild; import com.ruoyi.system.domain.BaseRequisitioningOrderChild;
import com.ruoyi.system.mapper.BaseRequisitioningOrderChildMapper; import com.ruoyi.system.mapper.BaseRequisitioningOrderChildMapper;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BaseRequisitioningOrderMapper; import com.ruoyi.system.mapper.BaseRequisitioningOrderMapper;
@ -71,17 +74,36 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
String loginName = ShiroUtils.getLoginName(); String loginName = ShiroUtils.getLoginName();
baseRequisitioningOrder.setCreateBy(loginName); baseRequisitioningOrder.setCreateBy(loginName);
baseRequisitioningOrder.setCreateTime(DateUtils.getNowDate()); baseRequisitioningOrder.setCreateTime(DateUtils.getNowDate());
if (baseRequisitioningOrder.getRequisitioningCode() == null) {
baseRequisitioningOrder.setRequisitioningCode(redisCache.generateBillNo("QG"));
}
baseRequisitioningOrder.setRequisitioningCode(redisCache.generateBillNo("QG")); baseRequisitioningOrder.setRequisitioningCode(redisCache.generateBillNo("QG"));
List<BaseRequisitioningOrderChild> childList = baseRequisitioningOrder.getBaseRequisitioningOrderChildList(); 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) { if (childSize > 0) {
for (BaseRequisitioningOrderChild child : childList) { 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.setQuoteId(baseRequisitioningOrder.getRequisitioningCode());
child.setCreateBy(loginName); child.setCreateBy(loginName);
child.setCreateTime(DateUtils.getNowDate()); child.setCreateTime(DateUtils.getNowDate());
baseRequisitioningOrderChildMapper.insertBaseRequisitioningOrderChild(child); 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); return baseRequisitioningOrderMapper.insertBaseRequisitioningOrder(baseRequisitioningOrder);
} }
@ -101,9 +123,15 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
String requisitioningCode = baseRequisitioningOrder.getRequisitioningCode(); String requisitioningCode = baseRequisitioningOrder.getRequisitioningCode();
baseRequisitioningOrderChildMapper.deleteBaseRequisitioningOrderChildByQuoteId(baseRequisitioningOrder.getRequisitioningCode()); baseRequisitioningOrderChildMapper.deleteBaseRequisitioningOrderChildByQuoteId(baseRequisitioningOrder.getRequisitioningCode());
List<BaseRequisitioningOrderChild> childList = baseRequisitioningOrder.getBaseRequisitioningOrderChildList(); List<BaseRequisitioningOrderChild> childList = baseRequisitioningOrder.getBaseRequisitioningOrderChildList();
Long materialSum = 0L;
BigDecimal materialRmbSum = new BigDecimal(0);
BigDecimal materialNoRmbSum = new BigDecimal(0);
int childSize = childList.size(); int childSize = childList.size();
if (childSize > 0) { if (childSize > 0) {
for (BaseRequisitioningOrderChild child: childList) { 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.setQuoteId(requisitioningCode);
child.setCreateBy(loginName); child.setCreateBy(loginName);
child.setCreateTime(DateUtils.getNowDate()); child.setCreateTime(DateUtils.getNowDate());
@ -112,6 +140,12 @@ public class BaseRequisitioningOrderServiceImpl implements IBaseRequisitioningOr
baseRequisitioningOrderChildMapper.insertBaseRequisitioningOrderChild(child); 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); return baseRequisitioningOrderMapper.updateBaseRequisitioningOrder(baseRequisitioningOrder);
} }

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

@ -6,28 +6,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="BaseRequisitioningOrderChild" id="BaseRequisitioningOrderChildResult"> <resultMap type="BaseRequisitioningOrderChild" id="BaseRequisitioningOrderChildResult">
<result property="requisitioningChildId" column="requisitioning_child_id" /> <result property="requisitioningChildId" column="requisitioning_child_id" />
<result property="quoteId" column="quote_id" /> <result property="quoteId" column="quote_id" />
<result property="materialId" column="material_id" /> <result property="materialId" column="material_id" />
<result property="materialCode" column="material_code" /> <result property="materialCode" column="material_code" />
<result property="photoUrl" column="photoUrl" /> <result property="photoUrl" column="photoUrl" />
<result property="materialName" column="material_name" /> <result property="materialName" column="material_name" />
<result property="materialType" column="material_type" /> <result property="materialType" column="material_type" />
<result property="materialModel" column="material_model" /> <result property="materialModel" column="material_model" />
<result property="specifications" column="specifications" /> <result property="specifications" column="specifications" />
<result property="brand" column="brand" /> <result property="brand" column="brand" />
<result property="describe" column="describe" /> <result property="describe" column="describe" />
<result property="materialNum" column="materialNum" /> <result property="materialNum" column="materialNum" />
<result property="materialRmb" column="materialRmb" /> <result property="materialRmb" column="materialRmb" />
<result property="materialNoRmb" column="materialNoRmb" /> <result property="materialNoRmb" column="materialNoRmb" />
<result property="materialNoRmbSum" column="materialNoRmbSum" /> <result property="materialNoRmbSum" column="materialNoRmbSum" />
<result property="materialRmbSum" column="materialRmbSum" /> <result property="materialRmbSum" column="materialRmbSum" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="useStatus" column="use_status" /> <result property="useStatus" column="use_status" />
<result property="auditStatus" column="audit_status" /> <result property="auditStatus" column="audit_status" />
</resultMap> </resultMap>
<sql id="selectBaseRequisitioningOrderChildVo"> <sql id="selectBaseRequisitioningOrderChildVo">
@ -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="materialModel != null and materialModel != ''"> and material_model = #{materilaModel}</if>
<if test="specifications != null and specifications != ''"> and specifications = #{specifications}</if> <if test="specifications != null and specifications != ''"> and specifications = #{specifications}</if>
<if test="brand != null and brand != ''"> and brand = #{brand}</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="materialNum != null "> and materialNum = #{materialNum}</if>
<if test="materialRmb != null "> and materialRmb = #{materialRmb}</if> <if test="materialRmb != null "> and materialRmb = #{materialRmb}</if>
<if test="materialNoRmb != null "> and materialNoRmb = #{materialNoRmb}</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="materialModel != null">material_model,</if>
<if test="specifications != null">specifications,</if> <if test="specifications != null">specifications,</if>
<if test="brand != null">brand,</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="materialNum != null">materialNum,</if>
<if test="materialRmb != null">materialRmb,</if> <if test="materialRmb != null">materialRmb,</if>
<if test="materialNoRmb != null">materialNoRmb,</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" > <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head> <head>
<th:block th:include="include :: header('修改请购单')" /> <th:block th:include="include :: header('修改请购单')" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: bootstrap-editable-css" />
</head> </head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
@ -55,15 +57,28 @@
</div> </div>
</div> </div>
<th:block th:include="include :: footer" /> <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"> <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"; var prefix = ctx + "system/requisitioning";
$("#form-requisitioning-edit").validate({focusCleanup: true}); $("#form-requisitioning-edit").validate({focusCleanup: true});
$(function() { $(function() {
var options = { var options = {
id:'bootstrap-sub-table-requisitionChild', id:'bootstrap-sub-table-requisitionChild',
// url: ctx + "system/quoteChild/list", url: ctx + "system/requesitioningChild/list",
pagination: false, pagination: false,
sidePagination: "client", sidePagination: "client",
queryParams: function(params) {
var temp = {
requisitioningCode: baseRequisitioningOrder.requisitioningCode,
};
return temp;
},
model: "物料报价信息", model: "物料报价信息",
columns: [ columns: [
{checkbox: true}, {checkbox: true},
@ -171,17 +186,6 @@
$.operate.save(prefix + "/edit", $('#form-requisitioning-edit').serialize()); $.operate.save(prefix + "/edit", $('#form-requisitioning-edit').serialize());
} }
} }
function getDeptSelect(){
}
function getPostSelect(){
}
function getUserName(){
}
</script> </script>
</body> </body>
</html> </html>
Loading…
Cancel
Save