打印备料单

highway
wws 1 year ago
parent aae8fc7dc1
commit 9771ab2ff3

@ -33,6 +33,17 @@ public class MesPrepareDetailController extends BaseController {
@Autowired
private IMesPrepareDetailService mesPrepareDetailService;
/**
* code
* @return
*/
@RequiresPermissions("mes:prepareDetail:export")
@Log(title = "mes备料打印", businessType = BusinessType.EXPORT)
@GetMapping("/printPrepareByCode/{workorderCode}")
public AjaxResult printPrepareByCode(@PathVariable("workorderCode") String workorderCode) {
return mesPrepareDetailService.printPrepareByCode(workorderCode);
}
/**
* mes
*/

@ -0,0 +1,32 @@
package com.op.mes.domain.vo;
import com.op.mes.domain.MesPrepare;
import com.op.mes.domain.MesPrepareDetail;
import java.util.Date;
import java.util.List;
// 打印备料单返回实体
public class PrintPrepareVo {
private MesPrepare mesPrepare;
private List<MesPrepareDetail> mesPrepareDetailList;
public PrintPrepareVo() {
}
public MesPrepare getMesPrepare() {
return mesPrepare;
}
public void setMesPrepare(MesPrepare mesPrepare) {
this.mesPrepare = mesPrepare;
}
public List<MesPrepareDetail> getMesPrepareDetailList() {
return mesPrepareDetailList;
}
public void setMesPrepareDetailList(List<MesPrepareDetail> mesPrepareDetailList) {
this.mesPrepareDetailList = mesPrepareDetailList;
}
}

@ -2,6 +2,7 @@ package com.op.mes.mapper;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.mes.domain.MesPrepareDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -63,4 +64,11 @@ public interface MesPrepareDetailMapper {
public int deleteMesPrepareDetailByRecordIds(String[] recordIds);
public void insertMesPrepareDetails(@Param("list") List<MesPrepareDetail> details);
/**
* idlist
* @param prepareId
* @return
*/
List<MesPrepareDetail> selectPrintPrepareDetailList(String prepareId);
}

@ -2,6 +2,7 @@ package com.op.mes.mapper;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.mes.domain.MesPrepare;
import org.apache.ibatis.annotations.Mapper;
@ -62,4 +63,11 @@ public interface MesPrepareMapper {
public int deleteMesPrepareByPrepareIds(String[] prepareIds);
public List<MesPrepare> getParentWorkOrderT1(MesPrepare qo);
/**
* code
* @param workorderCode
* @return
*/
MesPrepare selectMesPrepareByCode(String workorderCode);
}

@ -1,6 +1,8 @@
package com.op.mes.service;
import java.util.List;
import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.domain.MesPrepareDetail;
/**
@ -57,4 +59,10 @@ public interface IMesPrepareDetailService {
* @return
*/
public int deleteMesPrepareDetailByRecordId(String recordId);
/**
* code
* @return
*/
AjaxResult printPrepareByCode(String workorderCode);
}

@ -1,7 +1,13 @@
package com.op.mes.service.impl;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.utils.DateUtils;
import com.op.common.core.web.domain.AjaxResult;
import com.op.mes.domain.MesPrepare;
import com.op.mes.domain.vo.PrintPrepareVo;
import com.op.mes.mapper.MesPrepareMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.op.mes.mapper.MesPrepareDetailMapper;
@ -18,6 +24,8 @@ import com.op.mes.service.IMesPrepareDetailService;
public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
@Autowired
private MesPrepareDetailMapper mesPrepareDetailMapper;
@Autowired
private MesPrepareMapper mesPrepareMapper;
/**
* mes
@ -86,4 +94,19 @@ public class MesPrepareDetailServiceImpl implements IMesPrepareDetailService {
public int deleteMesPrepareDetailByRecordId(String recordId) {
return mesPrepareDetailMapper.deleteMesPrepareDetailByRecordId(recordId);
}
/**
* code
* @return
*/
@Override
@DS("#header.poolName")
public AjaxResult printPrepareByCode(String workorderCode) {
MesPrepare mesPrepare = mesPrepareMapper.selectMesPrepareByCode(workorderCode);
List<MesPrepareDetail> mesPrepareDetailList = mesPrepareDetailMapper.selectPrintPrepareDetailList(mesPrepare.getPrepareId());
PrintPrepareVo printPrepareVo = new PrintPrepareVo();
printPrepareVo.setMesPrepare(mesPrepare);
printPrepareVo.setMesPrepareDetailList(mesPrepareDetailList);
return AjaxResult.success(printPrepareVo);
}
}

@ -8,8 +8,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="recordId" column="record_id" />
<result property="prepareId" column="prepare_id" />
<result property="materialCode" column="material_code" />
<result property="materailName" column="materail_name" />
<result property="materailSpc" column="materail_spc" />
<result property="materailName" column="material_name" />
<result property="materailSpc" column="material_spc" />
<result property="unit" column="unit" />
<result property="quantity" column="quantity" />
<result property="productDate" column="product_date" />
@ -26,6 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="prodType" column="prod_type" />
<result property="factoryCode" column="factory_code" />
<result property="fundQuanlity" column="fund_quanlity" />
</resultMap>
<sql id="selectMesPrepareDetailVo">
@ -61,6 +62,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where record_id = #{recordId}
</select>
<select id="selectPrintPrepareDetailList" parameterType="String" resultMap="MesPrepareDetailResult">
select record_id, prepare_id, material_code,material_name, unit,
quantity, status, remark, attr1, attr2, attr3, attr4,
create_by, create_time, update_by, update_time, prod_type, factory_code,fund_quanlity
from mes_prepare_detail
where prepare_id = #{prepareId}
</select>
<insert id="insertMesPrepareDetail" parameterType="MesPrepareDetail">
insert into mes_prepare_detail
<trim prefix="(" suffix=")" suffixOverrides=",">

@ -110,7 +110,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and CONVERT(varchar(100), product_date, 23) = #{dayStr}
</select>
<insert id="insertMesPrepare" parameterType="MesPrepare">
<select id="selectMesPrepareByCode" parameterType="String" resultMap="MesPrepareResult">
select prepare_id, workorder_code, workorder_name, parent_order, order_id, order_code, product_id, product_code, prod_type, product_name, product_spc, wet_detail_plan_id, product_date, shift_id, ancestors, status, remark, attr1, attr2, attr3, attr4, create_by, create_time, update_by, update_time, factory_code, unit from mes_prepare
where workorder_code = #{workorderCode}
</select>
<insert id="insertMesPrepare" parameterType="MesPrepare">
insert into mes_prepare
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="prepareId != null">prepare_id,</if>

Loading…
Cancel
Save