计划模块(工艺线体逻辑变更,工单修改判断逻辑变更)

highway
wws 1 year ago
parent c25d6e258d
commit 0524c17e13

@ -9,6 +9,9 @@ import javax.servlet.http.HttpServletResponse;
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.op.common.core.domain.R;
import com.op.common.core.utils.DateUtils;
import com.op.plan.domain.ProLine;
import com.op.plan.domain.ProRoute;
import com.op.plan.domain.ProShift;
import com.op.plan.domain.dto.SplitOrderDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
@ -138,13 +141,33 @@ public class ProOrderController extends BaseController {
}
/**
*
* code
* @param prodCode
* @return
*/
@GetMapping(value = "/getProRoutes/{prodCode}")
public AjaxResult getProRoutes(@PathVariable("prodCode") String prodCode) {
return success(proOrderService.getProRoutes(prodCode));
}
/**
* list
*
* @return
*/
@GetMapping("/getProdLineShift")
public AjaxResult getProdLineShift(String type) {
return success(proOrderService.getProdLineShift(type));
@GetMapping("/getProShifts")
public AjaxResult getProShifts() {
return success(proOrderService.getProShifts());
}
/**
* list
* @param routeCode
* @return
*/
@GetMapping(value = "/getProEquipment/{routeCode}")
public AjaxResult getProEquipment(@PathVariable("routeCode") String routeCode) {
return success(proOrderService.getProEquipment(routeCode));
}
/**
@ -223,6 +246,7 @@ public class ProOrderController extends BaseController {
/**
* SAP
*
* @param
* @return
*/
@ -231,6 +255,7 @@ public class ProOrderController extends BaseController {
public AjaxResult syncSAP() {
return proOrderService.syncSAP();
}
@Log(title = "自动同步SAP订单", businessType = BusinessType.INSERT)
@PostMapping("/syncSAPOrders")
public R syncSAPOrders() {

@ -55,7 +55,6 @@ public class ProOrderWorkorderController extends BaseController {
/**
*
* 湿
*
* @return
*/

@ -1,59 +0,0 @@
package com.op.plan.domain.vo;
import com.op.plan.domain.ProLine;
import com.op.plan.domain.ProRoute;
import com.op.plan.domain.ProShift;
import java.util.List;
// 返回工艺、成型机、班次VO
public class LineAndShiftVo {
// 成型机
private List<ProLine> lines;
// 班次
private List<ProShift> shifts;
// 工艺
private List<ProRoute> routes;
public LineAndShiftVo(List<ProLine> lines, List<ProShift> shifts, List<ProRoute> routes) {
this.lines = lines;
this.shifts = shifts;
this.routes = routes;
}
public List<ProLine> getLines() {
return lines;
}
public void setLines(List<ProLine> lines) {
this.lines = lines;
}
public List<ProShift> getShifts() {
return shifts;
}
public void setShifts(List<ProShift> shifts) {
this.shifts = shifts;
}
public List<ProRoute> getRoutes() {
return routes;
}
public void setRoutes(List<ProRoute> routes) {
this.routes = routes;
}
@Override
public String toString() {
return "LineAndShiftVo{" +
"lines=" + lines +
", shifts=" + shifts +
", routes=" + routes +
'}';
}
public LineAndShiftVo() {
}
}

@ -76,13 +76,6 @@ public interface ProOrderMapper {
*/
public int deleteProOrderByIds(String[] ids);
/**
*
*
* @return
*/
public List<ProLine> selectProdLine();
/**
*
*
@ -175,4 +168,18 @@ public interface ProOrderMapper {
* @return
*/
public String selectChildProOrderCodeByCode(String orderCode);
/**
* codes
* @param routeCode
* @return
*/
String selectEquipmentListByRouteCode(String routeCode);
/**
* codelist
* @param codes
* @return
*/
List<ProLine> selectEquipment(String[] codes);
}

@ -14,10 +14,11 @@ import java.util.List;
*/
@Mapper
public interface ProRouteMapper {
/**
* list
*
* codelist
* @param itemCode
* @return
*/
List<ProRoute> selectAllRoute();
List<ProRoute> selectRouteByItemCode(String itemCode);
}

@ -1,6 +1,7 @@
package com.op.plan.mapper;
import com.op.plan.domain.ProOrderWorkorder;
import com.op.plan.domain.ProWetMaterialPlan;
import com.op.plan.domain.ProWetMaterialPlanDetail;
import org.apache.ibatis.annotations.Mapper;
@ -95,4 +96,10 @@ public interface ProWetMaterialPlanDetailMapper {
List<ProWetMaterialPlanDetail> selectWetPlanList(ProWetMaterialPlan proWetMaterialPlan);
ProWetMaterialPlanDetail getWetInfo(String workorderId);
/**
* id湿
* @param workorderId
*/
void deleteProWetMaterialPlanDetailByWorkId(String workorderId);
}

@ -4,10 +4,8 @@ import java.util.List;
import com.op.common.core.domain.R;
import com.op.common.core.web.domain.AjaxResult;
import com.op.plan.domain.Convert;
import com.op.plan.domain.ProOrder;
import com.op.plan.domain.*;
import com.op.plan.domain.dto.SplitOrderDTO;
import com.op.plan.domain.vo.LineAndShiftVo;
/**
* Service
@ -17,13 +15,6 @@ import com.op.plan.domain.vo.LineAndShiftVo;
*/
public interface IProOrderService {
/**
*
*
* @return
*/
public LineAndShiftVo getProdLineShift(String type);
/**
*
*
@ -122,4 +113,24 @@ public interface IProOrderService {
AjaxResult importOrder(List<ProOrder> orderList);
R syncSAPOrders();
/**
* list
* @return
*/
List<ProShift> getProShifts();
/**
* codelist
* @param prodCode
* @return
*/
List<ProRoute> getProRoutes(String prodCode);
/**
* list
* @param routeCode
* @return
*/
List<ProLine> getProEquipment(String routeCode);
}

@ -96,7 +96,6 @@ public interface IProOrderWorkorderService {
/**
*
* 湿
*
* @return
*/

@ -22,7 +22,6 @@ import com.op.common.security.utils.SecurityUtils;
import com.op.plan.domain.*;
import com.op.plan.domain.dto.ProOrderDTO;
import com.op.plan.domain.dto.SplitOrderDTO;
import com.op.plan.domain.vo.LineAndShiftVo;
import com.op.plan.mapper.*;
import com.op.system.api.RemoteSapService;
import com.op.system.api.RemoteUserService;
@ -482,6 +481,38 @@ public class ProOrderServiceImpl implements IProOrderService {
return R.ok(true);
}
/**
* list
* @return
*/
@Override
@DS("#header.poolName")
public List<ProShift> getProShifts() {
return proOrderMapper.selectProShift();
}
/**
* codelist
* @param prodCode
* @return
*/
@Override
@DS("#header.poolName")
public List<ProRoute> getProRoutes(String prodCode) {
return proRouteMapper.selectRouteByItemCode(prodCode);
}
/**
* list
* @param routeCode
* @return
*/
@Override
@DS("#header.poolName")
public List<ProLine> getProEquipment(String routeCode) {
return proOrderMapper.selectEquipment(proOrderMapper.selectEquipmentListByRouteCode(routeCode).split(","));
}
public void getSAPOrderByFactory(String poolName) {
DynamicDataSourceContextHolder.push(poolName);// 这是数据源的key
SapProOrder sapqo = new SapProOrder();//proOrderMapper.getMaxCreatetime();
@ -517,24 +548,6 @@ public class ProOrderServiceImpl implements IProOrderService {
}
}
/**
*
*
* @return
*/
@Override
@DS("#header.poolName")
public LineAndShiftVo getProdLineShift(String type) {
if (type.equals("white")) {
LineAndShiftVo lineAndShiftVo = new LineAndShiftVo(proOrderMapper.selectProdLine(),
proOrderMapper.selectProShift(), proRouteMapper.selectAllRoute());
return lineAndShiftVo;
}
LineAndShiftVo lineAndShiftVo = new LineAndShiftVo(proOrderMapper.selectPackageLine(),
proOrderMapper.selectProShift(), proRouteMapper.selectAllRoute());
return lineAndShiftVo;
}
/**
*
*

@ -450,6 +450,8 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
if (checkout){
// 删除所有工单s下的批次信息
int i = proOrderWorkorderBatchMapper.deleteProOrderWorkorderBatchByWorkorderIds(workorderIds);
// 删除湿料计划
proWetMaterialPlanDetailMapper.deleteProWetMaterialPlanDetailByWorkId(proWorkOrder.getWorkorderId());
// 创建订单信息并将信息copy进去
ProOrder proOrder = new ProOrder();
BeanUtils.copyProperties(splitOrderDTO.getProduct(),proOrder);
@ -537,9 +539,13 @@ public class ProOrderWorkorderServiceImpl implements IProOrderWorkorderService {
@Override
@DS("#header.poolName")
public AjaxResult checkWorkOrder(String id) {
ProWetMaterialPlanDetail proWetMaterialPlanDetail = proWetMaterialPlanDetailMapper.selectProWetMaterialPlanDetailByWorkId(id);
if (proWetMaterialPlanDetail != null){
return error(500,"工单已有湿料计划!不可修改!");
// 判断工单状态1.活动不可以2.已报工不可以
ProOrderWorkorder proOrderWorkorder = proOrderWorkorderMapper.selectProOrderWorkorderByWorkorderId(id);
if (proOrderWorkorder.getStatus().equals("w2")) {
return error("工单处于活动状态!不可更改!");
}
if (proOrderWorkorder.getStatus().equals("w3")) {
return error("工单处于报工状态!不可更改!");
}
return success();
}

@ -80,12 +80,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where parent_order = #{orderCode}
</select>
<select id="selectProdLine" resultType="com.op.plan.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.plan.domain.ProShift">
SELECT bst.Shift_Id shiftId,bst.Shift_Desc_Global shiftDesc
FROM base_shifts_t bst
@ -94,7 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectProdLineName" resultType="java.lang.String">
SELECT equipment_name AS 'prodLineName'
FROM base_equipment
WHERE equipment_id = #{prodLineCode}
WHERE equipment_code = #{prodLineCode}
</select>
<select id="selectBatchCodes" resultType="java.lang.String">
@ -141,6 +135,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select order_code from pro_order where parent_order = #{orderCode}
</select>
<select id="selectEquipmentListByRouteCode" resultType="java.lang.String">
select pps.equipment
from pro_route_process pp
INNER JOIN pro_process pps on pp.next_process_id = pps.process_id
INNER JOIN pro_route pr on pr.route_id = pp.route_id
where pr.route_code = #{routeCode} and pp.order_num = '1'
</select>
<select id="selectEquipment" resultType="com.op.plan.domain.ProLine" parameterType="String">
SELECT equipment_code AS 'key', equipment_name AS 'label'
FROM base_equipment
where equipment_code in
<foreach item="code" collection="array" open="(" separator="," close=")">
#{code}
</foreach>
</select>
<insert id="insertProOrder" parameterType="ProOrder">
insert into pro_order
<trim prefix="(" suffix=")" suffixOverrides=",">

@ -24,10 +24,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<select id="selectAllRoute" resultMap="ProRouteResult">
select route_code, route_name
from pro_route
where enable_flag = 'Y'
<select id="selectRouteByItemCode" resultMap="ProRouteResult">
select pr.route_code,pr.route_name
from pro_route pr
INNER JOIN pro_route_product prp ON pr.route_id = prp.route_id
where prp.item_code = #{itemCode} and pr.enable_flag = 'Y'
</select>
</mapper>

@ -199,4 +199,8 @@
#{id}
</foreach>
</delete>
<delete id="deleteProWetMaterialPlanDetailByWorkId">
delete from pro_wet_material_plan_detail where workorder_id = #{workorderId}
</delete>
</mapper>

Loading…
Cancel
Save