廖井涛
2024-08-29 07d08f8dc420ba47f66587fdc5038a59fc340c96
Merge branch 'master' of http://bore.pub:10439/r/ERP_override
15个文件已修改
187 ■■■■ 已修改文件
north-glass-erp/northglass-erp/src/components/pp/TagStyle.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/pp/TagStyleDesigner.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/pp/PatchLog.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/pp/ProductionScheduling.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/entity/pp/Rework.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/ReworkMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/northglass-erp/src/components/pp/TagStyle.vue
@@ -33,7 +33,7 @@
  alType:'order.alType',
  customerBatch:'order.customerBatch',
  processingNote:'order.processingNote',
  remarks:'产品备注',
  remarks:'订单备注',
  customerAbbreviation:'customer.customerAbbreviation',
  productAbbreviation:'product.msg.productAbbreviation',
  processId:'processCard.processId',
@@ -49,7 +49,7 @@
  remarks2:'备注2',
  remarks3:'备注3',
  remarks4:'备注4',
  filmNumber:'膜号',
  filmNumber:'产品备注',
  bendRadius:'order.bendRadius',
  glassChild:'reportingWorks.glassChild',
  glassAddress:'replenish.sliceMarking'
north-glass-erp/northglass-erp/src/components/pp/TagStyleDesigner.vue
@@ -500,9 +500,11 @@
          <el-button type="warning" @click="clear">清空</el-button>
        </el-col>
        <el-col :span="1">
<!--          <el-button type="danger" @click="htmlPrint">打印</el-button>-->
          <el-button :disabled="!tag.id" type="danger" @click="deleteTag">删除</el-button>
        </el-col>
        <el-col :span="1">
          <el-button type="danger" @click="htmlPrint">打印</el-button>
        </el-col>
      </el-row>
north-glass-erp/northglass-erp/src/views/pp/reportingWorks/AddReportingWork.vue
@@ -239,7 +239,14 @@
          },
          {
            code: 'SecondaryBreakage',
            name: "次破相同",
            name: "序号次破相同",
            prefixIcon: 'vxe-icon-indicator',
            visible: true,
            disabled: false
          },
          {
            code: 'checkedBreakage',
            name: "选中次破相同",
            prefixIcon: 'vxe-icon-indicator',
            visible: true,
            disabled: false
@@ -510,7 +517,7 @@
        }
        case 'SecondaryBreakage' : {
          let result = toolbarButtonClickEvent()
          if (result.cell === "breakageQuantity"){
          if (result.cell === "breakageQuantity" || result.cell === "completedQuantity"){
            if (result) {
              const dataList = xGrid.value.getTableData().visibleData
              const seenOrders = {}
@@ -537,6 +544,27 @@
          }
          break
        }
        case 'checkedBreakage' : {
          let result = toolbarButtonClickEvent()
          if (result.cell === "breakageQuantity" || result.cell === "completedQuantity"){
            if (result) {
              const dataList = xGrid.value.getTableData().visibleData
              const val = dataList[result.start].damageDetails
              const quantity = dataList[result.start].breakageQuantity
              dataList.forEach((item, index) => {
                if (index >= result.start && index <= result.end) {
                  item.damageDetails = val
                  item.breakageQuantity =  quantity
                  if (index!=result.start){
                    item.completedQuantity = item.completedQuantity - quantity
                  }
                }
              })
            }
          }
          break
        }
      }
    }
  },
