Przeglądaj źródła

混凝土清单不提供ai识别

MaiXinRong 1 dzień temu
rodzic
commit
61d5e884ba
2 zmienionych plików z 4 dodań i 5 usunięć
  1. 3 4
      app/controller/ledger_controller.js
  2. 1 1
      app/public/js/ledger.js

+ 3 - 4
app/controller/ledger_controller.js

@@ -1332,7 +1332,6 @@ module.exports = app => {
                     return { pid: pos.id, lid: pos.lid, name: rd[0] || '', unit: rd[1] || 0, quantity:  ctx.helper._.toNumber(rd[2]) || 0, g_order: i + maxOrder + 1 };
                 });
                 if (agData.length > 0) responseData.ancGcl = await ctx.service.ancillaryGcl.updateDatas({ add: agData });
-                console.log(responseData.ancGcl);
             }
             ctx.body = { err: 0, msg: '', data: responseData };
         }
@@ -1382,7 +1381,7 @@ module.exports = app => {
         async _aiComplieConcretePos(ctx, bills, data) {
             const validColSet = data.template.col_set.filter(x => { return !x.expr; });
             const AIDify = require('../lib/ai_dify');
-            const aiDify = new AIDify({ apiKey: ctx.difyInfo.apiKey.image2PosQty, baseUrl: ctx.difyInfo.baseUrl });
+            const aiDify = new AIDify({ apiKey: ctx.difyInfo.apiKey.image2Pos, baseUrl: ctx.difyInfo.baseUrl });
             const transResult = await aiDify.posCalcDetailRead(validColSet, data.billsName, data.keyword, data.files);
             const parts = transResult.res.split('\n==++==\n').filter(x => { return !!x; });
             const pos = [];
@@ -1403,8 +1402,8 @@ module.exports = app => {
                 case '钢筋':
                 case '钢绞线':
                     return this._aiComplieSteelPos(ctx, bills, data);
-                case '混凝土':
-                    return this._aiComplieConcretePos(ctx, bills, data);
+                // case '混凝土':
+                //     return this._aiComplieConcretePos(ctx, bills, data);
                 default: throw `暂不支持清单类型为${data.billsType}的清单,进行ai识别填写`
 
             }

+ 1 - 1
app/public/js/ledger.js

@@ -6618,7 +6618,7 @@ $(document).ready(function() {
     });
     $('.ai-btn').click(function() {
         aiTrans.billsIdentify(function(result) {
-            if (result === '无') {
+            if (result === '无' || result === '混凝土') {
                 toastr.warning('该清单类型暂不支持ai识别');
                 return;
             }