guoyujie
2025-10-13 b7706dcb36e5173503c20e4f644046ad153645db
Merge branch 'master' of http://10.153.19.25:10101/r/ERP_override
4个文件已修改
25405 ■■■■■ 已修改文件
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/package-lock.json 25273 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/sd/OrderProcessDetailMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
@@ -2068,10 +2068,7 @@
  user-select: none;
}
::v-deep(.mytable-scrollbar .col-red) {
  background-color: rgb(66,159,254);
  color: #fff;
}
::v-deep(.latter) {
north-glass-erp/package-lock.json
Diff too large
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -9,12 +9,15 @@
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.sd.*;
import com.example.erp.entity.userInfo.Log;
import com.example.erp.entity.userInfo.SysError;
import com.example.erp.exception.ServiceException;
import com.example.erp.mapper.pp.FlowCardMapper;
import com.example.erp.mapper.pp.ReportingWorkMapper;
import com.example.erp.mapper.sd.*;
import com.example.erp.service.userInfo.LogService;
import com.example.erp.service.userInfo.SysErrorService;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.time.LocalDate;
@@ -22,6 +25,9 @@
import java.util.Map;
import com.fasterxml.jackson.core.type.TypeReference;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.io.IOException;
@@ -49,6 +55,8 @@
    private final OrderDetailMapper orderDetailMapper;
    private final OrderMapper orderMapper;
    private final ReportingWorkMapper reportingWorkMapper;
    @Autowired
    SysErrorService sysErrorService;
    public FlowCardService(FlowCardMapper flowCardMapper, OrderGlassDetailMapper orderGlassDetailMapper,
                           OrderProcessDetailMapper orderProcessDetailMapper, LogService logService,
@@ -199,59 +207,76 @@
    }
    //保存流程卡数据
    @Transactional(rollbackFor = Exception.class)
    public Boolean addFlowCardSv(String orderId, Map<String, Object> object) {
        String userName = "";
        if (object.get("userName") != null) {
            userName = object.get("userName").toString();
        }
        String productionId = "";
        if (object.get("productionId") != null) {
            productionId = object.get("productionId").toString();
        }
        List<FlowCard> FlowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("flowCard")), FlowCard.class);
        if (!FlowCardList.isEmpty()) {
            for (FlowCard flowCard : FlowCardList) {
                //查询每个序号的层数
                Integer layer = flowCardMapper.selectLayer(productionId, flowCard.getOrderNumber());
                //添加流程卡数据
                flowCardMapper.addFlowCardMp(flowCard.getProcessId(), flowCard.getOrderNumber(), flowCard.getLandingSequence(), flowCard.getQuantity(), productionId, userName, layer);
                //修改分架状态,将状态改为1
                flowCardMapper.updateFlowState(productionId, flowCard.getOrderNumber());
                //查询该订单未分架数量
                Integer FlowCount = flowCardMapper.selectFlowCount(orderId);
                if (FlowCount == 0) {
                    //修改订单表分架状态为2
                    flowCardMapper.updateProcessingCard(orderId, 2);
                } else {
                    //修改订单表分架状态为1,未全部分架完成
                    flowCardMapper.updateProcessingCard(orderId, 1);
                }
                //查询订单小片表获取工艺传入小片工艺表
                List<OrderGlassDetail> orderGlassDetailList =
                        orderGlassDetailMapper.selectList(
                                new QueryWrapper<OrderGlassDetail>()
                                        .eq("order_id", orderId)
                                        .eq("order_number", flowCard.getOrderNumber())
                        );
                List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetailList);
                orderProcessDetailList.forEach(
                        orderGlassDetail -> orderGlassDetail.setProcessId(flowCard.getProcessId()));
                //赋值订单工艺表
                orderProcessDetailMapper.insertOrderProcessDetail(orderProcessDetailList);
        boolean saveState = true;
        //设置回滚点
        Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint();
        try {
            String userName = "";
            if (object.get("userName") != null) {
                userName = object.get("userName").toString();
            }
            //保存日志
            Log log = new Log();
            log.setContent(object.toString());
            log.setFunction("addFlowCardSv流程卡新增");
            log.setOperatorId((String) object.get("userId"));
            log.setOperator((String) object.get("userName"));
            logService.saveLog(log);
            return true;
        } else {
            return false;
            String productionId = "";
            if (object.get("productionId") != null) {
                productionId = object.get("productionId").toString();
            }
            List<FlowCard> FlowCardList = JSONArray.parseArray(JSONObject.toJSONString(object.get("flowCard")), FlowCard.class);
            if (!FlowCardList.isEmpty()) {
                for (FlowCard flowCard : FlowCardList) {
                    //查询每个序号的层数
                    Integer layer = flowCardMapper.selectLayer(productionId, flowCard.getOrderNumber());
                    //添加流程卡数据
                    flowCardMapper.addFlowCardMp(flowCard.getProcessId(), flowCard.getOrderNumber(), flowCard.getLandingSequence(), flowCard.getQuantity(), productionId, userName, layer);
                    //修改分架状态,将状态改为1
                    flowCardMapper.updateFlowState(productionId, flowCard.getOrderNumber());
                    //查询该订单未分架数量
                    Integer FlowCount = flowCardMapper.selectFlowCount(orderId);
                    if (FlowCount == 0) {
                        //修改订单表分架状态为2
                        flowCardMapper.updateProcessingCard(orderId, 2);
                    } else {
                        //修改订单表分架状态为1,未全部分架完成
                        flowCardMapper.updateProcessingCard(orderId, 1);
                    }
                    //查询订单小片表获取工艺传入小片工艺表
                    List<OrderGlassDetail> orderGlassDetailList =
                            orderGlassDetailMapper.selectList(
                                    new QueryWrapper<OrderGlassDetail>()
                                            .eq("order_id", orderId)
                                            .eq("order_number", flowCard.getOrderNumber())
                            );
                    List<OrderProcessDetail> orderProcessDetailList = getOrderProcessDetails(orderGlassDetailList);
                    orderProcessDetailList.forEach(
                            orderGlassDetail -> orderGlassDetail.setProcessId(flowCard.getProcessId()));
                    //赋值订单工艺表
                    orderProcessDetailMapper.insertOrderProcessDetail(orderProcessDetailList);
                }
                //保存日志
                Log log = new Log();
                log.setContent(object.toString());
                log.setFunction("addFlowCardSv流程卡新增");
                log.setOperatorId((String) object.get("userId"));
                log.setOperator((String) object.get("userName"));
                logService.saveLog(log);
            } else {
                saveState = false;
            }
        } catch (Exception e) {
            TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint);
            //将异常传入数据库
            SysError sysError = new SysError();
            sysError.setError(e+Arrays.toString(e.getStackTrace()));
            sysError.setFunc("updateFinishedGoodsInventoryAllocate");
            sysErrorService.insert(sysError);
            saveState = false;
        }
        return saveState;
    }
    public Map<String, Object> selectSchedulingSv(String selectTime1, String selectTime2, String orderId, String processes, Integer state, FlowCard flowCard) {
north-glass-erp/src/main/resources/mapper/sd/OrderProcessDetailMapper.xml
@@ -6,7 +6,7 @@
    <insert id="insertOrderProcessDetail" >
        insert into
            order_process_detail(
            sd.order_process_detail(
                order_id,
                order_number,
                technology_number,