廖井涛
2024-03-07 012a7061f18eaa5524747dc60faae131831793fe
修改补片审核
3个文件已修改
59 ■■■■■ 已修改文件
north-glass-erp/src/main/java/com/example/erp/service/pp/ReplenishService.java 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/target/classes/mapper/pp/PatchLogMapper.xml 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
north-glass-erp/src/main/java/com/example/erp/service/pp/ReplenishService.java
@@ -99,26 +99,37 @@
    public Boolean updateReplenish(Map<String,Object> object) {
        boolean saveState = true;
        String userName = "";
        String userId = "";
        if (object.get("userName") != null) {
            userName = object.get("userName").toString();
        }
        if (object.get("userId") != null) {
            userId = object.get("userId").toString();
        }
        //获取对象集合循环进行新增修改
        List<PatchLog> patchLoglist = JSONArray.parseArray(JSONObject.toJSONString(object.get("patchLog")), PatchLog.class);
        if (!patchLoglist.isEmpty()){
            for (PatchLog patchLog : patchLoglist) {
                //审核
                patchMapper.updateReplenish(patchLog,userName);
                //修改小片流程卡数量
                patchMapper.updateOrderProcessDetail(patchLog);
        Object savePoint = TransactionAspectSupport.currentTransactionStatus().createSavepoint();
        try {
            String userName = "";
            String userId = "";
            if (object.get("userName") != null) {
                userName = object.get("userName").toString();
            }
        }
            if (object.get("userId") != null) {
                userId = object.get("userId").toString();
            }
            //获取对象集合循环进行新增修改
            List<PatchLog> patchLoglist = JSONArray.parseArray(JSONObject.toJSONString(object.get("patchLog")), PatchLog.class);
            if (!patchLoglist.isEmpty()){
                for (PatchLog patchLog : patchLoglist) {
                    //审核
                    patchMapper.updateReplenish(patchLog,userName);
                    //修改小片流程卡数量
                    patchMapper.updateOrderProcessDetail(patchLog);
                }
            }
        } catch (Exception e) {
            TransactionAspectSupport.currentTransactionStatus().rollbackToSavepoint(savePoint);
            //将异常传入数据库
            SysError sysError = new SysError();
            sysError.setError(e.toString());
            sysError.setFunc("saveOrder");
            sysErrorService.insert(sysError);
            saveState = false;
        }
        return saveState;
north-glass-erp/src/main/resources/mapper/pp/PatchLogMapper.xml
@@ -89,7 +89,10 @@
    </update>
    <update id="updateOrderProcessDetail"  >
        update pp.patch_log set reviewer=#{userName},review_status=1,update_time=now() where id=#{patchLog.id}
        update sd.order_process_detail set reporting_work_num=reporting_work_num-#{patchLog.patchNum} where order_id=#{patchLog.orderId} and
        order_number=#{patchLog.orderSort} and technology_number=#{patchLog.technologyNumber} and id <![CDATA[<]]> (select a.opdid from(select id as opdid from
        sd.order_process_detail opd where opd.order_id=#{patchLog.orderId} and opd.order_number=#{patchLog.orderSort} and opd.technology_number=#{patchLog.technologyNumber}
        and process=#{patchLog.patchProcesses}) as a)
    </update>
    <update id="updateDamageDetails"  >
north-glass-erp/target/classes/mapper/pp/PatchLogMapper.xml
@@ -88,6 +88,13 @@
        update pp.patch_log set reviewer=#{userName},review_status=1,update_time=now() where id=#{patchLog.id}
    </update>
    <update id="updateOrderProcessDetail"  >
        update sd.order_process_detail set reporting_work_num=reporting_work_num-#{patchLog.patchNum} where order_id=#{patchLog.orderId} and
        order_number=#{patchLog.orderSort} and technology_number=#{patchLog.technologyNumber} and id <![CDATA[<]]> (select a.opdid from(select id as opdid from
        sd.order_process_detail opd where opd.order_id=#{patchLog.orderId} and opd.order_number=#{patchLog.orderSort} and opd.technology_number=#{patchLog.technologyNumber}
        and process=#{patchLog.patchProcesses}) as a)
    </update>
    <update id="updateDamageDetails"  >
        update pp.damage_details set quantity=quantity+#{patchLog.patchNum},patch_status=1 where id=#{patchLog.reviewer}
    </update>