生产订单管理模块(拆分状态逻辑优化)

highway
wws 1 year ago
parent cca119c843
commit 84787548e4

@ -2,12 +2,10 @@ package com.op.mes.mapper;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.op.mes.domain.Convert;
import com.op.mes.domain.ProLine;
import com.op.mes.domain.ProOrder;
import com.op.mes.domain.ProShift;
import org.apache.ibatis.annotations.Select;
/**
* Mapper
@ -78,7 +76,6 @@ public interface ProOrderMapper {
*
* @return
*/
@Select(" SELECT equipment_id AS 'key', equipment_name AS 'label' FROM base_equipment WHERE equipment_type_code = 'equ_type_cxj' ")
public List<ProLine> selectProdLine();
/**
@ -86,7 +83,6 @@ public interface ProOrderMapper {
*
* @return
*/
@Select("SELECT bst.Shift_Id shiftId,bst.Shift_Desc_Global shiftDesc FROM base_shifts_t bst")
public List<ProShift> selectProShift();
/**
@ -101,7 +97,6 @@ public interface ProOrderMapper {
*
* @return
*/
@Select("SELECT equipment_name AS 'prodLineName' FROM base_equipment WHERE equipment_id = #{prodLineCode}")
String selectProdLineName(String prodLineCode);
/**
@ -109,7 +104,6 @@ public interface ProOrderMapper {
*
* @return
*/
@Select("SELECT batch_code FROM pro_order_workorder_batch WHERE status = '1' GROUP BY batch_code")
List<String> selectBatchCodes();
@ -127,7 +121,6 @@ public interface ProOrderMapper {
* @param prodLineCode
* @return
*/
@Select("SELECT sf.factory_name FROM sys_factory sf WHERE sf.f_code = #{prodLineCode}")
String selectBatchNameByCode(String prodLineCode);
/**
@ -136,7 +129,6 @@ public interface ProOrderMapper {
* @param workorderId
* @return
*/
@Select("SELECT powb.batch_code FROM pro_order_workorder_batch powb LEFT JOIN pro_order_workorder pow ON powb.workorder_id = pow.workorder_id WHERE pow.workorder_id = #{workorderId}")
List<String> selectBatchCodesById(String workorderId);
/**
@ -144,6 +136,5 @@ public interface ProOrderMapper {
*
* @return
*/
@Select(" SELECT equipment_id AS 'key', equipment_name AS 'label' FROM base_equipment WHERE equipment_type_code = 'equ_type_bzx' ")
public List<ProLine> selectPackageLine();
}

@ -1,8 +1,6 @@
package com.op.mes.mapper;
import com.op.mes.domain.Batch;
import com.op.mes.domain.ProOrderWorkorderBatch;
import org.apache.ibatis.annotations.Select;
import java.util.List;

@ -1,7 +1,6 @@
package com.op.mes.mapper;
import com.op.mes.domain.ProOrderWorkorder;
import org.apache.ibatis.annotations.Select;
import java.util.Date;
import java.util.List;
@ -91,6 +90,5 @@ public interface ProOrderWorkorderMapper {
* @param id
* @return
*/
@Select("select TOP 1 workorder_code FROM pro_order_workorder WHERE order_id = #{id} ORDER BY workorder_code DESC")
String selectEndWorkOrder(String id);
}

