生产订单管理模块(优化)、湿料计划管理init
parent
cf38b80dc7
commit
2238046740
@ -0,0 +1,47 @@
|
||||
package com.op.mes.domain;
|
||||
|
||||
// 料罐实体类
|
||||
public class Bucket {
|
||||
// 料罐id
|
||||
private Integer bucketId;
|
||||
// 料罐编码
|
||||
private String bucketCode;
|
||||
// 料罐名称
|
||||
private String bucketName;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Bucket{" +
|
||||
"bucketId=" + bucketId +
|
||||
", bucketCode='" + bucketCode + '\'' +
|
||||
", bucketName='" + bucketName + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public Integer getBucketId() {
|
||||
return bucketId;
|
||||
}
|
||||
|
||||
public void setBucketId(Integer bucketId) {
|
||||
this.bucketId = bucketId;
|
||||
}
|
||||
|
||||
public String getBucketCode() {
|
||||
return bucketCode;
|
||||
}
|
||||
|
||||
public void setBucketCode(String bucketCode) {
|
||||
this.bucketCode = bucketCode;
|
||||
}
|
||||
|
||||
public String getBucketName() {
|
||||
return bucketName;
|
||||
}
|
||||
|
||||
public void setBucketName(String bucketName) {
|
||||
this.bucketName = bucketName;
|
||||
}
|
||||
|
||||
public Bucket() {
|
||||
}
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
package com.op.mes.mapper;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.op.mes.domain.Bucket;
|
||||
import com.op.mes.domain.ProWetMaterialPlan;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
/**
|
||||
* 湿料计划管理Mapper接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-07-24
|
||||
*/
|
||||
public interface ProWetMaterialPlanMapper {
|
||||
/**
|
||||
* 查询湿料计划管理
|
||||
*
|
||||
* @param id 湿料计划管理主键
|
||||
* @return 湿料计划管理
|
||||
*/
|
||||
public ProWetMaterialPlan selectProWetMaterialPlanById(String id);
|
||||
|
||||
/**
|
||||
* 查询湿料计划管理列表
|
||||
*
|
||||
* @param proWetMaterialPlan 湿料计划管理
|
||||
* @return 湿料计划管理集合
|
||||
*/
|
||||
public List<ProWetMaterialPlan> selectProWetMaterialPlanList(ProWetMaterialPlan proWetMaterialPlan);
|
||||
|
||||
/**
|
||||
* 新增湿料计划管理
|
||||
*
|
||||
* @param proWetMaterialPlan 湿料计划管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProWetMaterialPlan(ProWetMaterialPlan proWetMaterialPlan);
|
||||
|
||||
/**
|
||||
* 修改湿料计划管理
|
||||
*
|
||||
* @param proWetMaterialPlan 湿料计划管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProWetMaterialPlan(ProWetMaterialPlan proWetMaterialPlan);
|
||||
|
||||
/**
|
||||
* 删除湿料计划管理
|
||||
*
|
||||
* @param id 湿料计划管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProWetMaterialPlanById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除湿料计划管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProWetMaterialPlanByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 根据时间范围查询范围内的计划列表
|
||||
*
|
||||
* @param startTime
|
||||
* @param endTime
|
||||
* @return
|
||||
*/
|
||||
List<ProWetMaterialPlan> selectProWetMaterialPlanListByTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime);
|
||||
|
||||
/**
|
||||
* 通过班次id查询班次名称
|
||||
*
|
||||
* @param shiftId
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT bst.Shift_Desc_Global shiftName FROM base_shifts_t bst WHERE bst.Shift_Id = #{shiftId}")
|
||||
String selectShiftById(String shiftId);
|
||||
|
||||
/**
|
||||
* 查询料罐list
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT equipment_id AS 'bucketId',equipment_code AS 'bucketCode',equipment_name AS 'bucketName' FROM base_equipment WHERE equipment_type_code = 'equ_type_lg'")
|
||||
List<Bucket> selectBucketList();
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
package com.op.mes.service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.mes.domain.ProWetMaterialPlan;
|
||||
|
||||
/**
|
||||
* 湿料计划管理Service接口
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-07-24
|
||||
*/
|
||||
public interface IProWetMaterialPlanService {
|
||||
/**
|
||||
* 查询湿料计划管理
|
||||
*
|
||||
* @param id 湿料计划管理主键
|
||||
* @return 湿料计划管理
|
||||
*/
|
||||
public ProWetMaterialPlan selectProWetMaterialPlanById(String id);
|
||||
|
||||
/**
|
||||
* 查询湿料计划管理列表
|
||||
*
|
||||
* @param proWetMaterialPlan 湿料计划管理
|
||||
* @return 湿料计划管理集合
|
||||
*/
|
||||
public List<ProWetMaterialPlan> selectProWetMaterialPlanList(ProWetMaterialPlan proWetMaterialPlan);
|
||||
|
||||
/**
|
||||
* 新增湿料计划管理
|
||||
*
|
||||
* @param proWetMaterialPlan 湿料计划管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertProWetMaterialPlan(ProWetMaterialPlan proWetMaterialPlan);
|
||||
|
||||
/**
|
||||
* 修改湿料计划管理
|
||||
*
|
||||
* @param proWetMaterialPlan 湿料计划管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateProWetMaterialPlan(ProWetMaterialPlan proWetMaterialPlan);
|
||||
|
||||
/**
|
||||
* 批量删除湿料计划管理
|
||||
*
|
||||
* @param ids 需要删除的湿料计划管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProWetMaterialPlanByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除湿料计划管理信息
|
||||
*
|
||||
* @param id 湿料计划管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteProWetMaterialPlanById(String id);
|
||||
|
||||
/**
|
||||
* 通过工单生产日期查询所有子工单
|
||||
*
|
||||
* @param productDate
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getWorkOrderByTime(Date productDate);
|
||||
|
||||
/**
|
||||
* 查询料罐list
|
||||
* @return
|
||||
*/
|
||||
AjaxResult getBucketList();
|
||||
}
|
@ -0,0 +1,136 @@
|
||||
package com.op.mes.service.impl;
|
||||
|
||||
import java.util.Date;
|
||||
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.ProOrderWorkorder;
|
||||
import com.op.mes.mapper.ProOrderWorkorderMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.op.mes.mapper.ProWetMaterialPlanMapper;
|
||||
import com.op.mes.domain.ProWetMaterialPlan;
|
||||
import com.op.mes.service.IProWetMaterialPlanService;
|
||||
|
||||
import static com.op.common.core.web.domain.AjaxResult.success;
|
||||
|
||||
/**
|
||||
* 湿料计划管理Service业务层处理
|
||||
*
|
||||
* @author Open Platform
|
||||
* @date 2023-07-24
|
||||
*/
|
||||
@Service
|
||||
public class ProWetMaterialPlanServiceImpl implements IProWetMaterialPlanService {
|
||||
@Autowired
|
||||
private ProWetMaterialPlanMapper proWetMaterialPlanMapper;
|
||||
@Autowired
|
||||
private ProOrderWorkorderMapper proOrderWorkorderMapper;
|
||||
|
||||
/**
|
||||
* 查询湿料计划管理
|
||||
*
|
||||
* @param id 湿料计划管理主键
|
||||
* @return 湿料计划管理
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public ProWetMaterialPlan selectProWetMaterialPlanById(String id) {
|
||||
return proWetMaterialPlanMapper.selectProWetMaterialPlanById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询湿料计划管理列表
|
||||
*
|
||||
* @param proWetMaterialPlan 湿料计划管理
|
||||
* @return 湿料计划管理
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<ProWetMaterialPlan> selectProWetMaterialPlanList(ProWetMaterialPlan proWetMaterialPlan) {
|
||||
if (proWetMaterialPlan.getStartTime() != null && proWetMaterialPlan.getEndTime() != null) {
|
||||
return proWetMaterialPlanMapper.selectProWetMaterialPlanListByTime(proWetMaterialPlan.getStartTime(), proWetMaterialPlan.getEndTime());
|
||||
}
|
||||
return proWetMaterialPlanMapper.selectProWetMaterialPlanList(proWetMaterialPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增湿料计划管理
|
||||
*
|
||||
* @param proWetMaterialPlan 湿料计划管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int insertProWetMaterialPlan(ProWetMaterialPlan proWetMaterialPlan) {
|
||||
proWetMaterialPlan.setCreateTime(DateUtils.getNowDate());
|
||||
return proWetMaterialPlanMapper.insertProWetMaterialPlan(proWetMaterialPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改湿料计划管理
|
||||
*
|
||||
* @param proWetMaterialPlan 湿料计划管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int updateProWetMaterialPlan(ProWetMaterialPlan proWetMaterialPlan) {
|
||||
proWetMaterialPlan.setUpdateTime(DateUtils.getNowDate());
|
||||
return proWetMaterialPlanMapper.updateProWetMaterialPlan(proWetMaterialPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除湿料计划管理
|
||||
*
|
||||
* @param ids 需要删除的湿料计划管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteProWetMaterialPlanByIds(String[] ids) {
|
||||
return proWetMaterialPlanMapper.deleteProWetMaterialPlanByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除湿料计划管理信息
|
||||
*
|
||||
* @param id 湿料计划管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteProWetMaterialPlanById(String id) {
|
||||
return proWetMaterialPlanMapper.deleteProWetMaterialPlanById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过工单生产日期查询所有子工单
|
||||
*
|
||||
* @param productDate
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public AjaxResult getWorkOrderByTime(Date productDate) {
|
||||
List<ProOrderWorkorder> workorderList = proOrderWorkorderMapper.selectWorkOrderByTime(productDate);
|
||||
// 循环遍历
|
||||
for (int i = 0; i < workorderList.size(); i++){
|
||||
// 通过班次id获取班次名称
|
||||
workorderList.get(i).setShiftDesc(proWetMaterialPlanMapper.selectShiftById(workorderList.get(i).getShiftId()));
|
||||
}
|
||||
return success(workorderList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询料罐list
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public AjaxResult getBucketList() {
|
||||
return success(proWetMaterialPlanMapper.selectBucketList());
|
||||
}
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.op.mes.mapper.ProWetMaterialPlanMapper">
|
||||
|
||||
<resultMap type="ProWetMaterialPlan" id="ProWetMaterialPlanResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="factoryCode" column="factory_code" />
|
||||
<result property="planTime" column="plan_time" />
|
||||
<result property="syncFlag" column="sync_flag" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="orderType" column="order_type" />
|
||||
<result property="prodCode" column="prod_code" />
|
||||
<result property="prodDesc" column="prod_desc" />
|
||||
<result property="prodSource" column="prod_source" />
|
||||
<result property="quantity" column="quantity" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="atrr1" column="atrr1" />
|
||||
<result property="atrr2" column="atrr2" />
|
||||
<result property="atrr3" column="atrr3" />
|
||||
<result property="status" column="status" />
|
||||
<result property="prodType" column="prod_type" />
|
||||
<result property="planCode" column="plan_code" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProWetMaterialPlanVo">
|
||||
select id, factory_code, plan_time, sync_flag, create_by, create_time, update_by, update_time, order_type, prod_code, prod_desc, prod_source, quantity, unit, atrr1, atrr2, atrr3, status, prod_type, plan_code from pro_wet_material_plan
|
||||
</sql>
|
||||
|
||||
<select id="selectProWetMaterialPlanList" parameterType="ProWetMaterialPlan" resultMap="ProWetMaterialPlanResult">
|
||||
<include refid="selectProWetMaterialPlanVo"/>
|
||||
<where>
|
||||
<if test="syncFlag != null and syncFlag != ''"> and sync_flag = #{syncFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectProWetMaterialPlanById" parameterType="String" resultMap="ProWetMaterialPlanResult">
|
||||
<include refid="selectProWetMaterialPlanVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
<select id="selectProWetMaterialPlanListByTime" parameterType="ProWetMaterialPlan" resultMap="ProWetMaterialPlanResult">
|
||||
<include refid="selectProWetMaterialPlanVo"/>
|
||||
WHERE CONVERT(date, plan_time) BETWEEN #{startTime} AND #{endTime}
|
||||
ORDER BY CONVERT(date, plan_time) DESC , sync_flag
|
||||
</select>
|
||||
|
||||
<insert id="insertProWetMaterialPlan" parameterType="ProWetMaterialPlan">
|
||||
insert into pro_wet_material_plan
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="factoryCode != null">factory_code,</if>
|
||||
<if test="planTime != null">plan_time,</if>
|
||||
<if test="syncFlag != null">sync_flag,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="orderType != null">order_type,</if>
|
||||
<if test="prodCode != null">prod_code,</if>
|
||||
<if test="prodDesc != null">prod_desc,</if>
|
||||
<if test="prodSource != null">prod_source,</if>
|
||||
<if test="quantity != null">quantity,</if>
|
||||
<if test="unit != null">unit,</if>
|
||||
<if test="atrr1 != null">atrr1,</if>
|
||||
<if test="atrr2 != null">atrr2,</if>
|
||||
<if test="atrr3 != null">atrr3,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="prodType != null">prod_type,</if>
|
||||
<if test="planCode != null">plan_code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="factoryCode != null">#{factoryCode},</if>
|
||||
<if test="planTime != null">#{planTime},</if>
|
||||
<if test="syncFlag != null">#{syncFlag},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="orderType != null">#{orderType},</if>
|
||||
<if test="prodCode != null">#{prodCode},</if>
|
||||
<if test="prodDesc != null">#{prodDesc},</if>
|
||||
<if test="prodSource != null">#{prodSource},</if>
|
||||
<if test="quantity != null">#{quantity},</if>
|
||||
<if test="unit != null">#{unit},</if>
|
||||
<if test="atrr1 != null">#{atrr1},</if>
|
||||
<if test="atrr2 != null">#{atrr2},</if>
|
||||
<if test="atrr3 != null">#{atrr3},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="prodType != null">#{prodType},</if>
|
||||
<if test="planCode != null">#{planCode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateProWetMaterialPlan" parameterType="ProWetMaterialPlan">
|
||||
update pro_wet_material_plan
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
||||
<if test="planTime != null">plan_time = #{planTime},</if>
|
||||
<if test="syncFlag != null">sync_flag = #{syncFlag},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="orderType != null">order_type = #{orderType},</if>
|
||||
<if test="prodCode != null">prod_code = #{prodCode},</if>
|
||||
<if test="prodDesc != null">prod_desc = #{prodDesc},</if>
|
||||
<if test="prodSource != null">prod_source = #{prodSource},</if>
|
||||
<if test="quantity != null">quantity = #{quantity},</if>
|
||||
<if test="unit != null">unit = #{unit},</if>
|
||||
<if test="atrr1 != null">atrr1 = #{atrr1},</if>
|
||||
<if test="atrr2 != null">atrr2 = #{atrr2},</if>
|
||||
<if test="atrr3 != null">atrr3 = #{atrr3},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="prodType != null">prod_type = #{prodType},</if>
|
||||
<if test="planCode != null">plan_code = #{planCode},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteProWetMaterialPlanById" parameterType="String">
|
||||
delete from pro_wet_material_plan where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteProWetMaterialPlanByIds" parameterType="String">
|
||||
delete from pro_wet_material_plan where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue