Merge remote-tracking branch 'origin/master'

master
zhaoxiaolin 1 year ago
commit a4f45a2cbf

@ -114,6 +114,12 @@ public class EquRepairOrderController extends BaseController {
@GetMapping("/getEquipmentList") @GetMapping("/getEquipmentList")
public TableDataInfo getEquipmentList(EquEquipment equEquipment) { public TableDataInfo getEquipmentList(EquEquipment equEquipment) {
startPage(); startPage();
if(equEquipment.getItemCode() != null){
equEquipment.setEquipmentCode(equEquipment.getItemCode());
}
if(equEquipment.getItemName()!= null){
equEquipment.setEquipmentName(equEquipment.getItemName());
}
List<EquEquipment> list = equRepairOrderService.selectEquEquipmentList(equEquipment); List<EquEquipment> list = equRepairOrderService.selectEquEquipmentList(equEquipment);
return getDataTable(list); return getDataTable(list);
} }
@ -123,7 +129,6 @@ public class EquRepairOrderController extends BaseController {
*/ */
@GetMapping("/getEquipmentTypeList") @GetMapping("/getEquipmentTypeList")
public TableDataInfo getEquipmentTypeList(EquEquipment equEquipment) { public TableDataInfo getEquipmentTypeList(EquEquipment equEquipment) {
startPage();
List<EquEquipment> list = equRepairOrderService.getEquipmentTypeList(equEquipment); List<EquEquipment> list = equRepairOrderService.getEquipmentTypeList(equEquipment);
return getDataTable(list); return getDataTable(list);
} }

@ -240,6 +240,24 @@ public class EquEquipment extends BaseEntity {
// 组线名称 // 组线名称
private String groupLineName; private String groupLineName;
//虚拟字段
private String itemCode;
private String itemName;
public String getItemCode() {
return itemCode;
}
public void setItemCode(String itemCode) {
this.itemCode = itemCode;
}
public String getItemName() {
return itemName;
}
public void setItemName(String itemName) {
this.itemName = itemName;
}
public String getGroupLineName() { public String getGroupLineName() {
return groupLineName; return groupLineName;
} }

@ -70,4 +70,6 @@ public interface EquEquipmentMapper {
// 查询设备信息 // 查询设备信息
List<EquEquipment> selectEquipmentList(EquEquipment equEquipment); List<EquEquipment> selectEquipmentList(EquEquipment equEquipment);
//查询组线为空的设备列表
List<EquEquipment> selectGroupLineNullList(EquEquipment equEquipment);
} }

@ -243,8 +243,15 @@ public class EquPlanServiceImpl implements IEquPlanService {
@Override @Override
@DS("#header.poolName") @DS("#header.poolName")
public List<EquEquipment> getEquList(EquEquipment equEquipment) { public List<EquEquipment> getEquList(EquEquipment equEquipment) {
//如果组线不为空
if(equEquipment.getGroupLine() != null){
equEquipment.setEquipmentCategory("0"); equEquipment.setEquipmentCategory("0");
return equEquipmentMapper.selectEquipmentList(equEquipment); List<EquEquipment> list = equEquipmentMapper.selectEquipmentList(equEquipment);
return list;
}else{
List<EquEquipment> list = equEquipmentMapper.selectGroupLineNullList(equEquipment);
return list;
}
} }
/** /**

@ -111,12 +111,14 @@
<if test="equipmentCategory != null and equipmentCategory != ''">and equipment_category = <if test="equipmentCategory != null and equipmentCategory != ''">and equipment_category =
#{equipmentCategory} #{equipmentCategory}
</if> </if>
and del_flag = '0'
</where> </where>
</select> </select>
<select id="selectEquEquipmentByEquEquipmentCode" parameterType="String" resultMap="EquEquipmentResult"> <select id="selectEquEquipmentByEquEquipmentCode" parameterType="String" resultMap="EquEquipmentResult">
<include refid="selectEquEquipmentVo"/> <include refid="selectEquEquipmentVo"/>
where equipment_code = #{equipmentCode} where equipment_code = #{equipmentCode}
and del_flag = '0'
</select> </select>
<insert id="insertEquEquipment" parameterType="EquEquipment"> <insert id="insertEquEquipment" parameterType="EquEquipment">
@ -272,6 +274,7 @@
from base_equipment from base_equipment
where del_flag = '0' where del_flag = '0'
group by equipment_type_code,equipment_type_name group by equipment_type_code,equipment_type_name
order by equipment_type_name desc
</select> </select>
<select id="selectEquipmentGroupLine" resultMap="EquEquipmentResult"> <select id="selectEquipmentGroupLine" resultMap="EquEquipmentResult">
@ -282,21 +285,32 @@
</select> </select>
<select id="selectEquipmentList" parameterType="EquEquipment" resultMap="EquEquipmentResult"> <select id="selectEquipmentList" parameterType="EquEquipment" resultMap="EquEquipmentResult">
select be.equipment_code,be.equipment_name,be.equipment_type_code,be.equipment_type_name,be.workshop_name select be.equipment_code,be.equipment_name,be.equipment_type_code,be.equipment_type_name,be.workshop_name,be.equipment_category
from base_equipment be from base_equipment be
<where> <where>
<if test="equipmentCode != null and equipmentCode != ''">and equipment_code like concat('%', <if test="equipmentCode != null and equipmentCode != ''">and equipment_code like concat('%',#{equipmentCode}, '%')</if>
#{equipmentCode}, '%') <if test="equipmentName != null and equipmentName != ''">and equipment_name like concat('%',#{equipmentName}, '%')</if>
</if> <if test="equipmentTypeCode != null and equipmentTypeCode != ''">and equipment_type_code = #{equipmentTypeCode}</if>
<if test="equipmentName != null and equipmentName != ''">and equipment_name like concat('%',
#{equipmentName}, '%')
</if>
and be.del_flag = '0' and be.del_flag = '0'
and be.equipment_code in (select bae.auxiliary_equipment_code and be.equipment_code in
(select bae.auxiliary_equipment_code
from equ_bind_auxiliary_equipment bae from equ_bind_auxiliary_equipment bae
where bae.equipment_code = #{groupLine} <where>
<if test="groupLine != null and groupLine != ''">and bae.equipment_code like concat('%',#{groupLine}, '%')</if>
</where>
) )
</where> </where>
</select> </select>
<select id="selectGroupLineNullList" parameterType="EquEquipment" resultMap="EquEquipmentResult">
select be.equipment_code,be.equipment_name,be.equipment_type_code,be.equipment_type_name,be.workshop_name,be.equipment_category
from base_equipment be
<where>
<if test="equipmentCode != null and equipmentCode != ''">and equipment_code like concat('%',#{equipmentCode}, '%')</if>
<if test="equipmentTypeCode != null and equipmentTypeCode != ''">and equipment_type_code = #{equipmentTypeCode}</if>
<if test="equipmentName != null and equipmentName != ''">and equipment_name like concat('%',#{equipmentName}, '%')</if>
and be.del_flag = '0'
</where>
</select>
</mapper> </mapper>

@ -38,7 +38,7 @@ public class MesUnitPriceReportController extends BaseController {
/** /**
* *
*/ */
@RequiresPermissions("system:report:list") @RequiresPermissions("unitPriceReport:report:list")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(MesUnitpriceReport mesUnitpriceReport) { public TableDataInfo list(MesUnitpriceReport mesUnitpriceReport) {
startPage(); startPage();
@ -49,7 +49,7 @@ public class MesUnitPriceReportController extends BaseController {
/** /**
* *
*/ */
@RequiresPermissions("system:report:export") @RequiresPermissions("unitPriceReport:report:export")
@Log(title = "计件工资统计", businessType = BusinessType.EXPORT) @Log(title = "计件工资统计", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, MesUnitpriceReport mesUnitpriceReport) { public void export(HttpServletResponse response, MesUnitpriceReport mesUnitpriceReport) {
@ -61,7 +61,7 @@ public class MesUnitPriceReportController extends BaseController {
/** /**
* *
*/ */
@RequiresPermissions("system:report:query") @RequiresPermissions("unitPriceReport:report:query")
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") String id) { public AjaxResult getInfo(@PathVariable("id") String id) {
return success(mesUnitpriceReportService.selectMesUnitpriceReportById(id)); return success(mesUnitpriceReportService.selectMesUnitpriceReportById(id));
@ -70,7 +70,7 @@ public class MesUnitPriceReportController extends BaseController {
/** /**
* *
*/ */
@RequiresPermissions("system:report:add") @RequiresPermissions("unitPriceReport:report:add")
@Log(title = "计件工资统计", businessType = BusinessType.INSERT) @Log(title = "计件工资统计", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody MesUnitpriceReport mesUnitpriceReport) { public AjaxResult add(@RequestBody MesUnitpriceReport mesUnitpriceReport) {
@ -80,7 +80,7 @@ public class MesUnitPriceReportController extends BaseController {
/** /**
* *
*/ */
@RequiresPermissions("system:report:edit") @RequiresPermissions("unitPriceReport:report:edit")
@Log(title = "计件工资统计", businessType = BusinessType.UPDATE) @Log(title = "计件工资统计", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody MesUnitpriceReport mesUnitpriceReport) { public AjaxResult edit(@RequestBody MesUnitpriceReport mesUnitpriceReport) {
@ -90,7 +90,7 @@ public class MesUnitPriceReportController extends BaseController {
/** /**
* *
*/ */
@RequiresPermissions("system:report:remove") @RequiresPermissions("unitPriceReport:report:remove")
@Log(title = "计件工资统计", businessType = BusinessType.DELETE) @Log(title = "计件工资统计", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable String[] ids) { public AjaxResult remove(@PathVariable String[] ids) {

@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.op.common.core.annotation.Excel; import com.op.common.core.annotation.Excel;
import com.op.common.core.web.domain.BaseEntity; import com.op.common.core.web.domain.BaseEntity;
import java.math.BigDecimal;
/** /**
* mes_unitprice_report * mes_unitprice_report
* *
@ -30,58 +32,123 @@ public class MesUnitpriceReport extends BaseEntity {
*/ */
@Excel(name = "SAP订单编码") @Excel(name = "SAP订单编码")
private String workorderCodeSap; private String workorderCodeSap;
/**
*
*/
@Excel(name = "产品编号")
private String productCode;
/** /**
* *
*/ */
@Excel(name = "产品名称") @Excel(name = "产品名称")
private String productName; private String productName;
/**
*
*/
@Excel(name = "产品编号")
private String productCode;
@Excel(name = "产线编码")
private String lineCode; private String lineCode;
@Excel(name = "产线名称")
/** private String equipmentName;
*
*/
@Excel(name = "用户账号")
private String userName;
/** /**
* *
*/ */
@Excel(name = "用户昵称") @Excel(name = "操作者")
private String nickName; private String nickName;
/**
*
*/
@Excel(name = "子工序编码")
private String childprocessCode;
/** /**
* *
*/ */
@Excel(name = "子工序名称") @Excel(name = "子工序名称")
private String childprocessName; private String childprocessName;
@Excel(name = "工序单价")
/**
* $column.columnComment
*/
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String attr1; private String attr1;
@Excel(name = "件数")
private String totalQuantity;
@Excel(name = " 薪酬(元)")
private BigDecimal result;
@Excel(name = "人数")
private String headCount;
@Excel(name = "平均工资")
private String avgResult;
@Excel(name = "实际工资")
private String realWages;
/**
*
*/
// @Excel(name = "用户账号")
private String userName;
/**
*
*/
//@Excel(name = "子工序编码")
private String childprocessCode;
/** /**
* $column.columnComment * $column.columnComment
*/ */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
/**
* $column.columnComment
*/
// @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private String attr2; private String attr2;
public String getRealWages() {
return realWages;
}
public void setRealWages(String realWages) {
this.realWages = realWages;
}
public String getHeadCount() {
return headCount;
}
public void setHeadCount(String headCount) {
this.headCount = headCount;
}
public String getAvgResult() {
return avgResult;
}
public void setAvgResult(String avgResult) {
this.avgResult = avgResult;
}
public BigDecimal getResult() {
return result;
}
public void setResult(BigDecimal result) {
this.result = result;
}
public String getTotalQuantity() {
return totalQuantity;
}
public void setTotalQuantity(String totalQuantity) {
this.totalQuantity = totalQuantity;
}
public String getEquipmentName() {
return equipmentName;
}
public void setEquipmentName(String equipmentName) {
this.equipmentName = equipmentName;
}
public String getLineCode() { public String getLineCode() {
return lineCode; return lineCode;
} }

@ -3,7 +3,9 @@ package com.op.mes.service.impl;
import java.util.List; import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS; import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.common.core.context.SecurityContextHolder;
import com.op.common.core.utils.DateUtils; import com.op.common.core.utils.DateUtils;
import com.op.common.security.utils.SecurityUtils;
import com.op.mes.domain.MesUnitpriceReport; import com.op.mes.domain.MesUnitpriceReport;
import com.op.mes.mapper.MesUnitpriceReportMapper; import com.op.mes.mapper.MesUnitpriceReportMapper;
import com.op.mes.service.IMesUnitpriceReportService; import com.op.mes.service.IMesUnitpriceReportService;
@ -29,6 +31,7 @@ public class MesUnitpriceReportServiceImpl implements IMesUnitpriceReportService
* @return * @return
*/ */
@Override @Override
@DS("#header.poolName")
public MesUnitpriceReport selectMesUnitpriceReportById(String id) { public MesUnitpriceReport selectMesUnitpriceReportById(String id) {
return mesUnitpriceReportMapper.selectMesUnitpriceReportById(id); return mesUnitpriceReportMapper.selectMesUnitpriceReportById(id);
} }
@ -52,6 +55,7 @@ public class MesUnitpriceReportServiceImpl implements IMesUnitpriceReportService
* @return * @return
*/ */
@Override @Override
public int insertMesUnitpriceReport(MesUnitpriceReport mesUnitpriceReport) { public int insertMesUnitpriceReport(MesUnitpriceReport mesUnitpriceReport) {
mesUnitpriceReport.setCreateTime(DateUtils.getNowDate()); mesUnitpriceReport.setCreateTime(DateUtils.getNowDate());
return mesUnitpriceReportMapper.insertMesUnitpriceReport(mesUnitpriceReport); return mesUnitpriceReportMapper.insertMesUnitpriceReport(mesUnitpriceReport);
@ -64,8 +68,10 @@ public class MesUnitpriceReportServiceImpl implements IMesUnitpriceReportService
* @return * @return
*/ */
@Override @Override
@DS("#header.poolName")
public int updateMesUnitpriceReport(MesUnitpriceReport mesUnitpriceReport) { public int updateMesUnitpriceReport(MesUnitpriceReport mesUnitpriceReport) {
mesUnitpriceReport.setUpdateTime(DateUtils.getNowDate()); mesUnitpriceReport.setUpdateTime(DateUtils.getNowDate());
mesUnitpriceReport.setUpdateBy(SecurityContextHolder.getUserName());
return mesUnitpriceReportMapper.updateMesUnitpriceReport(mesUnitpriceReport); return mesUnitpriceReportMapper.updateMesUnitpriceReport(mesUnitpriceReport);
} }

@ -11,11 +11,17 @@
<result property="productName" column="product_name"/> <result property="productName" column="product_name"/>
<result property="productCode" column="product_code"/> <result property="productCode" column="product_code"/>
<result property="lineCode" column="line_code"/> <result property="lineCode" column="line_code"/>
<result property="equipmentName" column="equipment_name"/>
<result property="userName" column="user_name"/> <result property="userName" column="user_name"/>
<result property="nickName" column="nick_name"/> <result property="nickName" column="nick_name"/>
<result property="childprocessCode" column="childprocess_code"/> <result property="childprocessCode" column="childprocess_code"/>
<result property="childprocessName" column="childprocess_name"/> <result property="childprocessName" column="childprocess_name"/>
<result property="totalQuantity" column="total_quantity"/>
<result property="headCount" column="head_count"/>
<result property="avgResult" column="avg_result"/>
<result property="result" column="result"/>
<result property="attr1" column="attr1"/> <result property="attr1" column="attr1"/>
<result property="realWages" column="real_wages"/>
<result property="attr2" column="attr2"/> <result property="attr2" column="attr2"/>
<result property="attr3" column="attr3"/> <result property="attr3" column="attr3"/>
<result property="createBy" column="create_by"/> <result property="createBy" column="create_by"/>
@ -31,36 +37,44 @@
<select id="selectMesUnitpriceReportList" parameterType="MesUnitpriceReport" resultMap="MesUnitpriceReportResult"> <select id="selectMesUnitpriceReportList" parameterType="MesUnitpriceReport" resultMap="MesUnitpriceReportResult">
SELECT SELECT
mur.id,
mur.workorder_code, mur.workorder_code,
mur.workorder_code_sap, mur.workorder_code_sap,
mur.product_code, mur.product_code,
mur.product_name, mur.product_name,
mur.line_code,
mur.attr1 AS real_wages,
be.equipment_name,
mur.nick_name, mur.nick_name,
mur.childprocess_code, mur.childprocess_code,
mup.childprocess_name, mup.childprocess_name,
mrw.total_quantity, mrw.total_quantity,
mup.attr1, mup.attr1,
mrw.total_quantity * mup.attr1 AS result CAST(CAST(mrw.total_quantity AS DECIMAL(18,2)) * CAST(mup.attr1 AS DECIMAL(18,5)) AS DECIMAL(18, 6)) AS result,
COUNT(*) OVER (PARTITION BY mur.workorder_code_sap, mur.childprocess_code) AS head_count,
ROUND(
CAST (
CAST(CAST(mrw.total_quantity AS DECIMAL(18,2)) * CAST(mup.attr1 AS DECIMAL(18,5)) AS DECIMAL(18, 6)) / NULLIF ( COUNT ( * ) OVER ( PARTITION BY mur.workorder_code_sap, mur.childprocess_code ), 0 ) AS DECIMAL ( 18, 4 )
),
4
) AS avg_result
FROM FROM
mes_unitprice_report mur mes_unitprice_report mur
LEFT JOIN LEFT JOIN
mes_unit_price mup ON RIGHT(mur.product_code, 11) = mup.product_code AND mur.childprocess_code = mup.childprocess_code mes_unit_price mup ON RIGHT(mur.product_code, 11) = mup.product_code AND mur.childprocess_code = mup.childprocess_code
LEFT JOIN LEFT JOIN base_equipment be ON be.equipment_code=mur.line_code
(SELECT LEFT JOIN ( SELECT parent_order, SUM ( quantity ) AS total_quantity FROM mes_report_work GROUP BY parent_order ) mrw ON mur.workorder_code = mrw.parent_order
workorder_code,
SUM(quantity) AS total_quantity
FROM
mes_report_work
<where> <where>
<if test="workorderCode != null and workorderCode != ''">and workorder_code = #{workorderCode}</if> <if test="workorderCode != null and workorderCode != ''">and workorder_code = #{workorderCode}</if>
<if test="workorderCodeSap != null and workorderCodeSap != ''">and workorder_code_sap = <if test="workorderCodeSap != null and workorderCodeSap != ''">and mur.workorder_code_sap =
#{workorderCodeSap} #{workorderCodeSap}
</if> </if>
<if test="productName != null and productName != ''">and product_name like concat('%', #{productName}, <if test="productName != null and productName != ''">and mur.product_name like concat('%', #{productName},
'%')
</if>
<if test="productCode != null and productCode != ''">and mur.product_code like concat('%', #{productCode},
'%') '%')
</if> </if>
<if test="productCode != null and productCode != ''">and product_code = #{productCode}</if>
<if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if> <if test="userName != null and userName != ''">and user_name like concat('%', #{userName}, '%')</if>
<if test="nickName != null and nickName != ''">and nick_name like concat('%', #{nickName}, '%')</if> <if test="nickName != null and nickName != ''">and nick_name like concat('%', #{nickName}, '%')</if>
<if test="childprocessCode != null and childprocessCode != ''">and childprocess_code = <if test="childprocessCode != null and childprocessCode != ''">and childprocess_code =
@ -69,17 +83,25 @@
<if test="childprocessName != null and childprocessName != ''">and childprocess_name like concat('%', <if test="childprocessName != null and childprocessName != ''">and childprocess_name like concat('%',
#{childprocessName}, '%') #{childprocessName}, '%')
</if> </if>
<if test="lineCode != null and lineCode != ''">and mur.line_code like concat('%',
#{lineCode}, '%')
</if>
<if test="equipmentName != null and equipmentName != ''">and be.equipment_name like concat('%',
#{equipmentName}, '%')
</if>
<if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if> <if test="attr1 != null and attr1 != ''">and attr1 = #{attr1}</if>
<if test="attr2 != null and attr2 != ''">and attr2 = #{attr2}</if> <if test="attr2 != null and attr2 != ''">and attr2 = #{attr2}</if>
<if test="attr3 != null and attr3 != ''">and attr3 = #{attr3}</if> <if test="attr3 != null and attr3 != ''">and attr3 = #{attr3}</if>
</where> </where>
GROUP BY GROUP BY
workorder_code) mrw ON mur.workorder_code = mrw.workorder_code mur.id,
GROUP BY
mur.workorder_code, mur.workorder_code,
mur.workorder_code_sap, mur.workorder_code_sap,
mur.product_code, mur.product_code,
mur.product_name, mur.product_name,
mur.attr1,
mur.line_code,
be.equipment_name,
mur.nick_name, mur.nick_name,
mur.childprocess_code, mur.childprocess_code,
mup.childprocess_name, mup.childprocess_name,
@ -138,21 +160,21 @@
<update id="updateMesUnitpriceReport" parameterType="MesUnitpriceReport"> <update id="updateMesUnitpriceReport" parameterType="MesUnitpriceReport">
update mes_unitprice_report update mes_unitprice_report
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="workorderCode != null">workorder_code = #{workorderCode},</if> <!-- <if test="workorderCode != null">workorder_code = #{workorderCode},</if>-->
<if test="workorderCodeSap != null">workorder_code_sap = #{workorderCodeSap},</if> <!-- <if test="workorderCodeSap != null">workorder_code_sap = #{workorderCodeSap},</if>-->
<if test="productName != null">product_name = #{productName},</if> <!-- <if test="productName != null">product_name = #{productName},</if>-->
<if test="productCode != null">product_code = #{productCode},</if> <!-- <if test="productCode != null">product_code = #{productCode},</if>-->
<if test="userName != null and userName != ''">user_name = #{userName},</if> <!-- <if test="userName != null and userName != ''">user_name = #{userName},</if>-->
<if test="nickName != null and nickName != ''">nick_name = #{nickName},</if> <!-- <if test="nickName != null and nickName != ''">nick_name = #{nickName},</if>-->
<if test="childprocessCode != null">childprocess_code = #{childprocessCode},</if> <!-- <if test="childprocessCode != null">childprocess_code = #{childprocessCode},</if>-->
<if test="childprocessName != null">childprocess_name = #{childprocessName},</if> <!-- <if test="childprocessName != null">childprocess_name = #{childprocessName},</if>-->
<if test="attr1 != null">attr1 = #{attr1},</if> <if test="attr1 != null">attr1 = #{attr1},</if>
<if test="attr2 != null">attr2 = #{attr2},</if> <!-- <if test="attr2 != null">attr2 = #{attr2},</if>-->
<if test="attr3 != null">attr3 = #{attr3},</if> <!-- <if test="attr3 != null">attr3 = #{attr3},</if>-->
<if test="createBy != null">create_by = #{createBy},</if> <!-- <if test="createBy != null">create_by = #{createBy},</if>-->
<if test="createTime != null">create_time = #{createTime},</if> <!-- <if test="createTime != null">create_time = #{createTime},</if>-->
<if test="updateBy != null">update_by = #{updateBy},</if> <!-- <if test="updateBy != null">update_by = #{updateBy},</if>-->
<if test="updateTime != null">update_time = #{updateTime},</if> <!-- <if test="updateTime != null">update_time = #{updateTime},</if>-->
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
</trim> </trim>
where id = #{id} where id = #{id}

@ -12,6 +12,8 @@ import javax.servlet.http.HttpServletResponse;
import com.op.system.domain.SysMenu; import com.op.system.domain.SysMenu;
import com.op.system.mapper.SysMenuMapper; import com.op.system.mapper.SysMenuMapper;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;

@ -154,6 +154,15 @@ public class OdsProcureOutOrder extends BaseEntity {
*/ */
@Excel(name = "用户自定义属性2") @Excel(name = "用户自定义属性2")
private String userDefined2; private String userDefined2;
private String workorderCode;
public String getWorkorderCode() {
return workorderCode;
}
public void setWorkorderCode(String workorderCode) {
this.workorderCode = workorderCode;
}
/** /**
* 3 * 3

@ -82,4 +82,6 @@ public interface OdsProcureOutOrderMapper {
List<String> selectOdsProcureOutOrderListZUKEN(OdsProcureOutOrder order); List<String> selectOdsProcureOutOrderListZUKEN(OdsProcureOutOrder order);
List<String> selectOdsProcureOutOrderListZUKENX(OdsProcureOutOrder order); List<String> selectOdsProcureOutOrderListZUKENX(OdsProcureOutOrder order);
String selectMachineCode(@Param("order")OdsProcureOutOrder odsProcureOutOrder);
} }

@ -284,14 +284,15 @@ public class OdsProcureOrderServiceImpl implements IOdsProcureOrderService {
public OdsProcureOutOrder PurchaseOrderOutboundPda(OdsProcureOutOrder odsProcureOrder) { public OdsProcureOutOrder PurchaseOrderOutboundPda(OdsProcureOutOrder odsProcureOrder) {
//母单其中list里面是对应的子单 //母单其中list里面是对应的子单
OdsProcureOutOrder odsProcureOutOrder = odsProcureOutOrderMapper.selectmesPrepare(odsProcureOrder); OdsProcureOutOrder odsProcureOutOrder = odsProcureOutOrderMapper.selectmesPrepare(odsProcureOrder);
String machine= odsProcureOutOrderMapper.selectMachineCode(odsProcureOutOrder);
if (odsProcureOutOrder != null) { if (odsProcureOutOrder != null) {
List<OdsProcureOutOrder> orderList = odsProcureOutOrderMapper.selectmesPrepareDetail(odsProcureOutOrder); List<OdsProcureOutOrder> orderList = odsProcureOutOrderMapper.selectmesPrepareDetail(odsProcureOutOrder);
for (OdsProcureOutOrder order:orderList){
order.setProductionLineCode(machine);
}
odsProcureOutOrder.setList(orderList); odsProcureOutOrder.setList(orderList);
} }
return odsProcureOutOrder; return odsProcureOutOrder;
} }
@Override @Override

@ -39,6 +39,7 @@
<result property="Active" column="Active"/> <result property="Active" column="Active"/>
<result property="enterpriseId" column="Enterprise_Id"/> <result property="enterpriseId" column="Enterprise_Id"/>
<result property="enterpriseCode" column="Enterprise_Code"/> <result property="enterpriseCode" column="Enterprise_Code"/>
<result property="workorderCode" column="workorderCode"/>
</resultMap> </resultMap>
<sql id="pagination_tail"> <sql id="pagination_tail">
limit #{page.pageOffset} , #{page.rows} limit #{page.pageOffset} , #{page.rows}
@ -49,7 +50,8 @@
<select id="selectOdsProcureOutOrderListZU" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult"> <select id="selectOdsProcureOutOrderListZU" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
SELECT SELECT
Produce_Code, Produce_Code,
User_Defined1 User_Defined1,
MAX(Create_Date) AS Create_Date
FROM FROM
ods_procure_out_order ods_procure_out_order
where where
@ -58,6 +60,8 @@
</if> </if>
<if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if> <if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if>
GROUP BY Produce_Code,User_Defined1 GROUP BY Produce_Code,User_Defined1
ORDER BY
Create_Date DESC;
</select> </select>
<select id="selectOdsProcureOutOrderListZUKEN" resultType="java.lang.String"> <select id="selectOdsProcureOutOrderListZUKEN" resultType="java.lang.String">
SELECT DISTINCT SELECT DISTINCT
@ -81,13 +85,10 @@
<if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if> <if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if>
AND User_Defined3 ='x' AND User_Defined3 ='x'
</select> </select>
<select id="selectOdsProcureOutOrderListZUT" parameterType="OdsProcureOutOrder" <select id="selectOdsProcureOutOrderListZUT" parameterType="OdsProcureOutOrder" resultMap="OdsProcureOutOrderResult">
resultMap="OdsProcureOutOrderResult">
<include refid="selectOdsProcureOutOrderVo"/> <include refid="selectOdsProcureOutOrderVo"/>
<where> <where>
<if test="produceCode != null and produceCode != ''">and Produce_Code like concat('%', #{produceCode}, <if test="produceCode != null and produceCode != ''"> and Produce_Code like concat('%', #{produceCode}, '%')</if>
'%')
</if>
<if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if> <if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if>
<if test="Active != null and Active != ''"> and Active = #{Active}</if> <if test="Active != null and Active != ''"> and Active = #{Active}</if>
</where> </where>
@ -105,12 +106,8 @@
<if test="outNumber != null "> and Out_Number = #{outNumber}</if> <if test="outNumber != null "> and Out_Number = #{outNumber}</if>
<if test="locCode != null and locCode != ''"> and Loc_Code = #{locCode}</if> <if test="locCode != null and locCode != ''"> and Loc_Code = #{locCode}</if>
<if test="locDesc != null and locDesc != ''"> and Loc_Desc = #{locDesc}</if> <if test="locDesc != null and locDesc != ''"> and Loc_Desc = #{locDesc}</if>
<if test="productionLineDesc != null and productionLineDesc != ''">and Production_Line_Desc = <if test="productionLineDesc != null and productionLineDesc != ''"> and Production_Line_Desc = #{productionLineDesc}</if>
#{productionLineDesc} <if test="productionLineCode != null and productionLineCode != ''"> and Production_Line_Code = #{productionLineCode}</if>
</if>
<if test="productionLineCode != null and productionLineCode != ''">and Production_Line_Code =
#{productionLineCode}
</if>
<if test="orderStatus != null and orderStatus != ''"> and Order_Status = #{orderStatus}</if> <if test="orderStatus != null and orderStatus != ''"> and Order_Status = #{orderStatus}</if>
<if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if> <if test="userDefined1 != null and userDefined1 != ''"> and User_Defined1 = #{userDefined1}</if>
<if test="userDefined2 != null and userDefined2 != ''"> and User_Defined2 = #{userDefined2}</if> <if test="userDefined2 != null and userDefined2 != ''"> and User_Defined2 = #{userDefined2}</if>
@ -124,9 +121,7 @@
<if test="userDefined10 != null and userDefined10 != ''"> and User_Defined10 = #{userDefined10}</if> <if test="userDefined10 != null and userDefined10 != ''"> and User_Defined10 = #{userDefined10}</if>
<if test="userDefined11 != null and userDefined11 != ''"> and User_Defined11 = #{userDefined11}</if> <if test="userDefined11 != null and userDefined11 != ''"> and User_Defined11 = #{userDefined11}</if>
<if test="supplierCode != null and supplierCode != ''"> and Supplier_Code = #{supplierCode}</if> <if test="supplierCode != null and supplierCode != ''"> and Supplier_Code = #{supplierCode}</if>
<if test="supplierName != null and supplierName != ''">and Supplier_Name like concat('%', #{supplierName}, <if test="supplierName != null and supplierName != ''"> and Supplier_Name like concat('%', #{supplierName}, '%')</if>
'%')
</if>
<if test="createBy != null and createBy != ''"> and Create_By = #{createBy}</if> <if test="createBy != null and createBy != ''"> and Create_By = #{createBy}</if>
<if test="createDate != null "> and Create_Date = #{createDate}</if> <if test="createDate != null "> and Create_Date = #{createDate}</if>
<if test="lastUpdateBy != null and lastUpdateBy != ''"> and Last_Update_By = #{lastUpdateBy}</if> <if test="lastUpdateBy != null and lastUpdateBy != ''"> and Last_Update_By = #{lastUpdateBy}</if>
@ -272,6 +267,7 @@
SELECT SELECT
prepare_id id, prepare_id id,
workorder_name Produce_Code, workorder_name Produce_Code,
workorder_code workorderCode,
product_code Material_Code, product_code Material_Code,
product_name Material_Desc, product_name Material_Desc,
unit Unit, unit Unit,
@ -405,4 +401,10 @@
#{item.userDefined1} #{item.userDefined1}
</foreach> </foreach>
</select> </select>
<select id="selectMachineCode" resultType="java.lang.String">
SELECT
machine_code
FROM mes_report_work
WHERE workorder_code=#{order.workorderCode} AND end_report='1'
</select>
</mapper> </mapper>

Loading…
Cancel
Save