Browse Source

[fix]

委外加工 委外领料
修改委外领料列表页面搜索栏字段定义,新增导出按钮绑定方法;
修改委外领料mapper列表查询方法;
新增委外领料导出controller接口;
修改委外领料详情实体类,调整导出字段及顺序;
新增按领料单号列表批量查询委外领料详情数据方法;
dev
王晓迪 2 months ago
parent
commit
dc91c70f64
  1. 25
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceRequisitionController.java
  2. 19
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceRequisitionDetail.java
  3. 2
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceRequisitionMapper.java
  4. 12
      ruoyi-admin/src/main/resources/mapper/system/OutsourceRequisitionMapper.xml
  5. 32
      ruoyi-admin/src/main/resources/templates/system/outsource_requisition/outsource_requisition.html

25
ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourceRequisitionController.java

@ -6,10 +6,13 @@ import java.util.List;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.process.general.service.IProcessService;
import com.ruoyi.system.domain.OutsourceOrder;
import com.ruoyi.system.domain.OutsourceQuoteChild;
import com.ruoyi.system.domain.OutsourceRequisition;
import com.ruoyi.system.domain.OutsourceRequisitionDetail;
import com.ruoyi.system.domain.Vo.OutsourceOrderVO;
import com.ruoyi.system.domain.Vo.OutsourceQuoteVO;
import com.ruoyi.system.domain.Vo.OutsourceRequisitionVO;
import com.ruoyi.system.mapper.OutsourceRequisitionMapper;
import com.ruoyi.system.service.IOutsourceOrderService;
import com.ruoyi.system.service.IOutsourceRequisitionService;
import com.ruoyi.system.service.ISysUserService;
@ -23,6 +26,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;
@ -66,6 +70,9 @@ public class OutsourceRequisitionController extends BaseController
@Autowired
private IProcessService processService;
@Autowired
private OutsourceRequisitionMapper outsourceRequisitionMapper;
@RequiresPermissions("system:outsource_requisition:view")
@GetMapping()
public String outsource_requisition()
@ -93,11 +100,19 @@ public class OutsourceRequisitionController extends BaseController
@Log(title = "委外领料", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(OutsourceRequisitionVO outsourceRequisitionVO)
{
List<OutsourceRequisitionVO> list = outsourceRequisitionService.selectOutsourceRequisitionList(outsourceRequisitionVO);
ExcelUtil<OutsourceRequisitionVO> util = new ExcelUtil<OutsourceRequisitionVO>(OutsourceRequisitionVO.class);
return util.exportExcel(list, "委外领料数据");
public AjaxResult export(OutsourceRequisitionVO outsourceRequisitionVO, String ids) {
if (StringUtils.isEmpty(ids)){
OutsourceRequisitionDetail detail = new OutsourceRequisitionDetail();
List<OutsourceRequisitionDetail> requisitionDetails = outsourceRequisitionMapper.selectRequisitionDetailByNo(detail);
ExcelUtil<OutsourceRequisitionDetail> util = new ExcelUtil<OutsourceRequisitionDetail>(OutsourceRequisitionDetail.class);
return util.exportExcel(requisitionDetails, "委外领料数据");
}else {
String[] requisitionCodes = ids.split(",");
List<OutsourceRequisitionDetail> requisitionDetails = outsourceRequisitionMapper.selectOutsourceRequisitionDetailByCodes(requisitionCodes);
ExcelUtil<OutsourceRequisitionDetail> util = new ExcelUtil<OutsourceRequisitionDetail>(OutsourceRequisitionDetail.class);
return util.exportExcel(requisitionDetails, ids);
}
}
/**

19
ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceRequisitionDetail.java

@ -21,42 +21,51 @@ public class OutsourceRequisitionDetail extends BaseEntity
private Long outsourceRequisitionDetailId;
/** 委外领料编号 */
@Excel(name = "委外领料编号")
@Excel(name = "委外领料编号",sort = 1)
private String outsourceRequisitionNo;
/** 委外订单编号 */
@Excel(name = "委外订单编号")
@Excel(name = "委外订单编号",sort = 2)
private String outsourceOrderNo;
/** 料号 */
@Excel(name = "料号")
@Excel(name = "料号",sort = 3)
private String materialNo;
/** 物料名称 */
@Excel(name = "物料名称",sort = 4)
private String materialName;
/** 物料类型 */
// @Excel(name = "物料类型",sort = 5)
private String materialType;
/** 物料图片 */
@Excel(name = "物料图片",sort = 5)
private String materialPhotoUrl;
/** 单位 */
@Excel(name = "单位",sort = 6)
private String unit;
/** 描述 */
@Excel(name = "描述",sort = 8)
private String description;
/** 品牌 */
@Excel(name = "品牌",sort = 7)
private String brand;
/** 加工方式 */
@Excel(name = "加工方式",sort = 9,dictType = "processMethod")
private String processMethod;
/** 计划委外数 */
@Excel(name = "计划委外数",sort = 10)
private BigDecimal plannedOutsourceAmount;
// 实际委外数
@Excel(name = "实际委外数",sort = 11)
private BigDecimal actualOutsourceAmount;
// 关联单号
@ -78,11 +87,11 @@ public class OutsourceRequisitionDetail extends BaseEntity
private String deliveryTimeInfo;
/** 已委外领料数 */
@Excel(name = "已委外领料数")
@Excel(name = "已委外领料数",sort = 12)
private BigDecimal takenMaterial;
/** 本次委外领料数 */
@Excel(name = "本次委外领料数")
@Excel(name = "本次委外领料数",sort = 13)
private BigDecimal takingMaterial;
public void setOutsourceRequisitionDetailId(Long outsourceRequisitionDetailId)

2
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceRequisitionMapper.java

@ -98,4 +98,6 @@ public interface OutsourceRequisitionMapper
// 根据领料单号/委外单号/料号组合查询领料详情列表
public List<OutsourceRequisitionDetail> selectRequisitionDetailByNo(OutsourceRequisitionDetail outsourceRequisitionDetail);
public List<OutsourceRequisitionDetail> selectOutsourceRequisitionDetailByCodes(String[] requisitionNos);
}

12
ruoyi-admin/src/main/resources/mapper/system/OutsourceRequisitionMapper.xml

@ -72,10 +72,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectOutsourceRequisitionList" parameterType="OutsourceRequisitionVO" resultMap="OutsourceRequisitionResult">
<include refid="selectOutsourceRequisitionVo"/>
<where>
<if test="outsourceRequisitionNo != null and outsourceRequisitionNo != ''"> and outsource_requisition_no = #{outsourceRequisitionNo}</if>
<if test="outsourceOrderNo != null and outsourceOrderNo != ''"> and outsource_order_no = #{outsourceOrderNo}</if>
<if test="outsourceRequisitionNo != null and outsourceRequisitionNo != ''"> and outsource_requisition_no like concat('%', #{outsourceRequisitionNo}, '%')</if>
<if test="outsourceOrderNo != null and outsourceOrderNo != ''"> and outsource_order_no like concat('%', #{outsourceOrderNo}, '%')</if>
<if test="requisitionPerson != null and requisitionPerson != ''"> and requisition_person = #{requisitionPerson}</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>
</where>
</select>
@ -204,4 +205,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select id="selectOutsourceRequisitionDetailByCodes" parameterType="String" resultMap="OutsourceRequisitionDetailResult">
<include refid="selectOutsourceRequisitionDetail"/>
where outsource_requisition_no in
<foreach item="outsourceRequisitionNo" collection="array" open="(" separator="," close=")">
#{outsourceRequisitionNo}
</foreach>
</select>
</mapper>

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

@ -22,9 +22,11 @@
<label>领料员:</label>
<input type="text" name="requisitionPerson"/>
</li>
<li>
<label>录入时间:</label>
<input type="text" class="time-input" placeholder="请选择录入时间" name="createTime"/>
<li class="select-time">
<label>录入时间: </label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginCreateTime]"/>
<span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endCreateTime]"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@ -36,7 +38,7 @@
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:outsource_requisition:export">
<a class="btn btn-warning" onclick="exportExcel()" shiro:hasPermission="system:outsource_requisition:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
@ -238,6 +240,28 @@
};
$.table.init(options);
});
// 导出
function exportExcel() {
var ids = $.table.selectColumns("outsourceRequisitionNo");
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