20241012更新

main
lcode 4 weeks ago
parent 3e2cfb234a
commit 89f797ee0e

@ -340,6 +340,12 @@
<version>3.6.5</version> <!-- 请替换为最新版本号 --> <version>3.6.5</version> <!-- 请替换为最新版本号 -->
</dependency> </dependency>
<dependency>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId>
<version>2.5.0</version>
</dependency>
</dependencies> </dependencies>
<repositories> <repositories>

@ -5,6 +5,7 @@ import com.currency.appengine.mapper.common.CommonMapper;
import com.currency.appengine.service.user.impl.UserServiceImpl; import com.currency.appengine.service.user.impl.UserServiceImpl;
import com.currency.appengine.utils.LockUtils; import com.currency.appengine.utils.LockUtils;
import com.currency.appengine.utils.date.DateUtil; import com.currency.appengine.utils.date.DateUtil;
import net.sourceforge.pinyin4j.PinyinHelper;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -12,6 +13,7 @@ import org.springframework.stereotype.Service;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Objects;
import java.util.function.Function; import java.util.function.Function;
@Service @Service
@ -21,6 +23,12 @@ public class CommonServices {
@Autowired @Autowired
CommonMapper commonMapper; CommonMapper commonMapper;
/**
*
* @param type
* @param data
* @return
*/
public String getCode(String type, Map<String, Object> data) { public String getCode(String type, Map<String, Object> data) {
Map<String, Function<Map<String, Object>,String>> grantTypeMap = new HashMap<>(); Map<String, Function<Map<String, Object>,String>> grantTypeMap = new HashMap<>();
@ -50,8 +58,17 @@ public class CommonServices {
public String customerCode(Map<String, Object> params) { public String customerCode(Map<String, Object> params) {
try { try {
return LockUtils.doWithLock(() -> { return LockUtils.doWithLock(() -> {
int count = commonMapper.count("mini_customer_info", null, null); // int count = commonMapper.count("mini_customer_info", null, null);
return "C" + formatNumber(count, "5"); Map<String, Object> map = commonMapper
.findOne("select * from mini_customer_info where code_auto=1 order by id desc", null);
String customerCode = "C0";
if (Objects.nonNull(map.get("customerCode"))) {
customerCode = String.valueOf(map.get("customerCode"));
}
Integer number = Integer.parseInt(customerCode.replace("C", "")) + 1;
return "C" + formatNumber(number, "5");
}); });
} catch (Exception e) { } catch (Exception e) {
return null; return null;
@ -66,8 +83,18 @@ public class CommonServices {
public String supplierCode(Map<String, Object> params) { public String supplierCode(Map<String, Object> params) {
try { try {
return LockUtils.doWithLock(() -> { return LockUtils.doWithLock(() -> {
int count = commonMapper.count("mini_supplier_info", null, null); // int count = commonMapper.count("mini_supplier_info", null, null);
return "V" + formatNumber(count, "5"); // return "V" + formatNumber(count, "5");
Map<String, Object> map = commonMapper
.findOne("select * from mini_supplier_info where code_auto=1 order by id desc", null);
String supplierCode = "V0";
if (Objects.nonNull(map.get("supplierCode"))) {
supplierCode = String.valueOf(map.get("supplierCode"));
}
Integer number = Integer.parseInt(supplierCode.replace("V", "")) + 1;
return "V" + formatNumber(number, "5");
}); });
} catch (Exception e) { } catch (Exception e) {
return null; return null;
@ -80,9 +107,17 @@ public class CommonServices {
* @return * @return
*/ */
public String salesOrderNumber(Map<String, Object> params) { public String salesOrderNumber(Map<String, Object> params) {
try {
return LockUtils.doWithLock(() -> {
String customerName = String.valueOf(params.get("customerName"));
String customerNamePY = toPinyinFirstLetter(customerName).toUpperCase();
int count = commonMapper.count("mini_sales_orders", "date(create_time) = curdate()", null);
return customerNamePY + DateUtil.getYyyyMMdd() + "-" + formatNumber(count, "3");
});
} catch (Exception e) {
return null; return null;
} }
}
/** /**
* +0010100102 * +0010100102
@ -90,9 +125,16 @@ public class CommonServices {
* @return * @return
*/ */
public String orderNumber(Map<String, Object> params) { public String orderNumber(Map<String, Object> params) {
try {
return LockUtils.doWithLock(() -> {
String documentNumber = String.valueOf(params.get("documentNumber"));
Integer index = Integer.valueOf(String.valueOf(params.get("index")));
return documentNumber.substring(documentNumber.length() - 3) + formatNumber(index, "2");
});
} catch (Exception e) {
return null; return null;
} }
}
/** /**
* :P+3 * :P+3
@ -127,15 +169,15 @@ public class CommonServices {
} }
/** /**
* JY++3 * BG++3
* @param params * @param params
* @return * @return
*/ */
public String productionOrderNumber(Map<String, Object> params) { public String productionOrderNumber(Map<String, Object> params) {
try { try {
return LockUtils.doWithLock(() -> { return LockUtils.doWithLock(() -> {
int count = commonMapper.count("mini_extrusion_schedule", "date(create_time) = curdate()", null); int count = commonMapper.count("mini_process_report", "date(create_time) = curdate()", null);
return "JY" + DateUtil.getYyyyMMdd() + formatNumber(count, "3"); return "BG" + DateUtil.getYyyyMMdd() + formatNumber(count, "3");
}); });
} catch (Exception e) { } catch (Exception e) {
return null; return null;
@ -162,10 +204,23 @@ public class CommonServices {
return String.format("%0" + digit + "d", number); return String.format("%0" + digit + "d", number);
} }
public static String toPinyinFirstLetter(String chinese) {
StringBuilder pinyinFirstLetters = new StringBuilder();
for (char c : chinese.toCharArray()) {
String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(c);
if (pinyinArray != null) {
pinyinFirstLetters.append(pinyinArray[0].charAt(0));
} else {
pinyinFirstLetters.append(c);
}
}
return pinyinFirstLetters.toString();
}
public static void main(String[] arg) { public static void main(String[] arg) {
int sequenceNumber = 123456; // 假设这是你的序号 // int sequenceNumber = 123456; // 假设这是你的序号
String formattedSequence = String.format("%05d", sequenceNumber); // String formattedSequence = String.format("%05d", sequenceNumber);
System.out.println(formattedSequence); // 输出00123 // System.out.println(formattedSequence); // 输出00123
System.out.println(toPinyinFirstLetter("你好").toUpperCase());
} }
} }

@ -5,7 +5,7 @@
"groupId" : "40879f3a602c40e493f0b273de9fc01e", "groupId" : "40879f3a602c40e493f0b273de9fc01e",
"name" : "列表仓库产品", "name" : "列表仓库产品",
"createTime" : null, "createTime" : null,
"updateTime" : 1726399986194, "updateTime" : 1728714345936,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -47,46 +47,56 @@
} }
================================ ================================
String warehouse = body.warehouse; String customerName = body.customerName;
String materialCode = body.materialCode; String materialCode = body.materialCode;
String materialName = body.materialName;
String profileModel = body.profileModel;
String warehouse = body.warehouse;
String salesOrderCode = body.salesOrderCode;
return db.page(""" return db.page("""
select select
sales_order_code, mwp.sales_order_code,
material_code, mwp.material_code,
material_name, mwp.material_name,
profile_model, mwp.profile_model,
weight, mwp.weight,
specification, mwp.specification,
thickness, mwp.thickness,
pieces_bundle, mwp.pieces_bundle,
material_category, mwp.material_category,
default_length, mwp.default_length,
packaging_method, mwp.packaging_method,
source, mwp.source,
unit, mwp.unit,
order_length, mwp.order_length,
order_total_quantity, mwp.order_total_quantity,
surface_method, mwp.surface_method,
theoretical_weight_per_piece, mwp.theoretical_weight_per_piece,
theoretical_weight, mwp.theoretical_weight,
packing_quantity, mwp.packing_quantity,
date_format(delivery_date, '%Y-%m-%d %H:%i:%S') as delivery_date, date_format(mwp.delivery_date, '%Y-%m-%d %H:%i:%S') as delivery_date,
customer_material_code, mwp.customer_material_code,
produced_pieces, mwp.produced_pieces,
produced_length, mwp.produced_length,
price_with_tax, mwp.price_with_tax,
amount_with_tax, mwp.amount_with_tax,
remark, mwp.remark,
shipmentsed_number, mwp.shipmentsed_number,
returned_number, mwp.returned_number,
unit_price, mwp.unit_price,
order_no, mwp.order_no,
existing_inventory, mwp.existing_inventory,
customer_id, mwp.customer_id,
warehouse mwp.warehouse,
from mini_warehouse_product mci.customer_name
from mini_warehouse_product mwp
left join mini_customer_info mci on mci.customer_code = mwp.customer_id
where 1=1 where 1=1
?{warehouse!= null and warehouse !="", and warehouse=#{warehouse}} ?{customerName!= null and customerName != "", and mci.customer_name like concat('%', #{customerName}, '%')}
?{materialCode!= null and materialCode !="", and material_code=#{materialCode}} ?{materialCode != null and materialCode != "", and mwp.material_code like concat('%', #{materialCode}, '%') }
?{materialName != null and materialName != "", and mwp.material_name like concat('%', #{materialName}, '%') }
?{profileModel != null and profileModel != "", and mwp.profile_model like concat('%', #{profileModel}, '%') }
?{warehouse != null and warehouse != "", and mwp.warehouse = #{warehouse} }
?{salesOrderCode != null and salesOrderCode != "", and mwp.sales_order_code like concat('%', #{salesOrderCode}, '%') }
"""); """);

@ -5,7 +5,7 @@
"groupId" : "40879f3a602c40e493f0b273de9fc01e", "groupId" : "40879f3a602c40e493f0b273de9fc01e",
"name" : "列表仓库物料", "name" : "列表仓库物料",
"createTime" : null, "createTime" : null,
"updateTime" : 1726399787648, "updateTime" : 1728715379207,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -47,44 +47,45 @@
} }
================================ ================================
String isProduct = isProduct;
String warehouse = body.warehouse;
String supplier = body.supplier;
String materialCode = body.materialCode; String materialCode = body.materialCode;
String materialName = body.materialName;
String profileModel = body.profileModel;
String warehouse = body.warehouse;
return db.page(""" return db.page("""
select select
id, mwm.id,
material_code, mwm.material_code,
material_name, mwm.material_name,
profile_model, mwm.profile_model,
weight, mwm.weight,
specification, mwm.specification,
thickness, mwm.thickness,
pieces_bundle, mwm.pieces_bundle,
material_category, mwm.material_category,
default_length, mwm.default_length,
packaging_method, mwm.packaging_method,
source, mwm.source,
unit, mwm.unit,
remarks, mwm.remarks,
theoretical_weight, mwm.theoretical_weight,
actual_weight, mwm.actual_weight,
supplier_net_weight, mwm.supplier_net_weight,
unit_price, mwm.unit_price,
amount, mwm.amount,
tax_rate, mwm.tax_rate,
price_with_tax, mwm.price_with_tax,
amount_with_tax, mwm.amount_with_tax,
pricing_method, mwm.pricing_method,
existing_inventory, mwm.existing_inventory,
supplier, mwm.supplier,
warehouse, mwm.warehouse,
create_by, mwm.create_by,
pieces mwm.pieces
from mini_warehouse_material from mini_warehouse_material mwm
where 1=1 where 1=1
?{warehouse!= null and warehouse !="", and warehouse=#{warehouse}} ?{materialCode != null and materialCode != "", and mwm.material_code like concat('%', #{materialCode}, '%') }
?{supplier!= null and supplier !="", and supplier=#{supplier}} ?{materialName != null and materialName != "", and mwm.material_name like concat('%', #{materialName}, '%') }
?{materialCode!= null and materialCode !="", and material_code=#{materialCode}} ?{profileModel != null and profileModel != "", and mwm.profile_model like concat('%', #{profileModel}, '%') }
?{warehouse != null and warehouse != "", and mwm.warehouse = #{warehouse} }
"""); """);

@ -5,7 +5,7 @@
"groupId" : "d13d50f1c9af4220979e387ad95c1f9b", "groupId" : "d13d50f1c9af4220979e387ad95c1f9b",
"name" : "列表", "name" : "列表",
"createTime" : null, "createTime" : null,
"updateTime" : 1724464450074, "updateTime" : 1728651484719,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -53,7 +53,7 @@ String contactPerson = body.contactPerson;
String status = body.status; String status = body.status;
var sql = """ var sql = """
select id, supplier_name, settlement_currency, tax, is_tax_included, contact_phone, address, contact_person, status, remarks, create_by, date_format(create_time, '%Y-%m-%d %H:%i:%S') as create_time select id, supplier_code, supplier_name, settlement_currency, tax, is_tax_included, contact_phone, address, contact_person, status, remarks, create_by, date_format(create_time, '%Y-%m-%d %H:%i:%S') as create_time
from mini_supplier_info from mini_supplier_info
where 1 = 1 where 1 = 1
?{supplierName != null and supplierName != '', and supplier_name like concat('%', #{supplierName}, '%')} ?{supplierName != null and supplierName != '', and supplier_name like concat('%', #{supplierName}, '%')}

@ -5,7 +5,7 @@
"groupId" : "d13d50f1c9af4220979e387ad95c1f9b", "groupId" : "d13d50f1c9af4220979e387ad95c1f9b",
"name" : "删除", "name" : "删除",
"createTime" : null, "createTime" : null,
"updateTime" : 1726040144872, "updateTime" : 1728652181152,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -58,6 +58,6 @@ if (Objects.nonNull(type) && "batch".equals(type)) {
"""); """);
} else { } else {
return db.update(""" return db.update("""
ddelete from mini_supplier_info where id = #{id} delete from mini_supplier_info where id = #{id}
"""); """);
} }

@ -5,7 +5,7 @@
"groupId" : "d13d50f1c9af4220979e387ad95c1f9b", "groupId" : "d13d50f1c9af4220979e387ad95c1f9b",
"name" : "新增", "name" : "新增",
"createTime" : null, "createTime" : null,
"updateTime" : 1724482009990, "updateTime" : 1728652483911,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -25,10 +25,10 @@
"expression" : null, "expression" : null,
"children" : null "children" : null
} ], } ],
"requestBody" : "", "requestBody" : "{\r\n \"supplierCode\": \"\",\r\n \"isAuto\": true,\r\n \"supplierName\": \"sd22\",\r\n \"settlementCurrency\": \"CNY\",\r\n \"tax\": \"tax1\",\r\n \"isTaxIncluded\": 0,\r\n \"contactPhone\": \"\",\r\n \"address\": \"\",\r\n \"contactPerson\": \"\",\r\n \"status\": 1,\r\n \"remarks\": \"\"\r\n}",
"headers" : [ { "headers" : [ {
"name" : "authorization", "name" : "authorization",
"value" : null, "value" : "5E34C0D7EA601026B93C26119C7E1AD57BDC4F4DD7836B6F883430E388E7D8A0704B7E0E35AAA6410EEFECDD2A2E5988",
"description" : "登录token", "description" : "登录token",
"required" : false, "required" : false,
"dataType" : "String", "dataType" : "String",
@ -46,6 +46,12 @@
"responseBodyDefinition" : null "responseBodyDefinition" : null
} }
================================ ================================
import 'commonServices' as CommonServices
Boolean isAuto = body.isAuto; // 是否自动生成编码 1-自动生成 0-非自动生成
String supplierCode = body.supplierCode;
String supplierName = body.supplierName; String supplierName = body.supplierName;
String settlementCurrency = body.settlementCurrency; String settlementCurrency = body.settlementCurrency;
String tax = body.tax; String tax = body.tax;
@ -59,6 +65,30 @@ String userId = StringUtil.objectToString(request.get().getAttribute("openid"));
// 查询数据库获取对应 userId 的用户名 // 查询数据库获取对应 userId 的用户名
String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName; String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName;
return db.insert(""" Map map = db.selectOne("select * from mini_supplier_info where supplier_name=#{supplierName}")
insert into mini_supplier_info(supplier_name, settlement_currency, tax, is_tax_included, contact_phone, address, contact_person, status, remarks, create_by ) values(#{supplierName}, #{settlementCurrency}, #{tax}, #{isTaxIncluded}, #{contactPhone}, #{address}, #{contactPerson}, #{status}, #{remarks}, #{createBy} ) if (map != null) {
"""); exit -1, "供应商已存在!"
}
if (isAuto) {
// 自动生成编码
supplierCode = CommonServices.getCode("SupplierCode", null)
}
return db.table("mini_supplier_info").insert({
code_auto: isAuto,
supplier_code: supplierCode,
supplier_name: supplierName,
settlement_currency: settlementCurrency,
tax: tax,
is_tax_included: isTaxIncluded,
contact_phone: contactPhone,
address: address,
contact_person: contactPerson,
status: status,
remarks: remarks
})
// return db.insert("""
// insert into mini_supplier_info(supplier_name, settlement_currency, tax, is_tax_included, contact_phone, address, contact_person, status, remarks, create_by ) values(#{supplierName}, #{settlementCurrency}, #{tax}, #{isTaxIncluded}, #{contactPhone}, #{address}, #{contactPerson}, #{status}, #{remarks}, #{createBy} )
// """);

@ -5,7 +5,7 @@
"groupId" : "13ae727775794bbf8ce3cf71bfe5feef", "groupId" : "13ae727775794bbf8ce3cf71bfe5feef",
"name" : "关联表下拉", "name" : "关联表下拉",
"createTime" : null, "createTime" : null,
"updateTime" : 1727704108834, "updateTime" : 1728701598542,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -180,12 +180,20 @@ var config = {
"where": " status = 1 ", "where": " status = 1 ",
"orderBy": "" "orderBy": ""
}, },
// 机台
"production_machines": {
"table": "mini_production_machines",
"value": "machine_code",
"label": "machine_name",
"where": " status = 1 ",
"orderBy": ""
},
// 客户 // 客户
"customer_info": { "customer_info": {
"custom": true, "custom": true,
"sql": """ "sql": """
select concat_ws('', mci.id) as value, mci.customer_name as label, md.dictionary as tax from mini_customer_info mci select mci.customer_code as value, mci.customer_name as label, cast(replace(md.dictionary, '%', '') as decimal(10, 2)) * 0.01 as tax from mini_customer_info mci
left join mini_dictionary md on md.code = mci.tax and md.`type` = 'tax' where mci.status = 1 left join mini_dictionary md on md.code = mci.tax and md.`type` = 'tax' where mci.status = 1 and mci.customer_code is not null
""" """
}, },
"surface_methods": { "surface_methods": {

@ -5,7 +5,7 @@
"groupId" : "4aa6b5de02c244e2981c22bf5a95394d", "groupId" : "4aa6b5de02c244e2981c22bf5a95394d",
"name" : "列表", "name" : "列表",
"createTime" : null, "createTime" : null,
"updateTime" : 1726399750667, "updateTime" : 1728712962029,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -59,7 +59,7 @@ return db.page("""
mpr.total_weight, mpr.total_weight,
mpr.remarks mpr.remarks
from mini_product_receipt mpr from mini_product_receipt mpr
left join mini_customer_info mci on mci.id = mpr.customer_id left join mini_customer_info mci on mci.customer_code = mpr.customer_id
where 1=1 where 1=1
?{documentNumber!=null && documentNumber!="", and mpr.document_number like concat('%', #{documentNumber} ,'%') } group by mpr.document_number ?{documentNumber!=null && documentNumber!="", and mpr.document_number like concat('%', #{documentNumber} ,'%') } group by mpr.document_number
"""); """);

@ -5,7 +5,7 @@
"groupId" : "4aa6b5de02c244e2981c22bf5a95394d", "groupId" : "4aa6b5de02c244e2981c22bf5a95394d",
"name" : "新增", "name" : "新增",
"createTime" : null, "createTime" : null,
"updateTime" : 1726398617960, "updateTime" : 1728712359983,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -58,11 +58,11 @@ try{
List list = new ArrayList(); List list = new ArrayList();
materialsList.map(marerial => { materialsList.map(marerial => {
list.add({ list.add({
sales_order_number: marerial.salesOrderNumber, sales_order_code: marerial.salesOrderCode,
material_code: marerial.materialCode, material_code: marerial.materialCode,
document_number: orderInfo.documentNumber, document_number: orderInfo.documentNumber,
receipt_date: orderInfo.receiptDate, receipt_date: orderInfo.receiptDate,
customerId: orderInfo.customerId, customer_id: orderInfo.customerId,
workshop: orderInfo.workshop, workshop: orderInfo.workshop,
frame_number: orderInfo.frameNumber, frame_number: orderInfo.frameNumber,
total_weight: orderInfo.totalWeight, total_weight: orderInfo.totalWeight,

@ -5,7 +5,7 @@
"groupId" : "4aa6b5de02c244e2981c22bf5a95394d", "groupId" : "4aa6b5de02c244e2981c22bf5a95394d",
"name" : "详情", "name" : "详情",
"createTime" : null, "createTime" : null,
"updateTime" : 1726394692471, "updateTime" : 1728712748680,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -24,38 +24,35 @@
================================ ================================
import '@/common/sql' as sql import '@/common/sql' as sql
String warehouseMaterial = sql("warehouseMaterial") String salesOrder = sql("salesOrder")
String documentNumber = body.documentNumber; String documentNumber = body.documentNumber;
return { return {
orderInfo: db.selectOne(""" orderInfo: db.selectOne("""
select select
document_number, document_number,
receipt_date, date_format(receipt_date, '%Y-%m-%d') as receipt_date,
customer, customer_id,
workshop, workshop,
frame_number, frame_number,
total_weight, total_weight,
remarks remarks
from mini_product_receipt from mini_product_receipt
where 1=1 where 1=1
?{documentNumber!=null && documentNumber!="", and document_number like concat('%', #{documentNumber} ,'%') } group by document_number and document_number=#{documentNumber} group by document_number
"""), """),
materials: db.select(""" materials: db.select("""
select select
mpr.document_number, mpr.document_number,
mpr.sales_order_number,
mpr.material_code
mpr.receipt_warehouse,
mpr.receipt_quantity, mpr.receipt_quantity,
mpr.packaging_quantity, mpr.packing_quantity,
mpr.actual_weight, mpr.actual_weight,
mpr.unstocked_quantity, mpr.unstocked_quantity,
mpr.stocked_quantity, mpr.stocked_quantity,
${warehouseMaterial} ${salesOrder}
from mini_product_receipt mso from mini_product_receipt mpr
left join mini_sales_orders mso on mso.sales_order_number = mpr.sales_order_number left join mini_sales_order_materials msm on msm.sales_order_code = mpr.sales_order_code
and mwm.material_code = mmr.material_code and msm.material_code = mpr.material_code
where 1=1 where 1=1
and mpr.document_number = #{documentNumber} and mpr.document_number = #{documentNumber}
"""), """),

@ -5,7 +5,7 @@
"groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a", "groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a",
"name" : "新增", "name" : "新增",
"createTime" : null, "createTime" : null,
"updateTime" : 1726372031701, "updateTime" : 1728723877581,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -46,6 +46,8 @@
"responseBodyDefinition" : null "responseBodyDefinition" : null
} }
================================ ================================
import 'commonServices' as CommonServices
Map orderInfo = body.orderInfo; Map orderInfo = body.orderInfo;
List materialsList = body.materials List materialsList = body.materials
@ -53,11 +55,18 @@ String userId = StringUtil.objectToString(request.get().getAttribute("openid"));
// 查询数据库获取对应 userId 的用户名 // 查询数据库获取对应 userId 的用户名
String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName; String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName;
if (orderInfo.isAuto) {
// 自动生成编码
orderInfo.reportNumber = CommonServices.getCode("ProductionOrderNumber", orderInfo)
}
var tx = db.transaction(); //开启事务 var tx = db.transaction(); //开启事务
try{ try{
int res = db.table("mini_process_report").insert({ int res = db.table("mini_process_report").insert({
schedule_number: materialsList.get(0).scheduleNumber, schedule_number: materialsList.get(0).scheduleNumber,
report_number: orderInfo.reportNumber, report_number: orderInfo.reportNumber,
code_auto: orderInfo.isAuto,
machine: orderInfo.machine, machine: orderInfo.machine,
operator: orderInfo.operator, operator: orderInfo.operator,
workshop: orderInfo.workshop, workshop: orderInfo.workshop,

@ -4,8 +4,8 @@
"script" : null, "script" : null,
"groupId" : "f4b3acf704cf4db29258ba70e24f8fc5", "groupId" : "f4b3acf704cf4db29258ba70e24f8fc5",
"name" : "修改", "name" : "修改",
"createTime" : 1725173227511, "createTime" : null,
"updateTime" : null, "updateTime" : 1728727443545,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -25,10 +25,10 @@
"expression" : null, "expression" : null,
"children" : null "children" : null
} ], } ],
"requestBody" : "", "requestBody" : "{\r\n \"materials\": [\r\n {\r\n \"id\": 1677,\r\n \"documentNumber\": \"BG20241012002\",\r\n \"plannedPieces\": 1,\r\n \"remarks\": \"\",\r\n \"salesDate\": \"2024-10-18\",\r\n \"customerName\": \"测试44\",\r\n \"salespersonName\": \"超级管理员\",\r\n \"price\": null,\r\n \"pricingDate\": 1730304000000,\r\n \"taxRate\": \"0.09\",\r\n \"processingFee\": null,\r\n \"orderNo\": \"00501\",\r\n \"salesOrderCode\": \"CS4420241012-005\",\r\n \"materialCode\": \"JY646391\",\r\n \"materialName\": \"SW-171不打孔\",\r\n \"profileModel\": \"SH-045\",\r\n \"weight\": 0.2,\r\n \"specification\": \"32*14.0\",\r\n \"thickness\": 1,\r\n \"piecesBundle\": 25,\r\n \"materialCategory\": \"型材系列\",\r\n \"defaultLength\": 6,\r\n \"packagingMethod\": \"6\",\r\n \"source\": \"source2\",\r\n \"unit\": \"支\",\r\n \"orderLength\": 1,\r\n \"orderTotalQuantity\": 1,\r\n \"surfaceMethod\": null,\r\n \"theoreticalWeightPerPiece\": 0.2,\r\n \"theoreticalWeight\": null,\r\n \"packingQuantity\": 0,\r\n \"deliveryDate\": \"2024-10-29\",\r\n \"customerMaterialCode\": null,\r\n \"producedPieces\": 0,\r\n \"producedLength\": 0,\r\n \"priceWithTax\": 0,\r\n \"amountWithTax\": 0,\r\n \"shipmentsedNumber\": 0,\r\n \"returnedNumber\": null,\r\n \"status\": 1,\r\n \"productionLength\": 1,\r\n \"productionPieces\": 1,\r\n \"pieces\": null,\r\n \"productionWeight\": 0.2,\r\n \"undeliveredQuantity\": 1\r\n },\r\n {\r\n \"id\": 1676,\r\n \"documentNumber\": \"BG20241012002\",\r\n \"plannedPieces\": 1,\r\n \"remarks\": \"\",\r\n \"salesDate\": \"2024-10-18\",\r\n \"customerName\": \"测试44\",\r\n \"salespersonName\": \"超级管理员\",\r\n \"price\": null,\r\n \"pricingDate\": 1730304000000,\r\n \"taxRate\": \"0.09\",\r\n \"processingFee\": null,\r\n \"orderNo\": \"00500\",\r\n \"salesOrderCode\": \"CS4420241012-005\",\r\n \"materialCode\": \"JY646390\",\r\n \"materialName\": \"SW-170不打孔\",\r\n \"profileModel\": \"SH-044\",\r\n \"weight\": 0.19,\r\n \"specification\": \"30*12.6\",\r\n \"thickness\": 0.9,\r\n \"piecesBundle\": 20,\r\n \"materialCategory\": \"型材系列\",\r\n \"defaultLength\": 6,\r\n \"packagingMethod\": \"6\",\r\n \"source\": \"source1\",\r\n \"unit\": \"支\",\r\n \"orderLength\": 1,\r\n \"orderTotalQuantity\": 1,\r\n \"surfaceMethod\": null,\r\n \"theoreticalWeightPerPiece\": 0.19,\r\n \"theoreticalWeight\": null,\r\n \"packingQuantity\": 0,\r\n \"deliveryDate\": \"2024-10-29\",\r\n \"customerMaterialCode\": null,\r\n \"producedPieces\": 0,\r\n \"producedLength\": 0,\r\n \"priceWithTax\": 0,\r\n \"amountWithTax\": 0,\r\n \"shipmentsedNumber\": 0,\r\n \"returnedNumber\": null,\r\n \"status\": 1,\r\n \"productionLength\": 1,\r\n \"productionPieces\": 1,\r\n \"pieces\": null,\r\n \"productionWeight\": 0.19,\r\n \"undeliveredQuantity\": 1\r\n }\r\n ],\r\n \"orderInfo\": {\r\n \"scheduleNumber\": \"44\",\r\n \"isAuto\": true,\r\n \"extrusionDate\": \"2024-09-07\",\r\n \"extrusionMachine\": \"sdf\",\r\n \"extrusionTeam\": \"zv\",\r\n \"remarks\": null\r\n }\r\n}",
"headers" : [ { "headers" : [ {
"name" : "authorization", "name" : "authorization",
"value" : null, "value" : "5E34C0D7EA601026B93C26119C7E1AD57BDC4F4DD7836B6F883430E388E7D8A0704B7E0E35AAA6410EEFECDD2A2E5988",
"description" : "登录token", "description" : "登录token",
"required" : false, "required" : false,
"dataType" : "String", "dataType" : "String",
@ -40,20 +40,61 @@
"children" : null "children" : null
} ], } ],
"paths" : [ ], "paths" : [ ],
"responseBody" : null, "responseBody" : "{\n \"code\": -1,\n \"data\": null,\n \"message\": \"提交失败\"\n}",
"description" : null, "description" : null,
"requestBodyDefinition" : null, "requestBodyDefinition" : null,
"responseBodyDefinition" : null "responseBodyDefinition" : null
} }
================================ ================================
String id = body.id; Map orderInfo = body.orderInfo;
String createBy = body.createBy; var materialsList = body.materials
String extrusionDate = body.extrusionDate;
String extrusionMachine = body.extrusionMachine; String userId = StringUtil.objectToString(request.get().getAttribute("openid"));
String extrusionTeam = body.extrusionTeam; // 查询数据库获取对应 userId 的用户名
String remarks = body.remarks; String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName;
String scheduleNumber = body.scheduleNumber;
var tx = db.transaction(); //开启事务
return db.update(""" try{
update mini_extrusion_schedule set create_by = #{createBy}, extrusion_date = #{extrusionDate}, extrusion_machine = #{extrusionMachine}, extrusion_team = #{extrusionTeam}, remarks = #{remarks}, schedule_number = #{scheduleNumber} where id = #{id} int res = db.table("mini_extrusion_schedule").primary("schedule_number")
"""); .update({
schedule_number: orderInfo.scheduleNumber,
extrusion_date: orderInfo.extrusionDate,
extrusion_machine: orderInfo.extrusionMachine,
extrusion_team: orderInfo.extrusionTeam,
remarks: orderInfo.remarks
})
if (res > 0) {
println("挤压排产单插入成功")
db.update("delete from mini_extrusion_schedule_detail where schedule_number = #{orderInfo.scheduleNumber}")
List list = new ArrayList();
List list2 = new ArrayList();
materialsList.map(marerial => {
list.add({
schedule_number: orderInfo.scheduleNumber,
sales_order_code: marerial.salesOrderCode,
material_code: marerial.materialCode,
production_length: marerial.productionLength,
production_pieces: marerial.productionPieces,
sawing_method: marerial.sawingMethod,
create_by: createBy
})
})
res = db.table("mini_extrusion_schedule_detail").batchInsert(list)
if (res > 0) {
tx.commit(); // 提交事务
exit 0, "执行成功", null;
}
}
tx.rollback();
exit -1, "提交失败";
}catch(e){
println(e.getMessage())
tx.rollback(); // 回滚事务
exit -1, "提交失败";
}

@ -5,7 +5,7 @@
"groupId" : "f4b3acf704cf4db29258ba70e24f8fc5", "groupId" : "f4b3acf704cf4db29258ba70e24f8fc5",
"name" : "列表", "name" : "列表",
"createTime" : null, "createTime" : null,
"updateTime" : 1727705149191, "updateTime" : 1728727705064,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -53,19 +53,23 @@ String extrusionTeam = body.extrusionTeam;
var sql = """ var sql = """
select select
id, mes.id,
schedule_number, mes.schedule_number,
date_format(extrusion_date, '%Y-%m-%d') as extrusion_date, date_format(mes.extrusion_date, '%Y-%m-%d') as extrusion_date,
extrusion_machine, mes.extrusion_machine,
extrusion_team, mpm.machine_name as extrusion_machine_name,
remarks mes.extrusion_team,
su.user_name as extrusion_team_name,
mes.remarks
from from
mini_extrusion_schedule mini_extrusion_schedule mes
left join sys_user su on su.user_id = mes.extrusion_team
left join mini_production_machines mpm on mpm.machine_code = mes.extrusion_machine
where 1=1 where 1=1
?{scheduleNumber!=null && scheduleNumber!="", and schedule_number like concat('%', #{scheduleNumber} ,'%') } ?{scheduleNumber!=null && scheduleNumber!="", and mes.schedule_number like concat('%', #{scheduleNumber} ,'%') }
?{extrusionDate!=null && extrusionDate!="", and extrusion_date like concat('%', #{extrusionDate} ,'%') } ?{extrusionDate!=null && extrusionDate!="", and date(mes.extrusion_date) = #{extrusionDate} }
?{extrusionMachine!=null && extrusionMachine!="", and extrusion_machine like concat('%', #{extrusionMachine} ,'%') } ?{extrusionMachine!=null && extrusionMachine!="", and mes.extrusion_machine = #{extrusionMachine} }
?{extrusionTeam!=null && extrusionTeam!="", and extrusion_team like concat('%', #{extrusionTeam} ,'%') } ?{extrusionTeam!=null && extrusionTeam!="", and mes.extrusion_team = #{extrusionTeam} }
""" """
return db.page(sql); return db.page(sql);

@ -5,7 +5,7 @@
"groupId" : "f4b3acf704cf4db29258ba70e24f8fc5", "groupId" : "f4b3acf704cf4db29258ba70e24f8fc5",
"name" : "新增", "name" : "新增",
"createTime" : null, "createTime" : null,
"updateTime" : 1726367805520, "updateTime" : 1728726723475,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -46,18 +46,26 @@
"responseBodyDefinition" : null "responseBodyDefinition" : null
} }
================================ ================================
import 'commonServices' as CommonServices
Map orderInfo = body.orderInfo; Map orderInfo = body.orderInfo;
Map purchInfo = body.purchInfo;
var materialsList = body.materials var materialsList = body.materials
String userId = StringUtil.objectToString(request.get().getAttribute("openid")); String userId = StringUtil.objectToString(request.get().getAttribute("openid"));
// 查询数据库获取对应 userId 的用户名 // 查询数据库获取对应 userId 的用户名
String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName; String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName;
if (orderInfo.isAuto) {
// 自动生成编码
orderInfo.scheduleNumber = CommonServices.getCode("ProductionSchedulingNumber", orderInfo)
}
var tx = db.transaction(); //开启事务 var tx = db.transaction(); //开启事务
try{ try{
int res = db.table("mini_extrusion_schedule").insert({ int res = db.table("mini_extrusion_schedule").insert({
schedule_number: orderInfo.scheduleNumber, schedule_number: orderInfo.scheduleNumber,
code_auto: orderInfo.isAuto,
extrusion_date: orderInfo.extrusionDate, extrusion_date: orderInfo.extrusionDate,
extrusion_machine: orderInfo.extrusionMachine, extrusion_machine: orderInfo.extrusionMachine,
extrusion_team: orderInfo.extrusionTeam, extrusion_team: orderInfo.extrusionTeam,
@ -68,33 +76,33 @@ try{
if (res > 0) { if (res > 0) {
println("挤压排产单插入成功") println("挤压排产单插入成功")
res = db.update(""" // res = db.update("""
update mini_production_schedule // update mini_production_schedule
SET productioned_pieces = CASE // SET productioned_pieces = CASE
<foreach collection="materialsList" item="item" separator=" "> // <foreach collection="materialsList" item="item" separator=" ">
WHEN material_code = #{item.materialCode} and sales_order_code = #{purchInfo.documentNumber} THEN productioned_pieces + #{item.productionPieces} // WHEN material_code = #{item.materialCode} and sales_order_code = #{purchInfo.documentNumber} THEN productioned_pieces + #{item.productionPieces}
</foreach> // </foreach>
ELSE productioned_pieces // ELSE productioned_pieces
END // END
WHERE (sales_order_code, material_code) in ( // WHERE (sales_order_code, material_code) in (
<foreach collection="materialsList" item="item" separator=","> // <foreach collection="materialsList" item="item" separator=",">
(#{purchInfo.documentNumber}, #{item.materialCode}) // (#{purchInfo.documentNumber}, #{item.materialCode})
</foreach> // </foreach>
) // )
""") // """)
if (res <= 0) { // if (res <= 0) {
tx.rollback(); // tx.rollback();
println("更新计划表失败") // println("更新计划表失败")
exit -1, "提交失败"; // exit -1, "提交失败";
} // }
List list = new ArrayList(); List list = new ArrayList();
List list2 = new ArrayList(); List list2 = new ArrayList();
materialsList.map(marerial => { materialsList.map(marerial => {
list.add({ list.add({
schedule_number: orderInfo.scheduleNumber, schedule_number: orderInfo.scheduleNumber,
sales_order_code: purchInfo.documentNumber, sales_order_code: marerial.salesOrderCode,
material_code: marerial.materialCode, material_code: marerial.materialCode,
production_length: marerial.productionLength, production_length: marerial.productionLength,
production_pieces: marerial.productionPieces, production_pieces: marerial.productionPieces,

@ -0,0 +1,68 @@
{
"properties" : { },
"id" : "72e2009a2fe2476d94270cb8307a4185",
"script" : null,
"groupId" : "f4b3acf704cf4db29258ba70e24f8fc5",
"name" : "详情",
"createTime" : null,
"updateTime" : 1728728158049,
"lock" : null,
"createBy" : null,
"updateBy" : null,
"path" : "/detail",
"method" : "POST",
"parameters" : [ ],
"options" : [ ],
"requestBody" : "",
"headers" : [ ],
"paths" : [ ],
"responseBody" : null,
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : null
}
================================
import '@/common/sql' as sql
String salesOrder = sql("salesOrder")
String scheduleNumber = body.scheduleNumber;
return {
orderInfo: db.selectOne("""
select
schedule_number,
date_format(extrusion_date, '%Y-%m-%d') as extrusion_date,
extrusion_machine,
extrusion_team,
remarks
from mini_extrusion_schedule
where 1=1
and schedule_number=#{scheduleNumber}
"""),
materials: db.select("""
select
mesd.schedule_number,
mesd.production_length,
mesd.production_pieces,
mesd.sawing_method,
date_format(mso.sales_date, '%Y-%m-%d') as sales_date,
mci.customer_name,
su.user_name as salesperson_name,
mso.price,
mso.pricing_date,
mso.tax_rate,
mso.processing_fee,
${salesOrder}
from
mini_extrusion_schedule_detail mesd
left join mini_sales_orders mso on mso.document_number = mesd.sales_order_code
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
where 1=1 and mesd.schedule_number=#{scheduleNumber}
"""),
}

@ -5,7 +5,7 @@
"groupId" : "06d35cc5db5f4e6681262a1648c871c3", "groupId" : "06d35cc5db5f4e6681262a1648c871c3",
"name" : "列表", "name" : "列表",
"createTime" : null, "createTime" : null,
"updateTime" : 1727082770981, "updateTime" : 1728726289833,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -40,7 +40,7 @@
"children" : null "children" : null
} ], } ],
"paths" : [ ], "paths" : [ ],
"responseBody" : "{\n \"code\": 0,\n \"data\": {\n \"count\": 2,\n \"list\": [\n {\n \"salesOrderCode\": \"YS004\",\n \"materialCode\": \"JY646390\",\n \"plannedPieces\": 1,\n \"remarks\": \"safasd\",\n \"materialName\": \"SW-170不打孔\",\n \"profileModel\": \"SH-044\",\n \"weight\": 0.19,\n \"specification\": \"30*12.6\",\n \"thickness\": 0.9,\n \"piecesBundle\": 20,\n \"materialCategory\": \"型材系列\",\n \"defaultLength\": 6,\n \"packagingMethod\": \"6\",\n \"source\": \"source1\",\n \"unit\": \"支\",\n \"orderLength\": 1,\n \"orderTotalQuantity\": 1,\n \"surfaceMethod\": null,\n \"theoreticalWeightPerPiece\": 0.19,\n \"theoreticalWeight\": 0.19,\n \"packingQuantity\": 0,\n \"deliveryDate\": 1726243200000,\n \"customerMaterialCode\": null,\n \"producedPieces\": 0,\n \"producedLength\": 0,\n \"priceWithTax\": 10010,\n \"amountWithTax\": 0,\n \"shipmentsedNumber\": 0,\n \"returnedNumber\": null,\n \"status\": 1\n },\n {\n \"salesOrderCode\": \"YS004\",\n \"materialCode\": \"JY646391\",\n \"plannedPieces\": 1,\n \"remarks\": \"\",\n \"materialName\": \"SW-171不打孔\",\n \"profileModel\": \"SH-045\",\n \"weight\": 0.2,\n \"specification\": \"32*14.0\",\n \"thickness\": 1,\n \"piecesBundle\": 25,\n \"materialCategory\": \"型材系列\",\n \"defaultLength\": 6,\n \"packagingMethod\": \"6\",\n \"source\": \"source2\",\n \"unit\": \"支\",\n \"orderLength\": 1,\n \"orderTotalQuantity\": 1,\n \"surfaceMethod\": null,\n \"theoreticalWeightPerPiece\": 0.2,\n \"theoreticalWeight\": 0.2,\n \"packingQuantity\": 0,\n \"deliveryDate\": 1726243200000,\n \"customerMaterialCode\": null,\n \"producedPieces\": 0,\n \"producedLength\": 0,\n \"priceWithTax\": 10010,\n \"amountWithTax\": 0,\n \"shipmentsedNumber\": 0,\n \"returnedNumber\": null,\n \"status\": 1\n }\n ]\n },\n \"message\": \"success\"\n}", "responseBody" : "{\n \"code\": -2,\n \"message\": \"token无效\",\n \"data\": null,\n \"timestamp\": 1728719907434,\n \"executeTime\": null\n}",
"description" : null, "description" : null,
"requestBodyDefinition" : { "requestBodyDefinition" : {
"name" : "root", "name" : "root",
@ -156,37 +156,37 @@
================================ ================================
import '@/common/sql' as sql import '@/common/sql' as sql
String extrusionScheduleId = body["extrusionScheduleId"];
String orderNumber = body["orderNumber"];
String productCode = body["productCode"];
String customerMaterialNumber = body["customerMaterialNumber"];
String deliveryDate = body["deliveryDate"];
// var sql = """ String documentNumber = body["documentNumber"];
// select color, create_by, date_format(create_time, '%Y-%m-%d %H:%i:%S') as create_time, delivery_date, id, material_name, order_number, order_total, planned_pieces, product_code, profile_model, profile_name, remarks, sales_order_number, specification, surface_treatment, theoretical_bundle_weight, theoretical_weight, weight String salesOrderCode = body["salesOrderCode"];
// from mini_production_schedule String materialName = body["materialName"];
// where 1 = 1
// ?{extrusionScheduleId != null and extrusionScheduleId != '', and extrusion_schedule_id like concat('%', #{extrusionScheduleId}, '%')}
// ?{orderNumber != null and orderNumber != '', and order_number like concat('%', #{orderNumber}, '%')}
// ?{productCode != null and productCode != '', and product_code like concat('%', #{productCode}, '%')}
// ?{customerMaterialNumber != null and customerMaterialNumber != '', and customer_material_number like concat('%', #{customerMaterialNumber}, '%')}
// ?{deliveryDate != null and deliveryDate != '', and date_format(delivery_date, '%Y-%m-%d') = #{deliveryDate}}
// """
String salesOrdeSelect = sql("salesOrder") String salesOrdeSelect = sql("salesOrder")
String sql = """ String sql = """
select select
mps.id, mps.id,
mps.document_number,
mps.planned_pieces, mps.planned_pieces,
mps.remarks, mps.remarks,
date_format(mso.sales_date, '%Y-%m-%d') as sales_date,
mci.customer_name,
su.user_name as salesperson_name,
mso.price,
mso.pricing_date,
mso.tax_rate,
mso.processing_fee,
${salesOrdeSelect} ${salesOrdeSelect}
from from
mini_production_schedule mps mini_production_schedule mps
left join mini_sales_orders mso on mso.document_number = mps.sales_order_code
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 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
where 1=1 where 1=1
?{salesOrderCode != null and salesOrderCode != "", and mps.sales_order_code = #{salesOrderCode}} ?{salesOrderCode != null and salesOrderCode != "", and mps.sales_order_code = #{salesOrderCode}}
?{documentNumber != null and documentNumber != "", and mps.document_number = #{documentNumber}}
?{materialName != null and materialName != "", and msm.material_name like concat('%', #{materialName}, '%')}
"""; """;
return db.page(sql); return db.page(sql);

@ -5,7 +5,7 @@
"groupId" : "06d35cc5db5f4e6681262a1648c871c3", "groupId" : "06d35cc5db5f4e6681262a1648c871c3",
"name" : "新增", "name" : "新增",
"createTime" : null, "createTime" : null,
"updateTime" : 1726361471903, "updateTime" : 1728724750705,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -46,8 +46,11 @@
"responseBodyDefinition" : null "responseBodyDefinition" : null
} }
================================ ================================
import 'commonServices' as CommonServices
List selection = body.selection; List selection = body.selection;
Map orderInfo = body.orderInfo; Map orderInfo = body.orderInfo;
Map form = body.form;
if (Objects.isNull(selection) || selection.size() <= 0) { if (Objects.isNull(selection) || selection.size() <= 0) {
exit -1, "数据为空" exit -1, "数据为空"
} }
@ -56,10 +59,19 @@ String userId = StringUtil.objectToString(request.get().getAttribute("openid"));
// 查询数据库获取对应 userId 的用户名 // 查询数据库获取对应 userId 的用户名
String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName; String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName;
String documentNumber = form.documentNumber
if (form.isAuto) {
// 自动生成编码
documentNumber = CommonServices.getCode("ProductionOrderNumber", orderInfo)
}
var tx = db.transaction(); //开启事务 var tx = db.transaction(); //开启事务
try{ try{
var res = db.insert(""" var res = db.insert("""
insert into mini_production_schedule( insert into mini_production_schedule(
document_number,
sales_order_code, sales_order_code,
material_code, material_code,
planned_pieces, planned_pieces,
@ -67,7 +79,7 @@ try{
create_by create_by
) values ) values
<foreach collection="selection" item="item" separator=","> <foreach collection="selection" item="item" separator=",">
(#{orderInfo.documentNumber}, #{item.materialCode},#{item.plannedPieces},#{item.remarks},#{createBy}) (#{documentNumber}, #{orderInfo.documentNumber}, #{item.materialCode},#{item.plannedPieces},#{item.remarks},#{createBy})
</foreach> </foreach>
""") """)
if (res > 0) { if (res > 0) {

@ -5,7 +5,7 @@
"groupId" : "06d35cc5db5f4e6681262a1648c871c3", "groupId" : "06d35cc5db5f4e6681262a1648c871c3",
"name" : "详情", "name" : "详情",
"createTime" : null, "createTime" : null,
"updateTime" : 1726365901110, "updateTime" : 1728721582011,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -24,7 +24,7 @@
================================ ================================
import '@/common/sql' as sql import '@/common/sql' as sql
String documentNumber = body["documentNumber"]; String salesOrderCode = body["salesOrderCode"];
String salesOrdeSelect = sql("salesOrder") String salesOrdeSelect = sql("salesOrder")
String sql = """ String sql = """
select select
@ -36,7 +36,7 @@ String sql = """
mini_production_schedule mps mini_production_schedule mps
left join mini_sales_order_materials msm 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
where 1=1 and mps.sales_order_code = #{documentNumber} where 1=1 and mps.sales_order_code = #{salesOrderCode}
"""; """;

@ -5,7 +5,7 @@
"groupId" : "a2b7765d540449b7bf93e070c1911ce9", "groupId" : "a2b7765d540449b7bf93e070c1911ce9",
"name" : "新增", "name" : "新增",
"createTime" : null, "createTime" : null,
"updateTime" : 1727705407686, "updateTime" : 1728703255361,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -586,6 +586,8 @@
} }
} }
================================ ================================
import 'commonServices' as CommonServices
Map orderInfo = body.orderInfo; Map orderInfo = body.orderInfo;
var materialsList = body.materials var materialsList = body.materials
@ -593,10 +595,16 @@ String userId = StringUtil.objectToString(request.get().getAttribute("openid"));
// 查询数据库获取对应 userId 的用户名 // 查询数据库获取对应 userId 的用户名
String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName; String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName;
if (orderInfo.isAuto) {
// 自动生成编码
orderInfo.documentNumber = CommonServices.getCode("PurchaseNumber", orderInfo)
}
var tx = db.transaction(); //开启事务 var tx = db.transaction(); //开启事务
try{ try{
int res = db.table("mini_purchase_orders").insert({ int res = db.table("mini_purchase_orders").insert({
document_number: orderInfo.documentNumber, document_number: orderInfo.documentNumber,
code_auto: orderInfo.isAuto,
supplier: orderInfo.supplier, supplier: orderInfo.supplier,
purchase_date: orderInfo.purchaseDate, purchase_date: orderInfo.purchaseDate,
purchaser: orderInfo.purchaser, purchaser: orderInfo.purchaser,

@ -5,7 +5,7 @@
"groupId" : "5740e8dbe1f641e69fa41f60087dea98", "groupId" : "5740e8dbe1f641e69fa41f60087dea98",
"name" : "列表", "name" : "列表",
"createTime" : null, "createTime" : null,
"updateTime" : 1726305048852, "updateTime" : 1728631803765,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -58,6 +58,7 @@ return db.page("""
contact_phone, contact_phone,
create_by, create_by,
date_format(create_time,'%Y-%m-%d %H:%i:%S') as create_time, date_format(create_time,'%Y-%m-%d %H:%i:%S') as create_time,
customer_code,
customer_name, customer_name,
id, id,
is_tax_included, is_tax_included,

@ -5,7 +5,7 @@
"groupId" : "5740e8dbe1f641e69fa41f60087dea98", "groupId" : "5740e8dbe1f641e69fa41f60087dea98",
"name" : "新增", "name" : "新增",
"createTime" : null, "createTime" : null,
"updateTime" : 1724482007481, "updateTime" : 1728652880039,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -46,6 +46,11 @@
"responseBodyDefinition" : null "responseBodyDefinition" : null
} }
================================ ================================
import 'commonServices' as CommonServices
Boolean isAuto = body.isAuto; // 是否自动生成编码 1-自动生成 0-非自动生成
String customerCode = body.customerCode;
String address = body.address; String address = body.address;
String contactPerson = body.contactPerson; String contactPerson = body.contactPerson;
String contactPhone = body.contactPhone; String contactPhone = body.contactPhone;
@ -60,6 +65,33 @@ String userId = StringUtil.objectToString(request.get().getAttribute("openid"));
// 查询数据库获取对应 userId 的用户名 // 查询数据库获取对应 userId 的用户名
String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName; String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName;
return db.insert(""" Map map = db.selectOne("select * from mini_customer_info where customer_code=#{customerCode}")
insert into mini_customer_info(address, contact_person, contact_phone, create_by, customer_name, is_tax_included, remarks, settlement_currency, status, tax) values(#{address}, #{contactPerson}, #{contactPhone}, #{createBy}, #{customerName}, #{isTaxIncluded}, #{remarks}, #{settlementCurrency}, #{status}, #{tax}) if (map != null) {
"""); exit -1, "客户资料已存在!"
}
if (isAuto) {
// 自动生成编码
customerCode = CommonServices.getCode("CustomerCode", null)
}
return db.table("mini_customer_info").insert({
code_auto: isAuto,
customer_code: customerCode,
address: address,
contact_person: contactPerson,
contact_phone: contactPhone,
create_by: createBy,
customer_name: customerName,
is_tax_included: isTaxIncluded,
remarks: remarks,
settlement_currency: settlementCurrency,
status: status,
tax: tax
})
// return db.insert("""
// insert into mini_customer_info(address, contact_person, contact_phone, create_by, customer_name, is_tax_included, remarks, settlement_currency, status, tax)
// values(#{address}, #{contactPerson}, #{contactPhone}, #{createBy}, #{customerName}, #{isTaxIncluded}, #{remarks}, #{settlementCurrency}, #{status}, #{tax})
// """);

@ -5,7 +5,7 @@
"groupId" : "a170047f79ab4cb1b892edc5cccd823e", "groupId" : "a170047f79ab4cb1b892edc5cccd823e",
"name" : "详情", "name" : "详情",
"createTime" : null, "createTime" : null,
"updateTime" : 1727081842954, "updateTime" : 1728728439695,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -66,7 +66,7 @@ return {
msom.packing_quantity, msom.packing_quantity,
msom.packaging_method, msom.packaging_method,
msom.produced_pieces, msom.produced_pieces,
${salesOrderCode} as sales_order_code '${salesOrderCode}' as sales_order_code
from mini_sales_shipment_materials mssm from mini_sales_shipment_materials mssm
left join mini_sales_order_materials msom on msom.material_code = mssm.material_code left join mini_sales_order_materials msom on msom.material_code = mssm.material_code
where mssm.sales_shipment_code = #{documentNumber} and msom.sales_order_code=#{salesOrderCode} where mssm.sales_shipment_code = #{documentNumber} and msom.sales_order_code=#{salesOrderCode}

@ -5,7 +5,7 @@
"groupId" : "e631b317606f4246ac82585a7c1f1c5b", "groupId" : "e631b317606f4246ac82585a7c1f1c5b",
"name" : "修改", "name" : "修改",
"createTime" : null, "createTime" : null,
"updateTime" : 1727704801418, "updateTime" : 1728723349382,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -25,10 +25,10 @@
"expression" : null, "expression" : null,
"children" : null "children" : null
} ], } ],
"requestBody" : "", "requestBody" : "{\r\n \"materials\": [\r\n {\r\n \"id\": 62937,\r\n \"salesOrderCode\": \"CS4420241012-005\",\r\n \"materialCode\": \"JY646390\",\r\n \"materialName\": \"SW-170不打孔\",\r\n \"profileModel\": \"SH-044\",\r\n \"weight\": 0.19,\r\n \"specification\": \"30*12.6\",\r\n \"thickness\": 0.9,\r\n \"piecesBundle\": 20,\r\n \"materialCategory\": \"型材系列\",\r\n \"defaultLength\": 6,\r\n \"packagingMethod\": \"6\",\r\n \"source\": \"source1\",\r\n \"unit\": \"支\",\r\n \"orderLength\": 1,\r\n \"orderTotalQuantity\": 1,\r\n \"surfaceMethod\": null,\r\n \"theoreticalWeightPerPiece\": 0.19,\r\n \"theoreticalWeight\": 0.19,\r\n \"packingQuantity\": 0.05,\r\n \"deliveryDate\": \"2024-10-29\",\r\n \"customerMaterialCode\": null,\r\n \"producedPieces\": 0,\r\n \"producedLength\": 0,\r\n \"priceWithTax\": 0,\r\n \"amountWithTax\": 0,\r\n \"remark\": null,\r\n \"shipmentsedNumber\": 0,\r\n \"returnedNumber\": null,\r\n \"createBy\": \"超级管理员\",\r\n \"createTime\": 1728722943000,\r\n \"updateTime\": 1728722943000,\r\n \"unitPrice\": 0,\r\n \"orderNo\": \"11111\",\r\n \"status\": 0,\r\n \"noNumber\": 1,\r\n \"taxRate\": 0.09,\r\n \"isAuto\": true\r\n },\r\n {\r\n \"id\": 62938,\r\n \"salesOrderCode\": \"CS4420241012-005\",\r\n \"materialCode\": \"JY646391\",\r\n \"materialName\": \"SW-171不打孔\",\r\n \"profileModel\": \"SH-045\",\r\n \"weight\": 0.2,\r\n \"specification\": \"32*14.0\",\r\n \"thickness\": 1,\r\n \"piecesBundle\": 25,\r\n \"materialCategory\": \"型材系列\",\r\n \"defaultLength\": 6,\r\n \"packagingMethod\": \"6\",\r\n \"source\": \"source2\",\r\n \"unit\": \"支\",\r\n \"orderLength\": 1,\r\n \"orderTotalQuantity\": 1,\r\n \"surfaceMethod\": null,\r\n \"theoreticalWeightPerPiece\": 0.2,\r\n \"theoreticalWeight\": 0.2,\r\n \"packingQuantity\": 0.04,\r\n \"deliveryDate\": \"2024-10-29\",\r\n \"customerMaterialCode\": null,\r\n \"producedPieces\": 0,\r\n \"producedLength\": 0,\r\n \"priceWithTax\": 0,\r\n \"amountWithTax\": 0,\r\n \"remark\": null,\r\n \"shipmentsedNumber\": 0,\r\n \"returnedNumber\": null,\r\n \"createBy\": \"超级管理员\",\r\n \"createTime\": 1728722943000,\r\n \"updateTime\": 1728722943000,\r\n \"unitPrice\": 0,\r\n \"orderNo\": null,\r\n \"status\": 0,\r\n \"noNumber\": 1,\r\n \"taxRate\": 0.09,\r\n \"isAuto\": true\r\n }\r\n ],\r\n \"orderInfo\": {\r\n \"documentNumber\": \"CS4420241012-005\",\r\n \"isAuto\": true,\r\n \"customerId\": \"C00027\",\r\n \"salesDate\": \"2024-10-18\",\r\n \"salesperson\": \"1\",\r\n \"price\": null,\r\n \"pricingDate\": \"2024-10-31\",\r\n \"deliveryDate\": \"2024-10-29\",\r\n \"taxRate\": 0.09,\r\n \"processingFee\": null,\r\n \"remarks\": null,\r\n \"customerName\": \"测试44\",\r\n \"salespersonName\": \"超级管理员\"\r\n }\r\n}",
"headers" : [ { "headers" : [ {
"name" : "authorization", "name" : "authorization",
"value" : null, "value" : "5E34C0D7EA601026B93C26119C7E1AD57BDC4F4DD7836B6F883430E388E7D8A0704B7E0E35AAA6410EEFECDD2A2E5988",
"description" : "登录token", "description" : "登录token",
"required" : false, "required" : false,
"dataType" : "String", "dataType" : "String",
@ -40,12 +40,14 @@
"children" : null "children" : null
} ], } ],
"paths" : [ ], "paths" : [ ],
"responseBody" : null, "responseBody" : "{\n \"code\": -1,\n \"data\": null,\n \"message\": \"提交失败\"\n}",
"description" : null, "description" : null,
"requestBodyDefinition" : null, "requestBodyDefinition" : null,
"responseBodyDefinition" : null "responseBodyDefinition" : null
} }
================================ ================================
import 'commonServices' as CommonServices
Map orderInfo = body.orderInfo; Map orderInfo = body.orderInfo;
List materialsList = body.materials List materialsList = body.materials
@ -58,7 +60,6 @@ try{
int res = db.table("mini_sales_orders").where().eq('document_number',orderInfo.documentNumber).update({ int res = db.table("mini_sales_orders").where().eq('document_number',orderInfo.documentNumber).update({
document_number: orderInfo.documentNumber, document_number: orderInfo.documentNumber,
customer_id: orderInfo.customerId, customer_id: orderInfo.customerId,
customer_name: orderInfo.customerName,
sales_date: orderInfo.salesDate, sales_date: orderInfo.salesDate,
salesperson: orderInfo.salesperson, salesperson: orderInfo.salesperson,
price: orderInfo.price, price: orderInfo.price,
@ -75,7 +76,12 @@ try{
db.update("delete from mini_sales_order_materials where sales_order_code=#{orderInfo.documentNumber}") db.update("delete from mini_sales_order_materials where sales_order_code=#{orderInfo.documentNumber}")
List list = new ArrayList(); List list = new ArrayList();
materialsList.map(marerial => { materialsList.map((marerial, i) => {
if (Objects.nonNull(marerial.isAuto) && marerial.isAuto == true) {
orderInfo.put("index",i)
marerial.orderNo = CommonServices.getCode("OrderNumber", orderInfo)
}
list.add({ list.add({
sales_order_code: orderInfo.documentNumber, sales_order_code: orderInfo.documentNumber,
order_no: marerial.orderNo, order_no: marerial.orderNo,

@ -5,7 +5,7 @@
"groupId" : "e631b317606f4246ac82585a7c1f1c5b", "groupId" : "e631b317606f4246ac82585a7c1f1c5b",
"name" : "列表", "name" : "列表",
"createTime" : null, "createTime" : null,
"updateTime" : 1726316163854, "updateTime" : 1728721690603,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -72,7 +72,7 @@ var sql = """
date_format(mso.create_time, '%Y-%m-%d %H:%i:%S') as create_time date_format(mso.create_time, '%Y-%m-%d %H:%i:%S') as create_time
from mini_sales_orders mso from mini_sales_orders mso
left join sys_user su on su.user_id = mso.salesperson left join sys_user su on su.user_id = mso.salesperson
left join mini_customer_info mci on mci.id = mso.customer_id left join mini_customer_info mci on mci.customer_code = mso.customer_id
where 1 = 1 where 1 = 1
?{documentNumber != null and documentNumber != '', and mso.document_number like concat('%', #{documentNumber}, '%')} ?{documentNumber != null and documentNumber != '', and mso.document_number like concat('%', #{documentNumber}, '%')}
?{salesperson != null and salesperson != '', and mso.salesperson like concat('%', #{salesperson}, '%')} ?{salesperson != null and salesperson != '', and mso.salesperson like concat('%', #{salesperson}, '%')}

@ -5,7 +5,7 @@
"groupId" : "e631b317606f4246ac82585a7c1f1c5b", "groupId" : "e631b317606f4246ac82585a7c1f1c5b",
"name" : "新增", "name" : "新增",
"createTime" : null, "createTime" : null,
"updateTime" : 1727704791936, "updateTime" : 1728723116746,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -25,10 +25,10 @@
"expression" : null, "expression" : null,
"children" : null "children" : null
} ], } ],
"requestBody" : "", "requestBody" : "{\r\n \"materials\": [\r\n {\r\n \"id\": 1,\r\n \"storehouseId\": null,\r\n \"materialCode\": \"JY646390\",\r\n \"profileModel\": \"SH-044\",\r\n \"materialName\": \"SW-170不打孔\",\r\n \"specification\": \"30*12.6\",\r\n \"thickness\": 0.9,\r\n \"weight\": 0.19,\r\n \"piecesBundle\": 20,\r\n \"materialCategory\": \"型材系列\",\r\n \"materialCategoryName\": null,\r\n \"defaultLength\": 6,\r\n \"packagingMethod\": \"6\",\r\n \"source\": \"source1\",\r\n \"status\": 1,\r\n \"safetyStock\": 1,\r\n \"inventoryUnit\": \"支\",\r\n \"unit\": \"支\",\r\n \"remarks\": \"1\",\r\n \"createBy\": \"超级管理员\",\r\n \"createTime\": \"2024-08-27 06:18:53\",\r\n \"orderLength\": 1,\r\n \"orderTotalQuantity\": 1,\r\n \"pieces\": 0,\r\n \"theoreticalWeight\": 0.19,\r\n \"unitPrice\": 0.12,\r\n \"shipmentsedNumber\": 0,\r\n \"noNumber\": 1,\r\n \"producedPieces\": 0,\r\n \"producedLength\": 0,\r\n \"priceWithTax\": 0.13,\r\n \"amountWithTax\": 0,\r\n \"theoreticalWeightPerPiece\": 0.19,\r\n \"packingQuantity\": 0.05,\r\n \"taxRate\": 0.09,\r\n \"deliveryDate\": \"2024-10-17\"\r\n },\r\n {\r\n \"id\": 2,\r\n \"storehouseId\": null,\r\n \"materialCode\": \"JY646391\",\r\n \"profileModel\": \"SH-045\",\r\n \"materialName\": \"SW-171不打孔\",\r\n \"specification\": \"32*14.0\",\r\n \"thickness\": 1,\r\n \"weight\": 0.2,\r\n \"piecesBundle\": 25,\r\n \"materialCategory\": \"型材系列\",\r\n \"materialCategoryName\": null,\r\n \"defaultLength\": 6,\r\n \"packagingMethod\": \"6\",\r\n \"source\": \"source2\",\r\n \"status\": 1,\r\n \"safetyStock\": 1,\r\n \"inventoryUnit\": \"支\",\r\n \"unit\": \"支\",\r\n \"remarks\": \"2\",\r\n \"createBy\": \"超级管理员\",\r\n \"createTime\": \"2024-08-27 06:18:53\",\r\n \"orderLength\": 1,\r\n \"orderTotalQuantity\": 1,\r\n \"pieces\": 0,\r\n \"theoreticalWeight\": 0.2,\r\n \"unitPrice\": 0.12,\r\n \"shipmentsedNumber\": 0,\r\n \"noNumber\": 1,\r\n \"producedPieces\": 0,\r\n \"producedLength\": 0,\r\n \"priceWithTax\": 0.13,\r\n \"amountWithTax\": 0,\r\n \"theoreticalWeightPerPiece\": 0.2,\r\n \"packingQuantity\": 0.04,\r\n \"taxRate\": 0.09,\r\n \"deliveryDate\": \"2024-10-17\"\r\n }\r\n ],\r\n \"orderInfo\": {\r\n \"documentNumber\": \"\",\r\n \"isAuto\": true,\r\n \"customerId\": \"C00027\",\r\n \"salesDate\": \"2024-10-09\",\r\n \"salesperson\": \"1\",\r\n \"price\": \"123\",\r\n \"pricingDate\": \"2024-10-17\",\r\n \"deliveryDate\": \"2024-10-17\",\r\n \"taxRate\": 0.09,\r\n \"processingFee\": \"12312\",\r\n \"remarks\": \"\"\r\n }\r\n}",
"headers" : [ { "headers" : [ {
"name" : "authorization", "name" : "authorization",
"value" : null, "value" : "5E34C0D7EA601026B93C26119C7E1AD57BDC4F4DD7836B6F883430E388E7D8A0704B7E0E35AAA6410EEFECDD2A2E5988",
"description" : "登录token", "description" : "登录token",
"required" : false, "required" : false,
"dataType" : "String", "dataType" : "String",
@ -40,25 +40,32 @@
"children" : null "children" : null
} ], } ],
"paths" : [ ], "paths" : [ ],
"responseBody" : null, "responseBody" : "{\n \"code\": 0,\n \"data\": null,\n \"message\": \"执行成功\"\n}",
"description" : null, "description" : null,
"requestBodyDefinition" : null, "requestBodyDefinition" : null,
"responseBodyDefinition" : null "responseBodyDefinition" : null
} }
================================ ================================
import 'commonServices' as CommonServices
Map orderInfo = body.orderInfo; Map orderInfo = body.orderInfo;
var materialsList = body.materials var materialsList = body.materials;
String userId = StringUtil.objectToString(request.get().getAttribute("openid")); String userId = StringUtil.objectToString(request.get().getAttribute("openid"));
// 查询数据库获取对应 userId 的用户名 // 查询数据库获取对应 userId 的用户名
String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName; String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName;
if (orderInfo.isAuto) {
// 自动生成编码
orderInfo.documentNumber = CommonServices.getCode("SalesOrderNumber", orderInfo)
}
var tx = db.transaction(); //开启事务 var tx = db.transaction(); //开启事务
try{ try{
int res = db.table("mini_sales_orders").insert({ int res = db.table("mini_sales_orders").insert({
document_number: orderInfo.documentNumber, document_number: orderInfo.documentNumber,
code_auto: orderInfo.isAuto,
customer_id: orderInfo.customerId, customer_id: orderInfo.customerId,
customer_name: orderInfo.customerName,
sales_date: orderInfo.salesDate, sales_date: orderInfo.salesDate,
salesperson: orderInfo.salesperson, salesperson: orderInfo.salesperson,
price: orderInfo.price, price: orderInfo.price,
@ -74,7 +81,11 @@ try{
println("销售订单插入成功") println("销售订单插入成功")
List list = new ArrayList(); List list = new ArrayList();
materialsList.map(marerial => { materialsList.map((marerial, i) => {
if (Objects.nonNull(marerial.isAuto) && marerial.isAuto == true) {
orderInfo.put("index",i)
marerial.orderNo = CommonServices.getCode("OrderNumber", orderInfo)
}
list.add({ list.add({
sales_order_code: orderInfo.documentNumber, sales_order_code: orderInfo.documentNumber,
order_no: marerial.orderNo, order_no: marerial.orderNo,

@ -5,7 +5,7 @@
"groupId" : "447d969bf99243f188b84289aff1ba91", "groupId" : "447d969bf99243f188b84289aff1ba91",
"name" : "测试", "name" : "测试",
"createTime" : null, "createTime" : null,
"updateTime" : 1696760200396, "updateTime" : 1728722688440,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -70,5 +70,14 @@
} }
} }
================================ ================================
return ""
List aa = new ArrayList();
['a','b','c'].map((item, i) => {
aa.add({
[item]: i
})
})
return aa

@ -5,7 +5,7 @@
"groupId" : "c3fc8c12916e40319e19fc434a708a83", "groupId" : "c3fc8c12916e40319e19fc434a708a83",
"name" : "公共sql", "name" : "公共sql",
"createTime" : null, "createTime" : null,
"updateTime" : 1726382537168, "updateTime" : 1728704818002,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -87,6 +87,41 @@ var sql = {
mwm.pieces, mwm.pieces,
mwm.supplier, mwm.supplier,
mwm.warehouse mwm.warehouse
""",
"warehouseProductMaterial": """
mwp.sales_order_code,
mwp.material_code,
mwp.material_name,
mwp.profile_model,
mwp.weight,
mwp.specification,
mwp.thickness,
mwp.pieces_bundle,
mwp.material_category,
mwp.default_length,
mwp.packaging_method,
mwp.source,
mwp.unit,
mwp.order_length,
mwp.order_total_quantity,
mwp.surface_method,
mwp.theoretical_weight_per_piece,
mwp.theoretical_weight,
mwp.packing_quantity,
mwp.delivery_date,
mwp.customer_material_code,
mwp.produced_pieces,
mwp.produced_length,
mwp.price_with_tax,
mwp.amount_with_tax,
mwp.remark,
mwp.shipmentsed_number,
mwp.returned_number,
mwp.unit_price,
mwp.order_no,
mwp.existing_inventory,
mwp.customer_id,
mwp.warehouse
""" """
} }
return sql[type] return sql[type]

@ -2,8 +2,10 @@ var:
env: local # dev-开发 pro-生产 env: local # dev-开发 pro-生产
port: 9080 port: 9080
mysql: mysql:
ip: 127.0.0.1 # ip: 127.0.0.1
port: 3306 ip: 106.227.69.97
# port: 3306
port: 3307
database: 883web database: 883web
user: 883web user: 883web
password: LFw24KPkdFdtdw5W password: LFw24KPkdFdtdw5W

Loading…
Cancel
Save