Browse Source

[fix]

委外加工 委外报价
修改委外报价列表页面搜索栏定义,修改委外报价mapper列表查询方法;
修改委外报价service列表查询方法;
新增委外报价列表页面导出按钮绑定导出方法;
修改委外报价controller导出接口,实现多选和全部导出;
修改委外报价批量插入详情数据service接口;
新增修改委外报价审批信息service接口;
新增导出委外报价详情列表和根据报价单号列表导出详情mapper方法;
修改委外报价详情实体类,调整导出字段及顺序;
dev
王晓迪 2 months ago
parent
commit
491a497189
  1. 26
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java
  2. 22
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceQuoteChild.java
  3. 7
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceQuoteMapper.java
  4. 4
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourceQuoteService.java
  5. 23
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceQuoteServiceImpl.java
  6. 21
      ruoyi-admin/src/main/resources/mapper/system/OutsourceQuoteMapper.xml
  7. 32
      ruoyi-admin/src/main/resources/templates/system/outsource_quote/outsource_quote.html

26
ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceQuoteController.java

@ -9,10 +9,13 @@ import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.system.domain.OutsourceQuote;
import com.ruoyi.system.domain.OutsourceQuoteChild;
import com.ruoyi.system.domain.Vo.OutsourceQuoteVO;
import com.ruoyi.system.mapper.OutsourceQuoteMapper;
import com.ruoyi.system.service.IOutsourceProcessService;
import com.ruoyi.system.service.IOutsourceQuoteService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.system.service.impl.OutsourceQuoteServiceImpl;
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamage;
import com.ruoyi.warehouse.domain.WarehouseInventoryReportDamageChild;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
import org.activiti.engine.runtime.ProcessInstance;
@ -22,6 +25,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
@ -63,6 +67,9 @@ public class OutsourceQuoteController extends BaseController
@Autowired
private IProcessService processService;
@Autowired
private OutsourceQuoteMapper outsourceQuoteMapper;
@RequiresPermissions("system:outsource_quote:view")
@GetMapping()
public String outsource_quote()
@ -90,11 +97,18 @@ public class OutsourceQuoteController extends BaseController
@Log(title = "委外报价", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(OutsourceQuoteVO outsourceQuoteVO)
{
List<OutsourceQuoteVO> list = outsourceQuoteService.getExportList(outsourceQuoteVO);
ExcelUtil<OutsourceQuoteVO> util = new ExcelUtil<OutsourceQuoteVO>(OutsourceQuoteVO.class);
return util.exportExcel(list, "委外报价数据");
public AjaxResult export(OutsourceQuoteVO outsourceQuoteVO, String ids) {
if (StringUtils.isEmpty(ids)){
List<OutsourceQuoteChild> quoteChildren = outsourceQuoteMapper.selectOutsourceQuoteChildList();
ExcelUtil<OutsourceQuoteChild> util = new ExcelUtil<OutsourceQuoteChild>(OutsourceQuoteChild.class);
return util.exportExcel(quoteChildren, "委外报价数据");
}else {
String[] quoteCodes = ids.split(",");
List<OutsourceQuoteChild> quoteChildren = outsourceQuoteMapper.selectOutsourceQuoteChildByCodes(quoteCodes);
ExcelUtil<OutsourceQuoteChild> util = new ExcelUtil<OutsourceQuoteChild>(OutsourceQuoteChild.class);
return util.exportExcel(quoteChildren, ids);
}
}
/**
* 表格细节视图
@ -216,7 +230,7 @@ public class OutsourceQuoteController extends BaseController
// erpBomVo.setUseStatus("1");
}
}
outsourceQuoteService.updateOutsourceQuote(outsourceQuoteVO);
outsourceQuoteService.updateAuditOutsourceQuote(outsourceQuoteVO);
// 驳回申请后继续申请,可能修改表单
if (saveEntityBoolean) {
outsourceQuoteService.updateOutsourceQuote(outsourceQuoteVO);

22
ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceQuoteChild.java

@ -20,47 +20,47 @@ public class OutsourceQuoteChild extends BaseEntity
private Long outsourceQuoteChildId;
/** 关联报价编号字段 */
@Excel(name = "关联报价编号字段")
@Excel(name = "委外报价单号", sort = 1)
private String outsourceQuoteCode;
/** 委外工序ID */
@Excel(name = "委外工序ID")
@Excel(name = "委外工序ID",sort = 4)
private String outsourceProcessCode;
/** 委外工序编号 */
@Excel(name = "委外工序编号")
@Excel(name = "委外工序编号",sort = 5)
private String outsourceProcessNo;
/** 委外工序名称 */
@Excel(name = "委外工序名称")
@Excel(name = "委外工序名称",sort = 6)
private String outsourceProcessName;
/** 税率 */
@Excel(name = "税率")
@Excel(name = "税率",sort = 7)
private BigDecimal taxRate;
/** 工序的不含税单价(RMB) */
@Excel(name = "工序的含税单价(RMB) ")
@Excel(name = "工序的含税单价(RMB) ",sort = 10)
private BigDecimal materialRmb;
/** 工序的含税单价(RMB) */
@Excel(name = "工序的含税单价(RMB)")
@Excel(name = "工序的含税单价(RMB)",sort = 9)
private BigDecimal materialNormb;
/** 供应商编号 */
@Excel(name = "供应商编号")
@Excel(name = "供应商编号",sort = 2)
private String supplierCode;
/** 供应商名称 */
@Excel(name = "供应商名称")
@Excel(name = "供应商名称",sort = 3)
private String supplierName;
/** 审核状态 */
@Excel(name = "审核状态")
@Excel(name = "审核状态",sort = 11,dictType = "auditStatus")
private String auditStatus;
/** 计价单位 */
@Excel(name = "计价单位")
@Excel(name = "计价单位",sort = 8,dictType = "outsource_quote_unit")
private String chargeUnit;
public String getChargeUnit() {

7
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceQuoteMapper.java

@ -36,7 +36,10 @@ public interface OutsourceQuoteMapper
* @param outsourceQuoteCode 委外报价工序信息
* @return 委外报价工序信息集合
*/
public List<OutsourceQuoteChild> selectOutsourceQuoteChildList(String outsourceQuoteCode);
public List<OutsourceQuoteChild> selectOutsourceQuoteChildListByCode(String outsourceQuoteCode);
public List<OutsourceQuoteChild> selectOutsourceQuoteChildList();
/**
* 新增委外报价
@ -110,4 +113,6 @@ public interface OutsourceQuoteMapper
* @return 结果
*/
public List<OutsourceQuoteChild> selectQuoteChildListByProcessNo(String outsourceProcessNo);
public List<OutsourceQuoteChild> selectOutsourceQuoteChildByCodes(String[] outsourceQuoteCodes);
}

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

@ -82,4 +82,8 @@ public interface IOutsourceQuoteService
* 导出列表
* */
List<OutsourceQuoteVO> getExportList(OutsourceQuoteVO outsourceQuote);
// 更新审核后信息
public int updateAuditOutsourceQuote(OutsourceQuoteVO outsourceQuoteVO);
}

23
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourceQuoteServiceImpl.java

@ -73,7 +73,7 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService
public OutsourceQuoteVO selectOutsourceQuoteByOutsourceQuoteId(Long outsourceQuoteId)
{
OutsourceQuoteVO outsourceQuoteVO = outsourceQuoteMapper.selectOutsourceQuoteByOutsourceQuoteId(outsourceQuoteId);
List<OutsourceQuoteChild> children = outsourceQuoteMapper.selectOutsourceQuoteChildList(outsourceQuoteVO.getOutsourceQuoteCode());
List<OutsourceQuoteChild> children = outsourceQuoteMapper.selectOutsourceQuoteChildListByCode(outsourceQuoteVO.getOutsourceQuoteCode());
outsourceQuoteVO.setOutsourceQuoteChildList(children);
return outsourceQuoteVO;
}
@ -163,6 +163,7 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService
child.setSupplierCode(childVO.getSupplierQuoteCode());
child.setSupplierName(childVO.getSupplierName());
child.setTaxRate(childVO.getTaxRate());
child.setAuditStatus("0");
}
childVO.setProcessAmount(children.size());
childVO.setOutsourceQuoteChildList(children);
@ -191,6 +192,22 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService
return outsourceQuoteMapper.updateOutsourceQuote(outsourceQuoteVO);
}
// 更新审核后信息(更新子表审核状态,防止子表信息丢失
@Transactional
@Override
public int updateAuditOutsourceQuote(OutsourceQuoteVO outsourceQuoteVO){
SysUser user = ShiroUtils.getSysUser();
outsourceQuoteVO.setUpdateTime(DateUtils.getNowDate());
outsourceQuoteVO.setUpdateBy(user.getLoginName());
List<OutsourceQuoteChild> quoteChildren = outsourceQuoteMapper.selectOutsourceQuoteChildListByCode(outsourceQuoteVO.getOutsourceQuoteCode());
if(StringUtils.isNotEmpty(quoteChildren)){
outsourceQuoteMapper.deleteOutsourceQuoteChildByOutsourceQuoteCode(outsourceQuoteVO.getOutsourceQuoteCode());
outsourceQuoteVO.setOutsourceQuoteChildList(quoteChildren);
insertOutsourceQuoteChild(outsourceQuoteVO);
}
return outsourceQuoteMapper.updateOutsourceQuote(outsourceQuoteVO);
}
/**
* 删除委外报价信息
*
@ -218,6 +235,10 @@ public class OutsourceQuoteServiceImpl implements IOutsourceQuoteService
{
if (outsourceQuoteChildList.size() > 0)
{
for (OutsourceQuoteChild child:outsourceQuoteChildList) {
child.setOutsourceProcessCode(outsourceQuote.getOutsourceQuoteCode());
child.setAuditStatus(outsourceQuote.getAuditStatus());
}
outsourceQuoteMapper.batchOutsourceQuoteChild(outsourceQuoteChildList);
}
}

21
ruoyi-admin/src/main/resources/mapper/system/OutsourceQuoteMapper.xml

@ -60,13 +60,15 @@
<select id="selectOutsourceQuoteList" parameterType="OutsourceQuoteVO" resultMap="OutsourceQuoteResult">
<include refid="selectOutsourceQuoteVo"/>
<where>
<if test="outsourceQuoteCode != null and outsourceQuoteCode != ''"> and outsource_quote_code = #{outsourceQuoteCode}</if>
<if test="supplierQuoteCode != null and supplierQuoteCode != ''"> and supplier_quote_code = #{supplierQuoteCode}</if>
<if test="outsourceQuoteCode != null and outsourceQuoteCode != ''"> and outsource_quote_code like concat('%', #{outsourceQuoteCode}, '%')</if>
<if test="supplierQuoteCode != null and supplierQuoteCode != ''"> and supplier_quote_code like concat('%', #{supplierQuoteCode}, '%')</if>
<if test="supplierName != null and supplierName != ''"> and supplier_name like concat('%', #{supplierName}, '%')</if>
<if test="taxRate != null "> and tax_rate = #{taxRate}</if>
<if test="pricingDate != null and pricingDate != ''"> and pricingDate = #{pricingDate}</if>
<if test="params.beginPricingTime != null and params.beginPricingTime != '' and params.endPricingTime != null and params.endPricingTime != ''"> and pricingDate between #{params.beginPricingTime} and #{params.endPricingTime}</if>
<if test="createBy != null and createBy != ''"> and create_by = #{createBy}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
<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>
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if>
</where>
order by audit_status asc, create_time desc
@ -77,12 +79,17 @@
where outsource_quote_id = #{outsourceQuoteId}
</select>
<select id="selectOutsourceQuoteChildList" resultType="OutsourceQuoteChild" resultMap="OutsourceQuoteChildResult">
<select id="selectOutsourceQuoteChildListByCode" resultType="OutsourceQuoteChild" resultMap="OutsourceQuoteChildResult">
select outsource_quote_child_id, outsource_quote_code, outsource_process_code, outsource_process_no, outsource_process_name, remark, tax_rate, material_rmb, material_noRmb, supplier_code, supplier_name, create_by, create_time, update_by, update_time, audit_status,charge_unit
from outsource_quote_child
where outsource_quote_code = #{outsource_quote_code}
</select>
<select id="selectOutsourceQuoteChildList" resultType="OutsourceQuoteChild" resultMap="OutsourceQuoteChildResult">
select outsource_quote_child_id, outsource_quote_code, outsource_process_code, outsource_process_no, outsource_process_name, remark, tax_rate, material_rmb, material_noRmb, supplier_code, supplier_name, create_by, create_time, update_by, update_time, audit_status,charge_unit
from outsource_quote_child
</select>
<insert id="insertOutsourceQuote" parameterType="OutsourceQuoteVO" useGeneratedKeys="true" keyProperty="outsourceQuoteId">
insert into outsource_quote
<trim prefix="(" suffix=")" suffixOverrides=",">
@ -207,4 +214,12 @@
<update id="restoreOutsourceQuoteById" parameterType="Long">
update outsource_quote set del_flag = '0' where outsource_quote_id = #{outsourceQuoteId}
</update>
<select id="selectOutsourceQuoteChildByCodes" parameterType="String" resultMap="OutsourceQuoteChildResult">
select outsource_quote_child_id, outsource_quote_code, outsource_process_code, outsource_process_no, outsource_process_name, remark, tax_rate, material_rmb, material_noRmb, supplier_code, supplier_name, create_by, create_time, update_by, update_time, audit_status,charge_unit from outsource_quote_child
where outsource_quote_code in
<foreach item="OutsourceQuoteCode" collection="array" open="(" separator="," close=")">
#{OutsourceQuoteCode}
</foreach>
</select>
</mapper>

32
ruoyi-admin/src/main/resources/templates/system/outsource_quote/outsource_quote.html

@ -35,9 +35,9 @@
</li>
<li>
<label>录入时间:</label>
<input type="text" class="time-input" id="createstartTime" placeholder="开始时间" name="params[beginTime]"/>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
<span>-</span>
<input type="text" class="time-input" id="createendTime" placeholder="结束时间" name="params[endTime]"/>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
</li>
<li>
<label>录入人:</label>
@ -45,9 +45,9 @@
</li>
<li>
<label>定价日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
<input type="text" class="time-input" id="pricingStartTime" placeholder="开始时间" name="params[beginPricingTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endTime]"/>
<input type="text" class="time-input" id="pricingEndTime" placeholder="结束时间" name="params[endPricingTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@ -62,7 +62,7 @@
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:outsource_quote:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:outsource_quote:export">
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="system:outsource_quote:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
@ -271,6 +271,28 @@
$.modal.open("修改委外报价",url,1000,600);
}
// 导出
function exportExcel() {
var ids = $.table.selectColumns("outsourceQuoteCode");
var dataParam = $("#formId").serializeArray();
let tipMsg = "确定导出当前所有数据吗?";
if ($.common.isNotEmpty(ids)) {
tipMsg = `确定导出 ${ids} 数据吗?`;
dataParam.push({ "name": "ids", "value": ids });
}
$.modal.loading("正在导出数据,请稍后...");
$.modal.confirm(tipMsg, function () {
$.post( prefix + "/export", dataParam, function (result) {
if (result.code === web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName="+ encodeURI(result.msg) + "&delete=" + true;
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
});
});
}
</script>
</body>
</html>
Loading…
Cancel
Save