north-glass-erp/src/main/java/com/example/erp/controller/pp/ProcessCardController.java
@@ -339,13 +339,9 @@
    }
    @ApiOperation("汉玻获取流程卡接口")
    @PostMapping("/getProcessCardList/hanbo")
    public Result getProcessCard() {
        return Result.seccess(flowCardService.getProcessCard());
    public Result getProcessCard(@RequestBody Map<String,String> processCards)  {
        return Result.seccess(flowCardService.getProcessCard(processCards));
    }
    @ApiOperation("汉玻确认接收接口")
    @PostMapping("/updateProcessCardState/hanbo")
    public Result updateProcessCardState(@RequestBody Integer id) {
        return Result.seccess(flowCardService.updateProcessCardState(id));
    }
}
north-glass-erp/src/main/java/com/example/erp/controller/pp/ReportingWorkController.java
@@ -141,4 +141,17 @@
        return  Result.seccess(reportingWorkService.getPatchConditionSv(reportingWorkId));
    }
    @ApiOperation("mes报工接口")
    @PostMapping  ("/mesReportingWork")
    public Result mesReportingWork(@RequestBody Map<String,Object> reportingWork){
        Boolean aBoolean = reportingWorkService.mesReportingWorkSv(reportingWork);
        if(aBoolean){
            return Result.seccess(reportingWorkService.mesReportingWorkSv(reportingWork));
        }else{
            throw new ServiceException(Constants.Code_600, "上工序已完工数量小于本工序报工数量,请检查");
        }
    }
}
north-glass-erp/src/main/java/com/example/erp/entity/pp/PatchLog.java
@@ -1,5 +1,6 @@
package com.example.erp.entity.pp;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.time.LocalDate;
@@ -43,5 +44,6 @@
    private String reportingWorkId;
    //外键流程卡表
    @TableField(select = false,exist = false)
    private FlowCard flowCard;
}
north-glass-erp/src/main/java/com/example/erp/entity/pp/ProductionScheduling.java
@@ -1,5 +1,6 @@
package com.example.erp.entity.pp;
import com.baomidou.mybatisplus.annotation.TableField;
import com.example.erp.entity.sd.Order;
import com.example.erp.entity.sd.OrderDetail;
import com.example.erp.entity.sd.OrderGlassDetail;
@@ -45,9 +46,12 @@
    private  String reviewer;
    //外键订单表
    @TableField(select = false,exist= false)
    private Order order;
    //外键订单明细表
    @TableField(select = false,exist= false)
    private OrderDetail orderDetail;
    //外键订单明细表
    @TableField(select = false,exist= false)
    private OrderGlassDetail orderGlassDetail;
}
north-glass-erp/src/main/java/com/example/erp/entity/pp/Rework.java
@@ -1,5 +1,6 @@
package com.example.erp.entity.pp;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Data;
import java.time.LocalDate;
@@ -42,5 +43,6 @@
    private String reportingWorkId;
    //外键流程卡表
    @TableField(select = false,exist= false)
    private FlowCard flowCard;
}
north-glass-erp/src/main/java/com/example/erp/service/pp/FlowCardService.java
@@ -5,11 +5,12 @@
import com.alibaba.fastjson.JSONObject;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.example.erp.common.Constants;
import com.example.erp.entity.pp.FlowCard;
import com.example.erp.entity.sd.OrderGlassDetail;
import com.example.erp.entity.sd.OrderProcessDetail;
import com.example.erp.entity.userInfo.Log;
import com.example.erp.exception.ServiceException;
import com.example.erp.mapper.pp.FlowCardMapper;
import com.example.erp.mapper.sd.OrderGlassDetailMapper;
import com.example.erp.mapper.sd.OrderProcessDetailMapper;
@@ -682,13 +683,20 @@
    }
    public  List<FlowCard> getProcessCard() {
    public  List<FlowCard> getProcessCard(Map<String, String> processCards) {
        String processCard = processCards.get("processCard");
        if(!processCard.contains("/")){
            throw new ServiceException(Constants.Code_600, "错误的流程卡号,请检查!");
        }
        String[] processCardList = processCard.split("/");
        List<FlowCard> flowCardList = flowCardMapper.selectList(
                new QueryWrapper<FlowCard>().eq("termination_status", 0)
                        .orderByDesc("id")
                new QueryWrapper<FlowCard>()
                        .eq("process_id", processCardList[0])
                        .eq("technology_number", processCardList[1])
        );
        for (FlowCard flowCard : flowCardList) {
            flowCard.setProcessId(flowCard.getProcessId()+'/'+flowCard.getTechnologyNumber());
            flowCard.setOrderGlassDetail(
                    orderGlassDetailMapper.selectOne(
                            new QueryWrapper<OrderGlassDetail>()
@@ -706,12 +714,6 @@
        return flowCardList;
    }
    public Boolean updateProcessCardState(Integer id) {
        UpdateWrapper<FlowCard> updateWrapper = new UpdateWrapper<>();
        updateWrapper.eq("id", id) // 根据id更新
                .set("termination_status", 1);
        return flowCardMapper.update(null, updateWrapper) > 0;
    }
}
north-glass-erp/src/main/java/com/example/erp/service/pp/ReportingWorkService.java
@@ -13,6 +13,7 @@
import com.example.erp.entity.sd.Order;
import com.example.erp.entity.sd.OrderProcessDetail;
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.*;
import com.baomidou.dynamic.datasource.annotation.DS;
@@ -22,8 +23,11 @@
import com.example.erp.mapper.userInfo.LogMapper;
import com.example.erp.service.sd.OrderProcessDetailService;
import com.example.erp.service.userInfo.LogService;
import com.example.erp.service.userInfo.SysErrorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
@@ -57,9 +61,10 @@
    final LogMapper logMapper;
    private final OrderGlassDetailMapper orderGlassDetailMapper;
    private final SysErrorService sysErrorService;
    public ReportingWorkService(ReportingWorkMapper reportingWorkMapper, BasicDateProduceMapper basicDateProduceMapper, DamageDetailsMapper damageDetailsMapper, ReportingWorkDetailMapper reportingWorkDetailMapper, OrderProcessDetailMapper orderProcessDetailMapper, OrderProcessDetailService orderProcessDetailService, OrderMapper orderMapper, FlowCardMapper flowCardMapper, LogService logService, LogMapper logMapper, OrderGlassDetailMapper orderGlassDetailMapper) {
    public ReportingWorkService(ReportingWorkMapper reportingWorkMapper, BasicDateProduceMapper basicDateProduceMapper, DamageDetailsMapper damageDetailsMapper, ReportingWorkDetailMapper reportingWorkDetailMapper, OrderProcessDetailMapper orderProcessDetailMapper, OrderProcessDetailService orderProcessDetailService, OrderMapper orderMapper, FlowCardMapper flowCardMapper, LogService logService, LogMapper logMapper, OrderGlassDetailMapper orderGlassDetailMapper, SysErrorService sysErrorService) {
        this.reportingWorkMapper = reportingWorkMapper;
        this.basicDateProduceMapper = basicDateProduceMapper;
        this.damageDetailsMapper = damageDetailsMapper;
@@ -71,6 +76,7 @@
        this.logService = logService;
        this.logMapper = logMapper;
        this.orderGlassDetailMapper = orderGlassDetailMapper;
        this.sysErrorService = sysErrorService;
    }
    public Map<String, Object> AddSelectLastWorkSv(String processIdStr, String technologyStr, String process, String reportType) {
@@ -611,4 +617,70 @@
        String count=reportingWorkMapper.getPatchConditionMp(reportingWorkId);
        return count;
    }
    @Transactional(rollbackFor = Exception.class , noRollbackFor = ServiceException.class)
    public Boolean mesReportingWorkSv(Map<String,Object> reportingWorkMap) {
        //设置回滚点
        Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint();
        try{
            //接收解析主附表信息
            JSONObject reportingWorkJson = new JSONObject(reportingWorkMap);
            ReportingWork reportingWork = JSONObject.parseObject(JSONObject.toJSONString(reportingWorkJson.get("title")), ReportingWork.class);
            ReportingWorkDetail reportingWorkDetail =JSON.parseObject(JSONObject.toJSONString(reportingWorkJson.get("detail")), ReportingWorkDetail.class);
            int processNum = reportingWorkMapper.selectGlassProcessNum(
                    reportingWorkDetail.getOrderNumber(),
                    reportingWorkDetail.getTechnologyNumber(),
                    reportingWork.getProcessId(),
                    reportingWork.getThisProcess()
            );
            //判断是否大于当前数量并且抛出异常
            if (processNum < (reportingWorkDetail.getBreakageQuantity() + reportingWorkDetail.getCompletedQuantity())) {
                return false;
            }
            //获取当前最大报工单号生成报工单号
            String formattedNumber = String.format("%04d", reportingWorkMapper.selectMaxReportingWorkId() + 1);
            //格式化当前日期
            Date currentDate = new Date();
            SimpleDateFormat dateFormat = new SimpleDateFormat("yyMMdd");
            String formattedDate = dateFormat.format(currentDate);
            String reportingWorkId = "BG" + formattedDate + formattedNumber;
            reportingWork.setReportingWorkId(reportingWorkId);
            reportingWorkDetail.setReportingWorkId(reportingWorkId);
            reportingWorkMapper.insert(reportingWork);
            reportingWorkDetailMapper.insert(reportingWorkDetail);
            OrderProcessDetail orderProcessDetail = new OrderProcessDetail();
            orderProcessDetail.setBrokenNum(reportingWorkDetail.getBreakageQuantity());
            orderProcessDetail.setReportingWorkNum(reportingWorkDetail.getCompletedQuantity());
            orderProcessDetail.setReportingWorkNumCount(reportingWorkDetail.getCompletedQuantity());
            //根据订单id,订单序号,以及小片序号 更新小片流程的完工数量以及刺破数量
            LambdaUpdateWrapper<OrderProcessDetail> updateWrapper = new LambdaUpdateWrapper<>();
            updateWrapper.eq(OrderProcessDetail::getOrderNumber, reportingWorkDetail.getOrderNumber())
                    .eq(OrderProcessDetail::getProcessId, reportingWork.getProcessId().substring(0, 14))
                    .eq(OrderProcessDetail::getOrderId, reportingWork.getOrderId())
                    .eq(OrderProcessDetail::getProcess, reportingWork.getThisProcess())
                    .eq(OrderProcessDetail::getTechnologyNumber, reportingWorkDetail.getTechnologyNumber())
                    .setSql("reporting_work_num_count = reporting_work_num_count +" + orderProcessDetail.getReportingWorkNum())
                    .setSql("reporting_work_num =reporting_work_num +" + orderProcessDetail.getReportingWorkNum());
            orderProcessDetailMapper.update(null, updateWrapper);
            return true;
         } catch (Exception e) {
            TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint);
            //将异常传入数据库
            SysError sysError = new SysError();
            sysError.setError(e +Arrays.toString(e.getStackTrace()));
            sysError.setFunc("saveOrder");
            sysErrorService.insert(sysError);
            throw new ServiceException(Constants.Code_500, "数据请求异常,请检查");
        }
    }
}
north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml
@@ -46,6 +46,7 @@
        on r.order_id = ogd.order_id and r.order_sort = ogd.order_number
        <where>
            date(r.create_time)>=#{startDate} and date(r.create_time) &lt;= #{endDate}
            and o.create_order>0
        </where>
         order by r.review_status,r.id desc
        limit #{offset},#{pageSize};
@@ -156,6 +157,7 @@
                           on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=0 and (dd.responsible_process=rw.this_process or (dd.quality_ins_status!=1)) and rw.reviewed_state!=-1
          and o.create_order>0
        order by dd.id desc
    </select>
north-glass-erp/src/main/resources/mapper/pp/ProductionScheduling.xml
@@ -77,6 +77,7 @@
        left join sd.order_glass_detail as ogd on ogd.order_id=od.order_id and ogd.order_number=od.order_number and
        ogd.technology_number=ps.technology_number
        where ps.scheduling_id IS NOT NULL
          and o.create_order>0
        and od.create_time between #{selectTime1} and #{selectTime2}
        and position(#{processes} in ps.processes)
        and position(#{orderIds} in ps.order_id)
@@ -140,7 +141,7 @@
        where (od.quantity - IFNULL((ps.schedulingQuantity), 0)) > 0
        and od.create_time between #{selectTime1} and #{selectTime2}
        and opd.reporting_work_num_count = 0
        and o.create_order>0
        and position(#{orderIds} in ogd.order_id)
        -- and position("切割" in ps.processes)
        <if test="productionScheduling.order.orderId != null and productionScheduling.order.orderId != ''">
@@ -236,7 +237,7 @@
        where (od.quantity - IFNULL((ps.schedulingQuantity), 0)) > 0
        and od.create_time between #{selectTime1} and #{selectTime2}
        and opd.reporting_work_num_count = 0
        and o.create_order>0
        and position(#{orderId} in ogd.order_id)
        -- and position("切割" in ps.processes)
        <if test="productionScheduling.orderId != null and productionScheduling.orderId != ''">
@@ -269,6 +270,7 @@
        ogd.technology_number=ps.technology_number
        where ps.scheduling_id IS NOT NULL
        and od.create_time between #{selectTime1} and #{selectTime2}
        and o.create_order>0
        and position(#{processes} in ps.processes)
        and position(#{orderId} in ps.order_id)
        <if test="productionScheduling.orderId != null and productionScheduling.orderId != ''">
north-glass-erp/src/main/resources/mapper/pp/ReportingWork.xml
@@ -110,7 +110,9 @@
    <select id="SelectTechnologicalProcess">
        select ifnull((select ogd.process
                       from sd.order_glass_detail as ogd
                       left join sd.`order` as o on o.order_id=ogd.order_id
                       where ogd.production_id = LEFT(#{processIdStr}, 11)
                         and o.create_order>0
                         and POSITION(ogd.technology_number in #{technologyStr})
                       limit 1),'') as  process
@@ -528,6 +530,7 @@
          and rw.reporting_work_time between #{selectTime1} and #{selectTime2}
          and position(#{orderId} in rw.order_id)
          and rw.reviewed_state!=-1
          and o.create_order>0
        <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''">
            and rw.reporting_work_id regexp #{reportingWork.reportingWorkId}
        </if>
@@ -569,6 +572,7 @@
        where rw.reviewed_state != 2
          and rw.reporting_work_time between #{selectTime1} and #{selectTime2} and position(#{orderId} in rw.order_id)
          and rw.reviewed_state!=-1
          and o.create_order>0
        <if test="reportingWork.reportingWorkId != null and reportingWork.reportingWorkId != ''">
            and rw.reporting_work_id regexp #{reportingWork.reportingWorkId}
        </if>
north-glass-erp/src/main/resources/mapper/pp/ReworkMapper.xml
@@ -46,6 +46,7 @@
        on r.order_id = ogd.order_id and r.order_sort = ogd.order_number
        <where>
            date(r.create_time)>=#{startDate} and date(r.create_time) &lt;= #{endDate}
            and o.create_order>0
        </where>
         order by r.review_status,r.id desc limit #{offset},#{pageSize};
    </select>
@@ -61,6 +62,7 @@
                                 on r.order_id = ogd.order_id and r.order_sort = ogd.order_number
        <where>
            date(r.create_time)>=#{startDate} and date(r.create_time) &lt;= #{endDate}
            and o.create_order>0
        </where>
              ) as zu
        limit #{offset},#{pageSize};
@@ -100,7 +102,7 @@
                 left join (select * from sd.order_glass_detail group by order_id,order_number) as ogd
                           on rw.order_id = ogd.order_id and dd.order_number = ogd.order_number
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=1 order by dd.id desc
        where  dd.breakage_quantity-dd.quantity>0 and dd.available=1 and o.create_order>0 order by dd.id desc
    </select>
north-glass-erp/src/main/resources/mapper/pp/WordOrder.xml
@@ -95,7 +95,7 @@
        left join `order` as o
        on o.order_id=ogd.order_id
        where ogd.production_id IS NOT NULL
        and o.order_review>0
        <if test="orderGlassDetail.orderId != null and orderGlassDetail.orderId != ''">
            and o.order_id regexp #{orderGlassDetail.orderId}
        </if>