diff --git a/appengine/src/main/java/com/currency/appengine/config/WebMvcConfig.java b/appengine/src/main/java/com/currency/appengine/config/WebMvcConfig.java index 6199626..331140e 100644 --- a/appengine/src/main/java/com/currency/appengine/config/WebMvcConfig.java +++ b/appengine/src/main/java/com/currency/appengine/config/WebMvcConfig.java @@ -1,26 +1,18 @@ package com.currency.appengine.config; -import com.currency.appengine.filter.RepeatedlyReadFilter; -import com.currency.appengine.handler.CustomMethodArgumentResolver; import com.currency.appengine.handler.GlobalInterceptor; -import com.currency.appengine.handler.SignInterceptor; +import com.currency.appengine.handler.CustomMethodArgumentResolver; import com.currency.appengine.handler.magic.DevInterceptor; -import java.util.List; -import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; -import org.springframework.core.Ordered; import org.springframework.web.method.support.HandlerMethodArgumentResolver; -import org.springframework.web.servlet.config.annotation.CorsRegistry; -import org.springframework.web.servlet.config.annotation.EnableWebMvc; -import org.springframework.web.servlet.config.annotation.InterceptorRegistry; -import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; -import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.springframework.web.servlet.config.annotation.*; + +import java.util.List; @Configuration @EnableWebMvc public class WebMvcConfig implements WebMvcConfigurer { - /** * Interceptor verification token * @@ -36,15 +28,9 @@ public class WebMvcConfig implements WebMvcConfigurer { return new DevInterceptor(); } - @Bean - public SignInterceptor signInterceptor() { - return new SignInterceptor(); - } - @Override public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(GlobalInterceptor()).addPathPatterns("/**"); - registry.addInterceptor(signInterceptor()).addPathPatterns("/open/**");//只拦截open前缀的接口 registry.addInterceptor(DevInterceptor()).addPathPatterns("/swagger-ui.html").addPathPatterns("/magic/**"); } @@ -61,9 +47,8 @@ public class WebMvcConfig implements WebMvcConfigurer { // .allowedOrigins("*") .allowedOriginPatterns("*") .allowCredentials(true) - .allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS") - .maxAge(3600) - ; + .allowedMethods("GET","HEAD","POST","PUT","DELETE","OPTIONS") + .maxAge(3600); } /* @@ -84,15 +69,4 @@ public class WebMvcConfig implements WebMvcConfigurer { registry.addResourceHandler("doc.html").addResourceLocations( "classpath:knife4j/"); } - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Bean - public FilterRegistrationBean someFilterRegistration() - { - FilterRegistrationBean registration = new FilterRegistrationBean(); - registration.setFilter(new RepeatedlyReadFilter()); - registration.addUrlPatterns("/*"); - registration.setName("repeatableFilter"); - registration.setOrder(Ordered.LOWEST_PRECEDENCE); - return registration; - } } diff --git a/appengine/src/main/java/com/currency/appengine/controller/SystemController.java b/appengine/src/main/java/com/currency/appengine/controller/SystemController.java index dbabddd..c807704 100644 --- a/appengine/src/main/java/com/currency/appengine/controller/SystemController.java +++ b/appengine/src/main/java/com/currency/appengine/controller/SystemController.java @@ -3,11 +3,7 @@ package com.currency.appengine.controller; import cn.hutool.captcha.CaptchaUtil; import cn.hutool.captcha.LineCaptcha; import com.currency.appengine.annotation.CheckToken; -import com.currency.appengine.domain.CustomerReq; -import com.currency.appengine.domain.SupplierReq; import com.currency.appengine.domain.system.SysParam; -import com.currency.appengine.service.system.CustomerService; -import com.currency.appengine.service.system.SupplierService; import com.currency.appengine.service.system.SysMenuService; import com.currency.appengine.service.system.SysParamService; import com.currency.appengine.service.system.SysRoleService; @@ -16,20 +12,16 @@ import com.currency.appengine.utils.JsonUtil; import com.currency.appengine.utils.ReqParamsUtil; import com.currency.appengine.utils.Result; import com.currency.appengine.utils.StringUtil; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + import javax.servlet.ServletOutputStream; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RestController; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; /** * @date 2021/07/25 @@ -37,7 +29,6 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/sys/authority") public class SystemController { - @Autowired SysUserService sysUserService; @Autowired @@ -46,14 +37,10 @@ public class SystemController { SysRoleService sysRoleService; @Autowired SysParamService sysParamService; - @Autowired - CustomerService customerService; - @Autowired - SupplierService supplierService; /* - * 获取图形验证码 - * */ + * 获取图形验证码 + * */ @RequestMapping("/kaptcha") public void getKaptchaImage(HttpServletRequest request, HttpServletResponse response) throws Exception { HttpSession session = request.getSession(); @@ -77,7 +64,6 @@ public class SystemController { /** * 登陆 - * * @param params * @return */ @@ -96,10 +82,10 @@ public class SystemController { if (StringUtil.notEmpty(session.getAttribute("KAPTCHA_SESSION_KEY"))) { String vercode = String.valueOf(params.get("verifycode")); if (!code.equals(vercode)) { - return Result.fail(-14, "验证码错误"); + return Result.fail(-14,"验证码错误"); } } else { - return Result.fail(-14, "验证码错误"); + return Result.fail(-14,"验证码错误"); } return sysUserService.userLogin(params); } @@ -178,7 +164,6 @@ public class SystemController { /** * 角色操作 - * * @return */ @GetMapping("/role/list/all") @@ -250,13 +235,12 @@ public class SystemController { /** * 菜单操作 - * * @return */ @GetMapping("/menu/list/all") @CheckToken public Result menuListAll() { - return sysMenuService.getRouterListAll(); + return sysMenuService.getRouterListAll(); } @PostMapping("/menu/add") @@ -336,25 +320,4 @@ public class SystemController { public Result cacheUpdate() { return sysParamService.cacheUpdate(); } - - /** - * 客户信息 - */ - @PostMapping("/customer/add") - @CheckToken - public Result addCustomer(HttpServletRequest request, @RequestBody CustomerReq customerReq) { - String userId = StringUtil.objectToString(request.getAttribute("openid")); - customerReq.setUserId(userId); - return Result.suc(customerService.addCustomer(customerReq)); - } - /** - * 供应商信息 - */ - @PostMapping("/supplier/add") - @CheckToken - public Result addSupplier(HttpServletRequest request, @RequestBody SupplierReq supplierReq) { - String userId = StringUtil.objectToString(request.getAttribute("openid")); - supplierReq.setUserId(userId); - return Result.suc(supplierService.addSupplier(supplierReq)); - } } diff --git a/appengine/src/main/java/com/currency/appengine/handler/GlobalInterceptor.java b/appengine/src/main/java/com/currency/appengine/handler/GlobalInterceptor.java index d6a34f3..27c45b9 100644 --- a/appengine/src/main/java/com/currency/appengine/handler/GlobalInterceptor.java +++ b/appengine/src/main/java/com/currency/appengine/handler/GlobalInterceptor.java @@ -56,7 +56,7 @@ public class GlobalInterceptor implements HandlerInterceptor { log.info(">>>>>>>Call before request processing (check token) "); Map headers = HttpUtil.getHeadersInfo(request); - String token = headers.get("authorization"); + String token = headers.get("authorization");; if (token == null || token.isEmpty()) { HttpUtil.returnJson(response, JsonUtil.generate(Result.fail(-2, "result.not_token"))); log.info(">>>>>>>check token fail"); diff --git a/appengine/src/main/java/com/currency/appengine/service/common/CommonServices.java b/appengine/src/main/java/com/currency/appengine/service/common/CommonServices.java index 4d7d791..205ee6c 100644 --- a/appengine/src/main/java/com/currency/appengine/service/common/CommonServices.java +++ b/appengine/src/main/java/com/currency/appengine/service/common/CommonServices.java @@ -25,12 +25,13 @@ public class CommonServices { /** * 获取编码 + * * @param type * @param data * @return */ public String getCode(String type, Map data) { - Map,String>> grantTypeMap = new HashMap<>(); + Map, String>> grantTypeMap = new HashMap<>(); grantTypeMap.put("CustomerCode", params -> customerCode(params)); // 客户编码 grantTypeMap.put("SupplierCode", params -> supplierCode(params)); // 供应商编码 @@ -38,11 +39,12 @@ public class CommonServices { grantTypeMap.put("OrderNumber", params -> orderNumber(params)); // 订单编号 grantTypeMap.put("ProductionPlan", params -> productionPlan(params)); // 生产计划 grantTypeMap.put("ProductionSchedulingNumber", params -> productionSchedulingNumber(params)); // 排产编号 - grantTypeMap.put("ProductionOrderNumber", params -> productionOrderNumber(params)); // 报工单号 + grantTypeMap.put("ProductionOrderNumber", params -> productionOrderNumber(params)); // 报工单号 -- 废弃 + grantTypeMap.put("ProductionOrderNumberSub", params -> productionOrderNumberSub(params)); // 报工单号 -- 细分 grantTypeMap.put("PurchaseNumber", params -> purchaseNumber(params)); // 采购编号 - Function,String> result = grantTypeMap.get(type); - if(result!=null){ + Function, String> result = grantTypeMap.get(type); + if (result != null) { //传入resourceId 执行这段表达式获得String型的grantType return result.apply(data); } @@ -52,6 +54,7 @@ public class CommonServices { /** * 生成客户编码规则:C+5位流水号 * mini_customer_info + * * @param params * @return */ @@ -77,6 +80,7 @@ public class CommonServices { /** * 生成供应商编码规则:V+5位流水号 + * * @param params * @return */ @@ -103,6 +107,7 @@ public class CommonServices { /** * 生成销售订单号规则:客户简称代码+日期+3位流水序号(按客户区分),如盛威客户(SW20240929-001,SW20240929-002,SW20240929-003..) + * * @param params * @return */ @@ -121,6 +126,7 @@ public class CommonServices { /** * 生成订单号规则:流水序号+行号(两位数)如(00101,00102。。。) + * * @param params * @return */ @@ -138,6 +144,7 @@ public class CommonServices { /** * 生成生产计划单规则::P+年月日+3位流水号 + * * @param params * @return */ @@ -154,6 +161,7 @@ public class CommonServices { /** * 生成挤压排产编号规则:JY+年月日+3位流水号 + * * @param params * @return */ @@ -170,6 +178,7 @@ public class CommonServices { /** * 生成报工单号为BG+日期流水号+3位流水 + * * @param params * @return */ @@ -184,8 +193,47 @@ public class CommonServices { } } + /** + * 生成报工单号为BG+日期流水号+3位流水 + * + * @param params + * @return + */ + public String productionOrderNumberSub(Map params) { + String currentProcess = String.valueOf(params.get("currentProcess")); + try { + return LockUtils.doWithLock(() -> { + int count = commonMapper.count("mini_process_report", "date(create_time) = curdate() and current_process=#{currentProcess}", + new HashMap() {{ + put("currentProcess", currentProcess); + }}); + switch (currentProcess) { + case "jiya": + return "JY" + DateUtil.getYyMMdd() + formatNumber(count, "2"); + case "dk": + return "DK" + DateUtil.getYyMMdd() + formatNumber(count, "2"); + case "jingpin": + return "JP" + DateUtil.getYyMMdd() + formatNumber(count, "2"); + case "yanghau1": + return "YH" + DateUtil.getYyMMdd() + formatNumber(count, "2"); + case "yanghua2": + return "YHH" + DateUtil.getYyMMdd() + formatNumber(count, "2"); + case "jingqie": + return "JQ" + DateUtil.getYyMMdd() + formatNumber(count, "2"); + case "bz": + return "BZ" + DateUtil.getYyMMdd() + formatNumber(count, "2"); + default: + return "BG" + DateUtil.getYyyyMMdd() + formatNumber(count, "3"); + } + }); + } catch (Exception e) { + return null; + } + } + /** * 生成采购订单编号规则:PO+年月日+三位流水 + * * @param params * @return */ @@ -216,6 +264,7 @@ public class CommonServices { } return pinyinFirstLetters.toString(); } + public static void main(String[] arg) { // int sequenceNumber = 123456; // 假设这是你的序号 // String formattedSequence = String.format("%05d", sequenceNumber); diff --git a/appengine/src/main/java/com/currency/appengine/utils/date/DateUtil.java b/appengine/src/main/java/com/currency/appengine/utils/date/DateUtil.java index 68cd1fb..2766257 100644 --- a/appengine/src/main/java/com/currency/appengine/utils/date/DateUtil.java +++ b/appengine/src/main/java/com/currency/appengine/utils/date/DateUtil.java @@ -16,6 +16,7 @@ public class DateUtil { private final static SimpleDateFormat FORMAT_yyyyMMddHHmmss = new SimpleDateFormat("yyyyMMddHHmmss"); private final static SimpleDateFormat FORMAT_yyyyMMdd = new SimpleDateFormat("yyyyMMdd"); + private final static SimpleDateFormat FORMAT_yyMMdd = new SimpleDateFormat("yyMMdd"); /** * 时间戳字符串转换为yyyy-MM-dd HH:mm:ss格式的字符串 * @param timeStr 时间戳 @@ -90,6 +91,10 @@ public class DateUtil { return FORMAT_yyyyMMdd.format(new Date()); } + public static String getYyMMdd() { + return FORMAT_yyMMdd.format(new Date()); + } + /** * 获取当前时间 指定格式 * @param format 时间格式 (例如yyyy-MM-dd HH:mm:ss) diff --git a/appengine/src/main/resources/api_file/api/web管理端API/应收管理/应收表/新增.ms b/appengine/src/main/resources/api_file/api/web管理端API/应收管理/应收表/新增.ms index 123982c..c35e9ef 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/应收管理/应收表/新增.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/应收管理/应收表/新增.ms @@ -5,7 +5,7 @@ "groupId" : "681f3a382ebf4b45a94a17bf7c967968", "name" : "新增", "createTime" : null, - "updateTime" : 1726408511094, + "updateTime" : 1731567501231, "lock" : null, "createBy" : null, "updateBy" : null, diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/产品入库表/新增.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/产品入库表/新增.ms index 53601b5..2a99be4 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/产品入库表/新增.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/产品入库表/新增.ms @@ -5,7 +5,7 @@ "groupId" : "4aa6b5de02c244e2981c22bf5a95394d", "name" : "新增", "createTime" : null, - "updateTime" : 1729160184169, + "updateTime" : 1731737780581, "lock" : null, "createBy" : null, "updateBy" : null, @@ -73,6 +73,7 @@ try{ actual_weight: marerial.actualWeight, unstocked_quantity: marerial.unstockedQuantity, stocked_quantity: marerial.stockedQuantity, + order_no: marerial.orderNo, create_by: createBy }) }) @@ -162,27 +163,52 @@ try{ ON DUPLICATE KEY UPDATE packing_quantity = CASE - WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode} and warehouse = #{item.warehouse} THEN packing_quantity + #{item.warehouseQuantity} + WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode} + and warehouse = #{item.warehouse} and order_no = #{item.orderNo} + THEN packing_quantity + #{item.warehouseQuantity} ELSE packing_quantity END, existing_inventory = CASE - WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode} and warehouse = #{item.warehouse} THEN existing_inventory + #{item.receiptQuantity} + WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode} + and warehouse = #{item.warehouse} and order_no = #{item.orderNo} + THEN existing_inventory + #{item.receiptQuantity} ELSE existing_inventory END, actual_weight = CASE - WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode} and warehouse = #{item.warehouse} THEN actual_weight + #{item.actualWeight} + WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode} + and order_no = #{item.orderNo} and warehouse = #{item.warehouse} + THEN actual_weight + #{item.actualWeight} ELSE actual_weight END """) if (res > 0) { - tx.commit(); // 提交事务 - exit 0, "执行成功", null; + // 更新报工中已入库的数量 + res = db.update(""" + update mini_process_report + SET stock_quantity = CASE + + WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode} + and order_no = #{item.orderNo} + THEN stock_quantity + #{item.receiptQuantity} + + ELSE stock_quantity + END + WHERE is_completed = 1 and sales_order_code in ( + + #{item.salesOrderCode} + + ) + """) + if (res > 0) { + tx.commit(); // 提交事务 + exit 0, "执行成功", null; + } } } tx.rollback(); diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/产品入库表/详情.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/产品入库表/详情.ms index ec907a1..27cc809 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/产品入库表/详情.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/产品入库表/详情.ms @@ -5,7 +5,7 @@ "groupId" : "4aa6b5de02c244e2981c22bf5a95394d", "name" : "详情", "createTime" : null, - "updateTime" : 1729153406281, + "updateTime" : 1731567422340, "lock" : null, "createBy" : null, "updateBy" : null, @@ -52,7 +52,7 @@ return { ${warehouseProductMaterial} from mini_product_receipt mpr left join mini_warehouse_product mwp on mwp.sales_order_code = mpr.sales_order_code - and mwp.material_code = mpr.material_code + and mwp.material_code = mpr.material_code and mwp.order_no = mpr.order_no where 1=1 and mpr.document_number = #{documentNumber} """), diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/修改.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/修改.ms index ab1e9fb..ed74b8b 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/修改.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/修改.ms @@ -5,7 +5,7 @@ "groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a", "name" : "修改", "createTime" : null, - "updateTime" : 1729144854213, + "updateTime" : 1731737082705, "lock" : null, "createBy" : null, "updateBy" : null, @@ -25,10 +25,10 @@ "expression" : null, "children" : null } ], - "requestBody" : "{\r\n \"id\": 2,\r\n \"productionNumber\": 12,\r\n \"productionWeight\": 12,\r\n \"scrapNumber\": 12,\r\n \"scrapReason\": \"243\",\r\n \"frameNumber\": \"123\",\r\n \"nextProcess\": \"yanghua\",\r\n \"isCompleted\": \"\",\r\n \"remarks\": \"11\",\r\n \"reportNumber\": \"20240807\",\r\n \"machine\": \"测试机台2\",\r\n \"operator\": \"张三\",\r\n \"workshop\": \"挤压车间2\",\r\n \"reportDate\": \"2024-09-02 00:00:00\",\r\n \"currentProcess\": \"挤压报工\"\r\n}", + "requestBody" : "{\r\n \"id\": 2772,\r\n \"productionNumber\": 100,\r\n \"productionWeight\": 100,\r\n \"scrapNumber\": 0,\r\n \"scrapReason\": null,\r\n \"frameNumber\": null,\r\n \"nextProcess\": \"yanghua2\",\r\n \"isCompleted\": 0,\r\n \"remarks\": \"\",\r\n \"reportNumber\": \"JY24111500\",\r\n \"machine\": null,\r\n \"operator\": null,\r\n \"workshop\": null,\r\n \"reportDate\": \"2024-11-15\",\r\n \"currentProcess\": \"jiya\",\r\n \"salesOrderCode\": \"KFCS20241114-000\",\r\n \"scheduleNumber\": \"JY20241115006\",\r\n \"profileModel\": \"6430-120\",\r\n \"moldCode\": null,\r\n \"moldModel\": null,\r\n \"moldThickness\": null,\r\n \"moldManufacturer\": null,\r\n \"moldColor\": null,\r\n \"moldChangeReason\": null,\r\n \"rodCount\": null\r\n}", "headers" : [ { "name" : "authorization", - "value" : "5E34C0D7EA601026B93C26119C7E1AD59CF35D76F0DCA5272366FC6A87E41372412D8F4473A6A7BD5E5C1D4E94AEFD40", + "value" : "5E34C0D7EA601026B93C26119C7E1AD5304936225AC6AC0DD5E00182C1DF3624BE38DB349BDC91696CBC04B5F9AB5B53", "description" : "登录token", "required" : false, "dataType" : "String", @@ -40,12 +40,14 @@ "children" : null } ], "paths" : [ ], - "responseBody" : "{\n \"code\": -2,\n \"message\": \"token无效\",\n \"data\": null,\n \"timestamp\": 1726813009589,\n \"executeTime\": null\n}", + "responseBody" : "{\n \"code\": 0,\n \"data\": null,\n \"message\": \"success\"\n}", "description" : null, "requestBodyDefinition" : null, "responseBodyDefinition" : null } ================================ +import 'commonServices' as CommonServices + String id = body.id; String productionNumber = body.productionNumber; String productionWeight = body.productionWeight; @@ -53,10 +55,23 @@ String scrapNumber = body.scrapNumber; String scrapReason = body.scrapReason; String frameNumber = body.frameNumber; String nextProcess = body.nextProcess; +String netReceipts = body.netReceipts; String isCompleted = body.isCompleted; String remarks = body.remarks; -Map map = db.selectOne("select * from mini_process_report where id=#{id}") +String remarks = body.remarks; + +Map map = db.selectOne(""" + select mpr.*, + mesd.production_length, + mesd.production_pieces, + mesd.sawing_method + from mini_process_report mpr + left join mini_extrusion_schedule_detail mesd + on mpr.sales_order_code = mesd.sales_order_code and mpr.material_code = mesd.material_code and mpr.order_no = mesd.order_no + where mpr.id=#{id} + + """) var tx = db.transaction() try { @@ -68,24 +83,49 @@ try { scrap_number: scrapNumber, scrap_reason: scrapReason, frame_number: frameNumber, + net_receipts: netReceipts, next_process: nextProcess, is_completed: isCompleted, remarks: remarks, }) if (res <= 0) { tx.rollback(); - exit -1, "失败" + exit - 1, "失败" } - if ((Objects.isNull(nextProcess) || nextProcess == "")) { + // if ((Objects.isNull(nextProcess) || nextProcess == "")) { + + // if (isCompleted == 1) { + // // 完成更新 + // } + + // tx.commit() + // return; + // } + + if (isCompleted == 1) { - if (isCompleted == 1) { - // 完成更新 - } + // 更新订单表中的生产数量 + res = db.update(""" + update mini_sales_order_materials + SET produced_pieces = produced_pieces + #{map.productionPieces}, + produced_length = produced_length + #{map.productionLength} + WHERE material_code = #{map.materialCode} and sales_order_code = #{map.salesOrderCode} + and order_no = #{map.orderNo} + """) + // 完成更新 tx.commit() return; } + + + // 自动生成编码 + Map codeParams = new HashMap(); + codeParams.put("currentProcess", nextProcess); + map.reportNumber = CommonServices.getCode("ProductionOrderNumberSub", codeParams) + + // 插入新工序 res = db.table("mini_process_report").insert({ schedule_number: map.scheduleNumber, @@ -99,8 +139,16 @@ try { source_number: productionNumber, net_receipts: productionNumber, sales_order_code: map.salesOrderCode, + order_no: map.orderNo, material_code: map.materialCode, frame_number: map.frameNumber, + mold_code: map.moldCode, + mold_model: map.moldModel, + mold_thickness: map.moldThickness, + mold_manufacturer: map.moldManufacturer, + mold_color: map.moldColor, + mold_change_reason: map.moldChangeReason, + rod_count: map.rodCount, }) if (res > 0) { @@ -108,9 +156,10 @@ try { return; } tx.rollback(); - exit -1, "失败" + exit - 1, "失败" return; -} catch(e) { +} catch (e) { + print(e.getMessage()) tx.rollback() - exit -1, "失败" -} + exit - 1, "失败" +} \ No newline at end of file diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/列表.ms index e7866e8..81b0501 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/列表.ms @@ -5,7 +5,7 @@ "groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a", "name" : "列表", "createTime" : null, - "updateTime" : 1730109402968, + "updateTime" : 1731729532436, "lock" : null, "createBy" : null, "updateBy" : null, @@ -57,10 +57,13 @@ report_date String salesOrderCode = body.salesOrderCode; String scheduleNumber = body.scheduleNumber; String reportNumber = body.reportNumber; -String currentProcess = body.currentProcess; +String currentProcess = body.currentProcess; // 当前工序 String reportDate = body.reportDate; String profileModel = body.profileModel; +// 产品代码 型材型号 物料名称 规格型号 壁厚 米重 +// 订单长度(M) 表面方式 订单总数 排产长度(m) 排产支数 排产日期 锯切方式 交货日期 + var sql = """ select mpr.id, @@ -79,10 +82,33 @@ mpr.frame_number, mpr.is_completed, mpr.sales_order_code, mpr.schedule_number, -msm.profile_model +mpr.source_number, +mpr.net_receipts, +mpr.mold_code, +mpr.mold_model, +mpr.mold_thickness, +mpr.mold_manufacturer, +mpr.mold_color, +mpr.mold_change_reason, +mpr.rod_count, +mesd.production_length, +mesd.production_pieces, +mesd.sawing_method, +msm.profile_model, +msm.weight, +msm.specification, +msm.thickness, +msm.order_length, +msm.order_total_quantity, +msm.surface_method, +date_format(msm.delivery_date, '%Y-%m-%d') as delivery_date, +msm.material_code, +msm.material_name from mini_process_report mpr +left join mini_extrusion_schedule_detail mesd + on mpr.sales_order_code = mesd.sales_order_code and mpr.material_code = mesd.material_code and mpr.order_no = mesd.order_no left join mini_sales_order_materials msm - on mpr.sales_order_code = msm.sales_order_code and mpr.material_code = msm.material_code + on mpr.sales_order_code = msm.sales_order_code and mpr.material_code = msm.material_code and mpr.order_no = msm.order_no where 1 = 1 -- and next_process is null ?{salesOrderCode != null and salesOrderCode != '', and mpr.sales_order_code like concat('%', #{salesOrderCode}, '%')} diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/新增.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/新增.ms index 51a3df1..33904be 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/新增.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/新增.ms @@ -5,7 +5,7 @@ "groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a", "name" : "新增", "createTime" : null, - "updateTime" : 1728723877581, + "updateTime" : 1731736113438, "lock" : null, "createBy" : null, "updateBy" : null, @@ -55,9 +55,11 @@ String userId = StringUtil.objectToString(request.get().getAttribute("openid")); // 查询数据库获取对应 userId 的用户名 String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName; +orderInfo.currentProcess = "jiya" + if (orderInfo.isAuto) { // 自动生成编码 - orderInfo.reportNumber = CommonServices.getCode("ProductionOrderNumber", orderInfo) + orderInfo.reportNumber = CommonServices.getCode("ProductionOrderNumberSub", orderInfo) } @@ -73,8 +75,16 @@ try{ report_date: orderInfo.reportDate, current_process: orderInfo.currentProcess, sales_order_code: materialsList.get(0).salesOrderCode, + order_no: materialsList.get(0).orderNo, material_code: materialsList.get(0).materialCode, remarks: orderInfo.remarks, + mold_code: materialsList.get(0).moldCode, + mold_model: materialsList.get(0).moldModel, + mold_thickness: materialsList.get(0).moldThickness, + mold_manufacturer: materialsList.get(0).moldManufacturer, + mold_color: materialsList.get(0).moldColor, + mold_change_reason: materialsList.get(0).moldChangeReason, + rod_count: materialsList.get(0).rodCount, create_by: createBy }) diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/查询完成的列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/查询完成的列表.ms index 7e09fd0..e9eb20e 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/查询完成的列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/工序报工表/查询完成的列表.ms @@ -5,7 +5,7 @@ "groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a", "name" : "查询完成的列表", "createTime" : null, - "updateTime" : 1729148530659, + "updateTime" : 1731737540782, "lock" : null, "createBy" : null, "updateBy" : null, @@ -50,11 +50,12 @@ return db.page(""" mpr.frame_number, mpr.scrap_reason, mpr.remarks , + mpr.stock_quantity, ${salesOrdeSelect} from mini_process_report mpr left join mini_sales_order_materials msm - on mpr.sales_order_code = msm.sales_order_code and mpr.material_code = msm.material_code - where mpr.is_completed = 1 + on mpr.sales_order_code = msm.sales_order_code and mpr.material_code = msm.material_code and mpr.order_no = msm.order_no + where mpr.is_completed = 1 and (mpr.production_number - mpr.stock_quantity) > 0 ?{salesOrderCode != null and salesOrderCode != '', and mpr.sales_order_code like concat('%', #{salesOrderCode}, '%')} ?{materialCode != null and materialCode != '', and mpr.material_code like concat('%', #{materialCode}, '%')} """) \ No newline at end of file diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/修改.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/修改.ms index f21fb8d..91f67ae 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/修改.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/修改.ms @@ -5,7 +5,7 @@ "groupId" : "f4b3acf704cf4db29258ba70e24f8fc5", "name" : "修改", "createTime" : null, - "updateTime" : 1728727443545, + "updateTime" : 1731567308993, "lock" : null, "createBy" : null, "updateBy" : null, @@ -75,6 +75,7 @@ try{ list.add({ schedule_number: orderInfo.scheduleNumber, sales_order_code: marerial.salesOrderCode, + order_no: marerial.orderNo, material_code: marerial.materialCode, production_length: marerial.productionLength, production_pieces: marerial.productionPieces, diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/新增.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/新增.ms index bfeb59d..7511dc3 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/新增.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/新增.ms @@ -5,7 +5,7 @@ "groupId" : "f4b3acf704cf4db29258ba70e24f8fc5", "name" : "新增", "createTime" : null, - "updateTime" : 1728726723475, + "updateTime" : 1731651357563, "lock" : null, "createBy" : null, "updateBy" : null, @@ -75,34 +75,13 @@ try{ if (res > 0) { println("挤压排产单插入成功") - - // res = db.update(""" - // update mini_production_schedule - // SET productioned_pieces = CASE - // - // WHEN material_code = #{item.materialCode} and sales_order_code = #{purchInfo.documentNumber} THEN productioned_pieces + #{item.productionPieces} - // - // ELSE productioned_pieces - // END - // WHERE (sales_order_code, material_code) in ( - // - // (#{purchInfo.documentNumber}, #{item.materialCode}) - // - // ) - // """) - - // if (res <= 0) { - // tx.rollback(); - // println("更新计划表失败") - // exit -1, "提交失败"; - // } List list = new ArrayList(); - List list2 = new ArrayList(); materialsList.map(marerial => { list.add({ schedule_number: orderInfo.scheduleNumber, sales_order_code: marerial.salesOrderCode, + order_no: marerial.orderNo, material_code: marerial.materialCode, production_length: marerial.productionLength, production_pieces: marerial.productionPieces, @@ -114,6 +93,29 @@ try{ res = db.table("mini_extrusion_schedule_detail").batchInsert(list) if (res > 0) { + // 更新计划排产信息 + res = db.update(""" + update mini_production_schedule + SET status = 1, productioned_pieces = CASE + + WHEN order_no = #{item.orderNo} and sales_order_code = #{item.salesOrderCode} + THEN productioned_pieces + #{item.productionPieces} + + ELSE productioned_pieces + END + WHERE (sales_order_code, order_no) in ( + + (#{item.salesOrderCode}, #{item.orderNo}) + + ) + """) + + if (res <= 0) { + tx.rollback(); + println("更新计划表失败", res) + exit -1, "提交失败"; + } + tx.commit(); // 提交事务 exit 0, "执行成功", null; } diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/详情.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/详情.ms index 8a65479..cb205cb 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/详情.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/详情.ms @@ -5,7 +5,7 @@ "groupId" : "f4b3acf704cf4db29258ba70e24f8fc5", "name" : "详情", "createTime" : null, - "updateTime" : 1728728158049, + "updateTime" : 1731567258141, "lock" : null, "createBy" : null, "updateBy" : null, @@ -59,7 +59,7 @@ return { left join sys_user su on su.user_id = mso.salesperson left join mini_customer_info mci on mci.customer_code = mso.customer_id left join mini_sales_order_materials msm - on mesd.sales_order_code = msm.sales_order_code and mesd.material_code = msm.material_code + on mesd.sales_order_code = msm.sales_order_code and mesd.material_code = msm.material_code and mesd.order_no = msm.order_no where 1=1 and mesd.schedule_number=#{scheduleNumber} """), diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/详情列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/详情列表.ms index a7adfb8..835ecc2 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/详情列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/挤压排产表/详情列表.ms @@ -5,7 +5,7 @@ "groupId" : "f4b3acf704cf4db29258ba70e24f8fc5", "name" : "详情列表", "createTime" : null, - "updateTime" : 1730452017745, + "updateTime" : 1731567261894, "lock" : null, "createBy" : null, "updateBy" : null, @@ -557,7 +557,7 @@ return db.page(""" from mini_extrusion_schedule_detail mesd left join mini_sales_order_materials msm - on mesd.sales_order_code = msm.sales_order_code and mesd.material_code = msm.material_code + on mesd.sales_order_code = msm.sales_order_code and mesd.material_code = msm.material_code and mesd.order_no = msm.order_no where 1=1 ?{scheduleNumber != null and scheduleNumber != '', and mesd.schedule_number like concat('%', #{scheduleNumber}, '%')} ?{salesOrderCode != null and salesOrderCode != '', and msm.sales_order_code like concat('%', #{salesOrderCode}, '%')} diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/修改.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/修改.ms index ad74e48..8380308 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/修改.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/修改.ms @@ -5,7 +5,7 @@ "groupId" : "06d35cc5db5f4e6681262a1648c871c3", "name" : "修改", "createTime" : null, - "updateTime" : 1726362872013, + "updateTime" : 1731567452397, "lock" : null, "createBy" : null, "updateBy" : null, @@ -50,10 +50,11 @@ String salesOrderCode = body.salesOrderCode; String materialCode = body.materialCode; String plannedPieces = body.plannedPieces; String remarks = body.remarks; +String orderNo = body.orderNo; return db.update(""" update mini_production_schedule set planned_pieces=#{plannedPieces}, remarks = #{remarks} -where sales_order_code=#{salesOrderCode} and material_code=#{materialCode} +where sales_order_code=#{salesOrderCode} and material_code=#{materialCode} and order_no=#{orderNo} """) \ No newline at end of file diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/列表.ms index 250ae01..ed61804 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/列表.ms @@ -5,7 +5,7 @@ "groupId" : "06d35cc5db5f4e6681262a1648c871c3", "name" : "列表", "createTime" : null, - "updateTime" : 1730451538439, + "updateTime" : 1731643614960, "lock" : null, "createBy" : null, "updateBy" : null, @@ -165,6 +165,8 @@ String deliveryDate = body["deliveryDate"]; String customerName = body["customerName"]; String orderNo = body["orderNo"]; +String orderStatus = body["orderStatus"]; // 订单状态 + String salesOrdeSelect = sql("salesOrder") String sql = """ select @@ -179,6 +181,7 @@ String sql = """ mso.pricing_date, mso.tax_rate, mso.processing_fee, + mps.status as plan_status, ${salesOrdeSelect} from mini_production_schedule mps @@ -186,7 +189,7 @@ String sql = """ left join sys_user su on su.user_id = mso.salesperson left join mini_customer_info mci on mci.customer_code = mso.customer_id left join mini_sales_order_materials msm - on mps.sales_order_code = msm.sales_order_code and mps.material_code = msm.material_code + on mps.sales_order_code = msm.sales_order_code and mps.material_code = msm.material_code and mps.order_no = msm.order_no where 1=1 ?{salesOrderCode != null and salesOrderCode != "", and mps.sales_order_code = #{salesOrderCode}} ?{documentNumber != null and documentNumber != "", and mps.document_number = #{documentNumber}} @@ -196,5 +199,6 @@ String sql = """ ?{orderNo != null and orderNo != "", and msm.order_no like concat('%', #{orderNo}, '%')} ?{deliveryDate != null and deliveryDate != '', and mso.delivery_date = #{deliveryDate}} """; +// ?{orderStatus != null and orderStatus != '', and mps.status = #{orderStatus}} return db.page(sql); diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/新增.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/新增.ms index 8db7b77..d9ff702 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/新增.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/新增.ms @@ -5,7 +5,7 @@ "groupId" : "06d35cc5db5f4e6681262a1648c871c3", "name" : "新增", "createTime" : null, - "updateTime" : 1728724750705, + "updateTime" : 1731575808607, "lock" : null, "createBy" : null, "updateBy" : null, @@ -48,11 +48,33 @@ ================================ import 'commonServices' as CommonServices -List selection = body.selection; +String type = body["type"]; Map orderInfo = body.orderInfo; + +List selection = new ArrayList(); + +// 判断是否一键生成计划单 +if (Objects.nonNull(type) && "once".equals(type)) { + // 一键生成计划单 + // 获取订单物料信息 + selection = db.select(""" + select + msom.id, + msom.sales_order_code, + msom.material_code, + msom.order_no, + msom.order_total_quantity as planned_pieces + from mini_sales_order_materials msom + where 1=1 and msom.sales_order_code = #{orderInfo.documentNumber} + """) +} else { + selection = body['selection']; +} + + Map form = body.form; if (Objects.isNull(selection) || selection.size() <= 0) { - exit -1, "数据为空" + exit - 1, "数据为空" } String userId = StringUtil.objectToString(request.get().getAttribute("openid")); @@ -67,19 +89,20 @@ if (form.isAuto) { } -var tx = db.transaction(); //开启事务 -try{ +var tx = db.transaction(); //开启事务 +try { var res = db.insert(""" insert into mini_production_schedule( document_number, sales_order_code, + order_no, material_code, planned_pieces, remarks, create_by ) values - (#{documentNumber}, #{orderInfo.documentNumber}, #{item.materialCode},#{item.plannedPieces},#{item.remarks},#{createBy}) + (#{documentNumber}, #{orderInfo.documentNumber}, #{item.orderNo}, #{item.materialCode},#{item.plannedPieces},#{item.remarks},#{createBy}) """) if (res > 0) { @@ -88,10 +111,10 @@ try{ """) var res2 = db.update(""" - update mini_sales_order_materials set status=1 - where (sales_order_code, material_code) in ( + update mini_sales_order_materials set status = 1 + where (sales_order_code, order_no) in ( - (#{orderInfo.documentNumber}, #{item.materialCode}) + (#{orderInfo.documentNumber}, #{item.orderNo}) ) """) @@ -102,11 +125,11 @@ try{ } } tx.rollback() - exit -1, "失败" - } catch(e) { + exit - 1, "失败" +} catch (e) { println(e) tx.rollback() - exit -1, "失败" + exit - 1, "失败" } diff --git a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/详情.ms b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/详情.ms index f23fe4b..ba31f70 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/详情.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/生产管理/计划挤压排产管理/详情.ms @@ -5,7 +5,7 @@ "groupId" : "06d35cc5db5f4e6681262a1648c871c3", "name" : "详情", "createTime" : null, - "updateTime" : 1728721582011, + "updateTime" : 1731567386509, "lock" : null, "createBy" : null, "updateBy" : null, @@ -35,7 +35,7 @@ String sql = """ from mini_production_schedule mps left join mini_sales_order_materials msm - on mps.sales_order_code = msm.sales_order_code and mps.material_code = msm.material_code + on mps.sales_order_code = msm.sales_order_code and mps.material_code = msm.material_code and mps.order_no = msm.order_no where 1=1 and mps.sales_order_code = #{salesOrderCode} """; diff --git a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售出货管理/新增.ms b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售出货管理/新增.ms index 2a11643..0b3422b 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售出货管理/新增.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售出货管理/新增.ms @@ -5,7 +5,7 @@ "groupId" : "a170047f79ab4cb1b892edc5cccd823e", "name" : "新增", "createTime" : null, - "updateTime" : 1729825162357, + "updateTime" : 1731743100652, "lock" : null, "createBy" : null, "updateBy" : null, @@ -81,17 +81,38 @@ try{ create_by: createBy, }) + String whSql = "" + if (Objects.nonNull(marerial.warehouse)) { + whSql = "and warehouse=#{marerial.warehouse}" + } else { + whSql = "and warehouse is null" + } // 库存扣除 var res2 = db.update(""" update mini_warehouse_product set existing_inventory = existing_inventory - #{marerial.shipmentQuantity} , actual_weight = actual_weight - #{marerial.actualWeight} - where warehouse=#{marerial.warehouse} and material_code = #{marerial.materialCode} and sales_order_code = #{marerial.salesOrderCode} - """) + where order_no = #{marerial.orderNo} + and material_code = #{marerial.materialCode} and sales_order_code = #{marerial.salesOrderCode} + + """ + whSql) if (res2 <= 0) { tx.rollback(); exit -1, "提交失败"; } + + // 更新销售单 + var res3 = db.update(""" + update mini_sales_order_materials set + shipmentsed_number = shipmentsed_number + #{marerial.shipmentQuantity} + where order_no = #{marerial.orderNo} + and material_code = #{marerial.materialCode} and sales_order_code = #{marerial.salesOrderCode} + """) + print(res3) + if (res3 <= 0) { + tx.rollback(); + exit -1, "提交失败"; + } }) res = db.table("mini_sales_shipment_materials").batchInsert(list) diff --git a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/列表.ms index 46f6a40..5f8ddf4 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/列表.ms @@ -5,7 +5,7 @@ "groupId" : "e631b317606f4246ac82585a7c1f1c5b", "name" : "列表", "createTime" : null, - "updateTime" : 1728721690603, + "updateTime" : 1731574285804, "lock" : null, "createBy" : null, "updateBy" : null, @@ -69,6 +69,7 @@ var sql = """ mso.processing_fee, mso.remarks, mso.create_by, + mso.no_edit, date_format(mso.create_time, '%Y-%m-%d %H:%i:%S') as create_time from mini_sales_orders mso left join sys_user su on su.user_id = mso.salesperson diff --git a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/详情列表.ms b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/详情列表.ms index c0b90f6..83818ef 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/详情列表.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售订单管理/详情列表.ms @@ -5,7 +5,7 @@ "groupId" : "e631b317606f4246ac82585a7c1f1c5b", "name" : "详情列表", "createTime" : null, - "updateTime" : 1726398795041, + "updateTime" : 1731574904886, "lock" : null, "createBy" : null, "updateBy" : null, @@ -62,9 +62,9 @@ return db.page(""" msom.unit_price, msom.order_no, msom.status, - mso.customer_id, - mso.price, - mso.tax_rate + mso.customer_id, + mso.price, + mso.tax_rate from mini_sales_order_materials msom left join mini_sales_orders mso on msom.sales_order_code = mso.document_number where 1=1 diff --git a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售退货管理/新增.ms b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售退货管理/新增.ms index 5184d6c..867e73f 100644 --- a/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售退货管理/新增.ms +++ b/appengine/src/main/resources/api_file/api/web管理端API/销售管理/销售退货管理/新增.ms @@ -5,7 +5,7 @@ "groupId" : "388106ae8a6c473093fbfd5473f6a755", "name" : "新增", "createTime" : null, - "updateTime" : 1726418533973, + "updateTime" : 1731566854289, "lock" : null, "createBy" : null, "updateBy" : null, @@ -83,9 +83,9 @@ try{ // 更新退货数量 res = db.update(""" update mini_sales_order_materials - SET returned_number = CASE material_code + SET returned_number = CASE order_no - WHEN #{item.materialCode} THEN returned_number + #{item.returnQuantity} + WHEN #{item.orderNo} THEN returned_number + #{item.returnQuantity} ELSE returned_number END @@ -104,6 +104,7 @@ try{ sales_return_code: orderInfo.documentNumber, material_code: marerial.materialCode, material_name: marerial.materialName, + order_no: marerial.orderNo, profile_model: marerial.profileModel, weight: marerial.weight, specification: marerial.specification, diff --git a/appengine/src/main/resources/api_file/function/公共/公共sql.ms b/appengine/src/main/resources/api_file/function/公共/公共sql.ms index 248c5be..fbbb7e9 100644 --- a/appengine/src/main/resources/api_file/function/公共/公共sql.ms +++ b/appengine/src/main/resources/api_file/function/公共/公共sql.ms @@ -5,7 +5,7 @@ "groupId" : "c3fc8c12916e40319e19fc434a708a83", "name" : "公共sql", "createTime" : null, - "updateTime" : 1728704818002, + "updateTime" : 1731567002826, "lock" : null, "createBy" : null, "updateBy" : null,