领料单记录明细批量打印

master
FCD 5 days ago
parent 90dfc3d58b
commit 50a3c031fe

@ -3,6 +3,7 @@ package com.op.mes.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.op.mes.domain.MesPrepare;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -113,4 +114,16 @@ public class MesPrepareDetailController extends BaseController {
public AjaxResult remove(@PathVariable String[] recordIds) {
return toAjax(mesPrepareDetailService.deleteMesPrepareDetailByRecordIds(recordIds));
}
/**
*
*
* @return
*/
@RequiresPermissions("mes:prepareDetail:export")
@Log(title = "mes备料打印生产物料", businessType = BusinessType.EXPORT)
@GetMapping("/printBatchPrepare")
public AjaxResult printBatchPrepare(MesPrepare params) {
return AjaxResult.success(mesPrepareDetailService.printBatchPrepare(params));
}
}

@ -74,4 +74,6 @@ public interface MesPrepareDetailMapper {
List<MesPrepareDetail> selectPrintPrepareDetailList(MesPrepareDetail dto);
List<MesPrepareDetail> selectPreDetailHzList(MesPrepareDetail qodetail);
List<MesPrepareDetail> selectPrintPrepareDetailListByOrderCodes(@Param("list") List<String> orderCodes);
}

@ -3,6 +3,7 @@ package com.op.mes.service;
import java.util.List;
import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.domain.MesPrepare;
import com.op.mes.domain.MesPrepareDetail;
/**
@ -68,4 +69,6 @@ public interface IMesPrepareDetailService {
AjaxResult printPrepareByCode(String workorderCode,String recoil);
AjaxResult printPrepareXByCode(String productDate);
List<MesPrepareDetail> printBatchPrepare(MesPrepare params);
}

@ -151,4 +151,13 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
printPrepareVo.setMesPrepareDetailList(mesPrepareDetailList);
return AjaxResult.success(printPrepareVo);
}
@Override
@DS("#header.poolName")
public List<MesPrepareDetail> printBatchPrepare(MesPrepare params) {
//获取今天的领料单
List<MesPrepare> prepareList = mesPrepareMapper.selectMesPrepareList(params);
List<String> orderCodes = prepareList.stream().map(MesPrepare::getWorkorderCode).collect(Collectors.toList());
return mesPrepareDetailMapper.selectPrintPrepareDetailListByOrderCodes(orderCodes);
}
}

@ -215,4 +215,34 @@
#{recordId}
</foreach>
</delete>
<select id="selectPrintPrepareDetailListByOrderCodes" parameterType="com.op.mes.domain.MesPrepareDetail"
resultType="com.op.mes.domain.MesPrepareDetail">
select
mp.workorder_name workorderCode,
mpd.material_code materialCode,
mpd.material_name materialName,
mpd.quantity,
mpd.unit,
mpd.status,
mpd.fund_quanlity fundQuanlity,
mpd.factory_code factoryCode,
mpd.recoil,
ow.product_date productDate,
ow.prod_line_code prodLineCode,
ROW_NUMBER() OVER (ORDER BY mpd.recoil DESC) AS xh
from pro_order_workorder ow
left join mes_prepare mp on ow.workorder_code = mp.workorder_code
left join mes_prepare_detail mpd on mp.prepare_id = mpd.prepare_id
where
ow.del_flag = '0' and mpd.recoil = '' and mp.del_flag = '0' and mpd.del_flag = '0'
and ow.belong_work_order in
<foreach item="orderCode" collection="list" open="(" separator="," close=")">
#{orderCode}
</foreach>
order by mpd.recoil
</select>
</mapper>

Loading…
Cancel
Save