@ -1,126 +0,0 @@
package com.op.mes.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.op.system.api.domain.SysUser;
/**
*
*
* @author OP
*/
public interface SysUserMapper {
/**
*
*
* @param sysUser
* @return
*/
public List<SysUser> selectUserList(SysUser sysUser);
/**
*
*
* @param user
* @return
*/
public List<SysUser> selectAllocatedList(SysUser user);
/**
*
*
* @param user
* @return
*/
public List<SysUser> selectUnallocatedList(SysUser user);
/**
*
*
* @param userName
* @return
*/
public SysUser selectUserByUserName(String userName);
/**
* ID
*
* @param userId ID
* @return
*/
public SysUser selectUserById(Long userId);
/**
*
*
* @param user
* @return
*/
public int insertUser(SysUser user);
/**
*
*
* @param user
* @return
*/
public int updateUser(SysUser user);
/**
*
*
* @param userName
* @param avatar
* @return
*/
public int updateUserAvatar(@Param("userName") String userName, @Param("avatar") String avatar);
/**
*
*
* @param userName
* @param password
* @return
*/
public int resetUserPwd(@Param("userName") String userName, @Param("password") String password);
/**
* ID
*
* @param userId ID
* @return
*/
public int deleteUserById(Long userId);
/**
*
*
* @param userIds ID
* @return
*/
public int deleteUserByIds(Long[] userIds);
/**
*
*
* @param userName
* @return
*/
public SysUser checkUserNameUnique(String userName);
/**
*
*
* @param phonenumber
* @return
*/
public SysUser checkPhoneUnique(String phonenumber);
/**
* email
*
* @param email
* @return
*/
public SysUser checkEmailUnique(String email);
}

@ -360,7 +360,7 @@ public class ProOrderServiceImpl implements IProOrderService {
}
/**
*
*
*
* @param proOrderWorkorder
* @param proOrder
@ -373,7 +373,13 @@ public class ProOrderServiceImpl implements IProOrderService {
proOrder.setUpdateBy(SecurityContextHolder.getUserName());
proOrder.setUpdateTime(date);
// 设置订单状态
proOrder.setStatus("o1");
if (proOrder.getQuantitySplit() == null && proOrder.getQuantity() == Long.valueOf(proOrder.getAtrr1())){
proOrder.setStatus("o1");
}else if (proOrder.getQuantitySplit() != null && (proOrder.getQuantitySplit()+Long.valueOf(proOrder.getAtrr1()) == proOrder.getQuantity())){
proOrder.setStatus("o1");
}else {
proOrder.setStatus("o0");
}
// 更新订单表
proOrderMapper.updateOrder(proOrder);
// 生成对应的工单表

@ -78,6 +78,49 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where parent_order = #{orderCode}
</select>
<select id="selectProdLine" resultType="com.op.mes.domain.ProLine">
SELECT equipment_id AS 'key', equipment_name AS 'label'
FROM base_equipment
WHERE equipment_type_code = 'equ_type_cxj'
</select>
<select id="selectProShift" resultType="com.op.mes.domain.ProShift">
SELECT bst.Shift_Id shiftId,bst.Shift_Desc_Global shiftDesc
FROM base_shifts_t bst
</select>
<select id="selectProdLineName" resultType="java.lang.String">
SELECT equipment_name AS 'prodLineName'
FROM base_equipment
WHERE equipment_id = #{prodLineCode}
</select>
<select id="selectBatchCodes" resultType="java.lang.String">
SELECT batch_code
FROM pro_order_workorder_batch
WHERE status = '1'
GROUP BY batch_code
</select>
<select id="selectBatchNameByCode" resultType="java.lang.String">
SELECT sf.factory_name
FROM sys_factory sf
WHERE sf.f_code = #{prodLineCode}
</select>
<select id="selectBatchCodesById" resultType="java.lang.String">
SELECT powb.batch_code
FROM pro_order_workorder_batch powb LEFT JOIN pro_order_workorder pow
ON powb.workorder_id = pow.workorder_id
WHERE pow.workorder_id = #{workorderId}
</select>
<select id="selectPackageLine" resultType="com.op.mes.domain.ProLine">
SELECT equipment_id AS 'key', equipment_name AS 'label'
FROM base_equipment
WHERE equipment_type_code = 'equ_type_bzx'
</select>
<insert id="insertProOrder" parameterType="ProOrder">
insert into pro_order
<trim prefix="(" suffix=")" suffixOverrides=",">

@ -94,6 +94,13 @@
)
</select>
<select id="selectEndWorkOrder" resultType="java.lang.String">
select TOP 1 workorder_code
FROM pro_order_workorder
WHERE order_id = #{id}
ORDER BY workorder_code DESC
</select>
<insert id="insertProOrderWorkorder" parameterType="ProOrderWorkorder">
insert into pro_order_workorder
<trim prefix="(" suffix=")" suffixOverrides=",">

Loading…
Cancel
Save