Compare commits
No commits in common. 'main' and 'v1.0.0' have entirely different histories.
@ -1,40 +0,0 @@
|
||||
package com.currency.appengine.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 同步供应商数据VO
|
||||
* @author zk
|
||||
* @date 2024/9/30
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
@Builder
|
||||
public class AysnSupplier {
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 手机号
|
||||
*/
|
||||
private String phone;
|
||||
/**
|
||||
* 邮箱
|
||||
*/
|
||||
private String email;
|
||||
/**
|
||||
* 统一社会信用代码
|
||||
*/
|
||||
private String creditCode;
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
}
|
@ -1,75 +0,0 @@
|
||||
package com.currency.appengine.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* 供应商请求信息
|
||||
*
|
||||
* @author zk
|
||||
* @date 2024/10/23
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@ToString
|
||||
public class SupplierReq {
|
||||
|
||||
private Long id;
|
||||
/**
|
||||
* 联系人
|
||||
*/
|
||||
private String contactPerson;
|
||||
/**
|
||||
* 联系方式
|
||||
*/
|
||||
private String contactPhone;
|
||||
/**
|
||||
* 供应商编码
|
||||
*/
|
||||
private String supplierCode;
|
||||
/**
|
||||
* 供应商名称
|
||||
*/
|
||||
private String supplierName;
|
||||
/**
|
||||
* 是否自动编码
|
||||
*/
|
||||
private Boolean isAuto;
|
||||
/**
|
||||
* 是否含税
|
||||
*/
|
||||
private Integer isTaxIncluded;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remarks;
|
||||
/**
|
||||
* 结算货币类型
|
||||
*/
|
||||
private String settlementCurrency;
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private Integer status;
|
||||
/**
|
||||
* 税率
|
||||
*/
|
||||
private String tax;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
private String userId;
|
||||
/**
|
||||
* 地址
|
||||
*/
|
||||
private String address;
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
package com.currency.appengine.mapper.system;
|
||||
|
||||
import com.currency.appengine.domain.CustomerReq;
|
||||
import com.currency.appengine.domain.SupplierReq;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Options;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
/**
|
||||
* @author zk
|
||||
* @date 2024/10/23
|
||||
*/
|
||||
public interface SupplierMapper {
|
||||
|
||||
@Insert(
|
||||
"insert into mini_supplier_info(address,create_by, contact_person, contact_phone, supplier_name, is_tax_included, remarks, settlement_currency, status, tax) values(#{address},#{createBy}, #{contactPerson}, #{contactPhone}, #{supplierName}, #{isTaxIncluded}, #{remarks}, #{settlementCurrency}, #{status}, #{tax});"
|
||||
)
|
||||
@Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
|
||||
int insertSupplier(SupplierReq supplierReq);
|
||||
|
||||
@Select(
|
||||
"SELECT user_name FROM sys_user WHERE user_id = #{userId}"
|
||||
)
|
||||
String selectUserById(String userId);
|
||||
|
||||
@Update(
|
||||
"update mini_supplier_info set supplier_code = #{supplierCode} where id = #{id}"
|
||||
)
|
||||
void updateCodeById(SupplierReq supplierReq);
|
||||
}
|
@ -1,152 +0,0 @@
|
||||
package com.currency.appengine.service.export.model;
|
||||
|
||||
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 队伍信息
|
||||
*/
|
||||
@Data
|
||||
public class OrderTrackingExport {
|
||||
|
||||
@Excel(name = "销售订单号", width = 40)
|
||||
private String salesOrderCode;
|
||||
|
||||
@Excel(name = "订单号", width = 40)
|
||||
private String orderNo;
|
||||
|
||||
@Excel(name = "产品编码", width = 40)
|
||||
private String materialCode;
|
||||
|
||||
@Excel(name = "物料名称", width = 40)
|
||||
private String materialName;
|
||||
|
||||
@Excel(name = "型材型号", width = 40)
|
||||
private String profileModel;
|
||||
|
||||
@Excel(name = "规格型号", width = 40)
|
||||
private String specification;
|
||||
|
||||
@Excel(name = "壁厚", width = 40)
|
||||
private String thickness;
|
||||
|
||||
@Excel(name = "米重 (kg/m)", width = 40)
|
||||
private String weight;
|
||||
|
||||
@Excel(name = "订单总数 (支)", width = 40)
|
||||
private String orderLength;
|
||||
|
||||
@Excel(name = "订单长度 (M)", width = 40)
|
||||
private String orderTotalQuantity;
|
||||
|
||||
@Excel(name = "表面方式 (颜色)", width = 40)
|
||||
private String surfaceMethod;
|
||||
|
||||
@Excel(name = "订单日期", width = 40)
|
||||
private String deliveryDate;
|
||||
|
||||
@Excel(name = "理论重量 (KG)", width = 40)
|
||||
private String theoreticalWeight;
|
||||
|
||||
@Excel(name = "生产支数", width = 40)
|
||||
private String producedPieces;
|
||||
|
||||
@Excel(name = "生产长度 (m)", width = 40)
|
||||
private String producedLength;
|
||||
|
||||
@Excel(name = "计划支数", width = 40)
|
||||
private String plannedPieces;
|
||||
|
||||
@Excel(name = "排产长度", width = 40)
|
||||
private String productionLength;
|
||||
|
||||
@Excel(name = "排产支数", width = 40)
|
||||
private String productionPieces;
|
||||
|
||||
@Excel(name = "锯切方式", width = 40)
|
||||
private String sawingMethod;
|
||||
|
||||
@Excel(name = "实际米重", width = 40)
|
||||
private String jiya_productionWeight;
|
||||
|
||||
@Excel(name = "已挤压支数", width = 40)
|
||||
private String jiya_productionNumber;
|
||||
|
||||
@Excel(name = "已挤压重量(KG)", width = 40)
|
||||
private String jiya_actualWeight;
|
||||
|
||||
@Excel(name = "已精品支数", width = 40)
|
||||
private String jingpin_productionNumber;
|
||||
|
||||
@Excel(name = "已精品重量(KG)", width = 40)
|
||||
private String jingpin_productionWeight;
|
||||
|
||||
@Excel(name = "已氧化上排支数", width = 40)
|
||||
private String yanghau1_productionNumber;
|
||||
|
||||
@Excel(name = "已氧化上排重量(KG)", width = 40)
|
||||
private String yanghau1_actualWeight;
|
||||
|
||||
@Excel(name = "已氧化下排支数", width = 40)
|
||||
private String yanghua2_productionNumber;
|
||||
|
||||
@Excel(name = "已氧化下排重量(KG)", width = 40)
|
||||
private String yanghua2_actualWeight;
|
||||
|
||||
@Excel(name = "已精切支数", width = 40)
|
||||
private String jingqie_productionNumber;
|
||||
|
||||
@Excel(name = "已精切重量(KG)", width = 40)
|
||||
private String jingqie_actualWeight;
|
||||
|
||||
@Excel(name = "已打孔支数", width = 40)
|
||||
private String dk_productionNumber;
|
||||
|
||||
@Excel(name = "已打孔重量(KG)", width = 40)
|
||||
private String dk_actualWeight;
|
||||
|
||||
@Excel(name = "已包装支数", width = 40)
|
||||
private String bz_productionNumber;
|
||||
|
||||
@Excel(name = "已包装重量(KG)", width = 40)
|
||||
private String bz_actualWeight;
|
||||
|
||||
@Excel(name = "入库支数", width = 40)
|
||||
private String receiptQuantity;
|
||||
|
||||
@Excel(name = "已入库重量(KG)", width = 40)
|
||||
private String actualWeight;
|
||||
|
||||
@Excel(name = "交货支数", width = 40)
|
||||
private String shipmentQuantity;
|
||||
|
||||
@Excel(name = "已交货重量(KG)", width = 40)
|
||||
private String shipmentActualWeight;
|
||||
|
||||
@Excel(name = "未交货支数", width = 40)
|
||||
private String noShipmentQuantity;
|
||||
|
||||
@Excel(name = "未交货重量(KG)", width = 40)
|
||||
private String noActualWeight;
|
||||
|
||||
@Excel(name = "库存总支数", width = 40)
|
||||
private String existingInventory;
|
||||
|
||||
@Excel(name = "库存总重量(KG)", width = 40)
|
||||
private String existingActualWeight;
|
||||
|
||||
@Excel(name = "长料报废支数", width = 40)
|
||||
private String longScrapNumber;
|
||||
|
||||
@Excel(name = "长料报废重量(KG)", width = 40)
|
||||
private String longScrapWeight;
|
||||
|
||||
@Excel(name = "短料报费支数", width = 40)
|
||||
private String shortageScrapNumber;
|
||||
|
||||
@Excel(name = "短料报费重量(KG)", width = 40)
|
||||
private String shortageScrapWeight;
|
||||
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
package com.currency.appengine.service.system;
|
||||
|
||||
import com.currency.appengine.domain.CustomerReq;
|
||||
import com.currency.appengine.domain.SupplierReq;
|
||||
|
||||
/**
|
||||
* @author zk
|
||||
* @date 2024/10/25
|
||||
*/
|
||||
public interface SupplierService {
|
||||
/**
|
||||
* 添加供应商信息
|
||||
*/
|
||||
int addSupplier(SupplierReq supplierReq);
|
||||
/**
|
||||
* 同步供应商信息
|
||||
*/
|
||||
int AsynSupplier(SupplierReq supplierReq);
|
||||
}
|
@ -1,113 +0,0 @@
|
||||
package com.currency.appengine.service.system.imp;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.io.IORuntimeException;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpResponse;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.currency.appengine.domain.AysnCustomer;
|
||||
import com.currency.appengine.domain.AysnSupplier;
|
||||
import com.currency.appengine.domain.CustomerReq;
|
||||
import com.currency.appengine.domain.SupplierReq;
|
||||
import com.currency.appengine.mapper.system.SupplierMapper;
|
||||
import com.currency.appengine.service.common.CommonServices;
|
||||
import com.currency.appengine.service.system.SupplierService;
|
||||
import com.currency.appengine.utils.SignUtil;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author zk
|
||||
* @date 2024/10/23
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class SupplierServiceImpl implements SupplierService {
|
||||
|
||||
@Autowired
|
||||
private SupplierMapper supplierMapper;
|
||||
@Autowired
|
||||
private CommonServices commonServices;
|
||||
|
||||
/**
|
||||
* 添加供应商信息
|
||||
*
|
||||
*/
|
||||
@Override
|
||||
public int addSupplier(SupplierReq supplierReq) {
|
||||
if (Boolean.TRUE.equals(supplierReq.getIsAuto())){
|
||||
supplierReq.setSupplierCode(commonServices.getCode("SupplierCode", null));
|
||||
}
|
||||
String user = supplierMapper.selectUserById(supplierReq.getUserId());
|
||||
supplierReq.setCreateBy(user);
|
||||
int i = supplierMapper.insertSupplier(supplierReq);
|
||||
supplierReq.setSupplierCode(String.valueOf(supplierReq.getId()));
|
||||
supplierMapper.updateCodeById(supplierReq);
|
||||
try {
|
||||
aysnO1(supplierReq);
|
||||
} catch (Exception e) {
|
||||
log.warn("同步客户信息异常", e);
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步客户信息
|
||||
*
|
||||
* @param customerReq
|
||||
*/
|
||||
@Override
|
||||
public int AsynSupplier(SupplierReq supplierReq) {
|
||||
int i = supplierMapper.insertSupplier(supplierReq);
|
||||
supplierReq.setSupplierCode(String.valueOf(supplierReq.getId()));
|
||||
supplierMapper.updateCodeById(supplierReq);
|
||||
return i;
|
||||
}
|
||||
/**
|
||||
* 同步供应商信息到其他系统
|
||||
*
|
||||
* @param supplierCompany 供应商信息
|
||||
*/
|
||||
private void aysnO1(SupplierReq supplierCompany) {
|
||||
String property = SpringUtil.getProperty("o1.sync.enabled");
|
||||
Boolean res = Boolean.valueOf(property);
|
||||
if (Boolean.TRUE.equals(res)) {
|
||||
String accessKey = SpringUtil.getProperty("o1.sync.access-key");
|
||||
String secretKey = SpringUtil.getProperty("o1.sync.secret-key");
|
||||
String url = SpringUtil.getProperty("o1.sync.create-url.supplier");
|
||||
Map<String, String> map = new HashMap<>();
|
||||
AysnSupplier supplier = AysnSupplier.builder().address(supplierCompany.getAddress())
|
||||
.name(supplierCompany.getSupplierName())
|
||||
.phone(supplierCompany.getContactPhone())
|
||||
.build();
|
||||
// customer.setCreateTime(crmCustomer.getCreateTime().getTime());
|
||||
Map<String, Object> toMap = BeanUtil.beanToMap(supplier,false,true);
|
||||
long timestamp = System.currentTimeMillis();
|
||||
map.put("time-stamp", String.valueOf(timestamp));
|
||||
map.put("access-key", accessKey);
|
||||
map.put("tenant-id", "1");
|
||||
toMap.put("time-stamp", String.valueOf(timestamp));
|
||||
toMap.put("access-key", accessKey);
|
||||
String sign = SignUtil.getSign(toMap, secretKey);
|
||||
map.put("sign", sign);
|
||||
HttpResponse response = null;
|
||||
try {
|
||||
response = HttpRequest.post(url)
|
||||
.addHeaders(map)
|
||||
.body(JSONUtil.toJsonStr(supplier))
|
||||
.execute();
|
||||
} catch (Exception e) {
|
||||
log.warn("同步失败", e);
|
||||
return;
|
||||
}
|
||||
String body = response.body();
|
||||
if (response.isOk()){
|
||||
log.info("请求成功");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "01a85821982944e8855e0cb8d3d48c72",
|
||||
"name" : "导出",
|
||||
"type" : "api",
|
||||
"parentId" : "c6ba5ea7aca143ef95dffaf14b4960e5",
|
||||
"path" : "/export",
|
||||
"createTime" : 1732603484379,
|
||||
"updateTime" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"paths" : [ ],
|
||||
"options" : [ ]
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "ec8de9306e07460eb7f04f43b5e7edcf",
|
||||
"script" : null,
|
||||
"groupId" : "01a85821982944e8855e0cb8d3d48c72",
|
||||
"name" : "挤压排产单导出",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1732611077461,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/extrusionSchedule",
|
||||
"method" : "POST",
|
||||
"parameters" : [ ],
|
||||
"options" : [ ],
|
||||
"requestBody" : "",
|
||||
"headers" : [ ],
|
||||
"paths" : [ ],
|
||||
"responseBody" : null,
|
||||
"description" : null,
|
||||
"requestBodyDefinition" : null,
|
||||
"responseBodyDefinition" : null
|
||||
}
|
||||
================================
|
||||
import 'exportDataPageServiceImpl' as exportDataPageServiceImpl;
|
||||
|
||||
import '@/sql/extrusionSchedule/count' as masterFind;
|
||||
import response
|
||||
|
||||
int count = masterFind(body);
|
||||
|
||||
body['page'] = 1
|
||||
body['size'] = 100;
|
||||
exportDataPageServiceImpl.magicExport(count, body, "com.currency.appengine.service.export.model.ExtrusionScheduleExport", '/sql/extrusionSchedule/list', '挤压排产', '挤压排产', '挤压排产');
|
||||
|
||||
response.end();
|
@ -1,36 +0,0 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "914ca6c8b3ae43e3ae6029318edff17c",
|
||||
"script" : null,
|
||||
"groupId" : "01a85821982944e8855e0cb8d3d48c72",
|
||||
"name" : "订单跟踪导出",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1732610997776,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/orderTracking",
|
||||
"method" : "POST",
|
||||
"parameters" : [ ],
|
||||
"options" : [ ],
|
||||
"requestBody" : "",
|
||||
"headers" : [ ],
|
||||
"paths" : [ ],
|
||||
"responseBody" : null,
|
||||
"description" : null,
|
||||
"requestBodyDefinition" : null,
|
||||
"responseBodyDefinition" : null
|
||||
}
|
||||
================================
|
||||
import 'exportDataPageServiceImpl' as exportDataPageServiceImpl;
|
||||
|
||||
import '@/sql/orderTracking/count' as masterFind;
|
||||
import response
|
||||
|
||||
int count = masterFind(body);
|
||||
|
||||
body['page'] = 1
|
||||
body['size'] = 100;
|
||||
exportDataPageServiceImpl.magicExport(count, body, "com.currency.appengine.service.export.model.OrderTrackingExport", '/sql/orderTracking/list', '订单跟踪表', '订单跟踪表', '订单跟踪表');
|
||||
|
||||
response.end();
|
@ -1,67 +0,0 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "2b4cc8f11db64e45b3c82de9e640dca4",
|
||||
"script" : null,
|
||||
"groupId" : "4aa6b5de02c244e2981c22bf5a95394d",
|
||||
"name" : "产品入库详细列表",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1732592493010,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/detaillist",
|
||||
"method" : "POST",
|
||||
"parameters" : [ ],
|
||||
"options" : [ ],
|
||||
"requestBody" : "",
|
||||
"headers" : [ ],
|
||||
"paths" : [ ],
|
||||
"responseBody" : null,
|
||||
"description" : null,
|
||||
"requestBodyDefinition" : null,
|
||||
"responseBodyDefinition" : null
|
||||
}
|
||||
================================
|
||||
import '@/common/sql' as sql
|
||||
|
||||
String warehouseProductMaterial = sql("warehouseProductMaterial")
|
||||
warehouseProductMaterial = warehouseProductMaterial.replace('mwp.packing_quantity,', '').replace('mwp.customer_id,', '')
|
||||
String documentNumber = body['documentNumber'];
|
||||
|
||||
String orderNo = body['orderNo'];
|
||||
String materialCode = body['materialCode'];
|
||||
String profileModel = body['profileModel'];
|
||||
String customerId = body['customerId'];
|
||||
String surfaceMethod = body['surfaceMethod'];
|
||||
|
||||
return db.page("""
|
||||
select
|
||||
mpr.document_number,
|
||||
date_format(receipt_date, '%Y-%m-%d %H:%i:%S') as receipt_date,
|
||||
mpr.customer_id,
|
||||
mci.customer_name,
|
||||
mpr.workshop,
|
||||
mpr.frame_number,
|
||||
mpr.total_weight,
|
||||
mpr.remarks,
|
||||
mpr.receipt_quantity,
|
||||
mpr.packing_quantity,
|
||||
mpr.actual_weight,
|
||||
mpr.unstocked_quantity,
|
||||
mpr.stocked_quantity,
|
||||
mw.warehouse_name,
|
||||
${warehouseProductMaterial}
|
||||
from mini_product_receipt mpr
|
||||
left join mini_customer_info mci on mci.customer_code = mpr.customer_id
|
||||
left join mini_warehouse_product mwp on mwp.sales_order_code = mpr.sales_order_code
|
||||
and mwp.material_code = mpr.material_code and mwp.order_no = mpr.order_no
|
||||
left join mini_warehouses mw on mw.warehouse_code = mwp.warehouse
|
||||
where 1=1
|
||||
?{documentNumber!=null && documentNumber!="", and mpr.document_number like concat('%', #{documentNumber} ,'%') }
|
||||
|
||||
?{orderNo != null and orderNo != '', and mwp.order_no like concat('%', #{orderNo}, '%')}
|
||||
?{materialCode != null and materialCode != '', and mwp.material_code like concat('%', #{materialCode}, '%')}
|
||||
?{profileModel != null and profileModel != '', and mwp.profile_model like concat('%', #{profileModel}, '%')}
|
||||
?{customerId != null and customerId != '', and mpr.customer_id = #{customerId}}
|
||||
?{surfaceMethod != null and surfaceMethod != '', and mwp.surface_method = #{surfaceMethod}}
|
||||
""");
|
File diff suppressed because one or more lines are too long
@ -1,50 +0,0 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "6d97e8a13d904f858f0c64807351f542",
|
||||
"script" : null,
|
||||
"groupId" : "e95307c32dc1437e82df26a97f1f194e",
|
||||
"name" : "退料详细列表",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1732270112987,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/detaillist",
|
||||
"method" : "POST",
|
||||
"parameters" : [ ],
|
||||
"options" : [ ],
|
||||
"requestBody" : "",
|
||||
"headers" : [ ],
|
||||
"paths" : [ ],
|
||||
"responseBody" : null,
|
||||
"description" : null,
|
||||
"requestBodyDefinition" : null,
|
||||
"responseBodyDefinition" : null
|
||||
}
|
||||
================================
|
||||
import '@/common/sql' as sql
|
||||
|
||||
String warehouseMaterial = sql("warehouseMaterial")
|
||||
|
||||
String documentNumber = body.documentNumber;
|
||||
String warehouse = body.warehouse;
|
||||
|
||||
return db.page("""
|
||||
select
|
||||
mmr.id,
|
||||
mmr.document_number,
|
||||
date_format(mmr.return_date,'%Y-%m-%d') as return_date,
|
||||
mmr.department,
|
||||
mmr.recipient,
|
||||
mmr.return_number,
|
||||
mmr.return_weight,
|
||||
mw.warehouse_name,
|
||||
${warehouseMaterial}
|
||||
from mini_production_material_return mmr
|
||||
inner join mini_warehouse_material mwm on mwm.warehouse = mmr.warehouse and mwm.supplier = mmr.supplier and mwm.material_code = mmr.material_code
|
||||
inner join mini_warehouses mw on mw.warehouse_code = mmr.warehouse
|
||||
|
||||
where 1=1
|
||||
?{documentNumber!=null && documentNumber!="", and mmr.document_number like concat('%', #{documentNumber} ,'%') }
|
||||
?{warehouse!=null && warehouse!="", and mmr.warehouse like concat('%', #{warehouse} ,'%') }
|
||||
""");
|
@ -1,51 +0,0 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "021da64fc53d4836bee36e2e8f2934fd",
|
||||
"script" : null,
|
||||
"groupId" : "d4e06c480fb04ecaaaee36cd3ad92aea",
|
||||
"name" : "生产领料详细列表",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1732268769536,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/detaillist",
|
||||
"method" : "POST",
|
||||
"parameters" : [ ],
|
||||
"options" : [ ],
|
||||
"requestBody" : "",
|
||||
"headers" : [ ],
|
||||
"paths" : [ ],
|
||||
"responseBody" : null,
|
||||
"description" : null,
|
||||
"requestBodyDefinition" : null,
|
||||
"responseBodyDefinition" : null
|
||||
}
|
||||
================================
|
||||
import '@/common/sql' as sql
|
||||
|
||||
String documentNumber = body.documentNumber;
|
||||
String warehouse = body.warehouse;
|
||||
|
||||
String warehouseMaterial = sql("warehouseMaterial")
|
||||
|
||||
return db.page("""
|
||||
select
|
||||
mmr.id,
|
||||
mmr.document_number,
|
||||
date_format(mmr.requisition_date,'%Y-%m-%d') as requisition_date,
|
||||
mmr.department,
|
||||
mmr.recipient,
|
||||
mmr.requisition_number,
|
||||
mmr.requisition_weight,
|
||||
mw.warehouse_name,
|
||||
${warehouseMaterial}
|
||||
from mini_production_material_requisition mmr
|
||||
inner join mini_warehouse_material mwm on mwm.warehouse = mmr.warehouse and mwm.supplier = mmr.supplier
|
||||
inner join mini_warehouses mw on mw.warehouse_code = mmr.warehouse
|
||||
and mwm.material_code = mmr.material_code
|
||||
where 1=1
|
||||
?{documentNumber!=null && documentNumber!="", and mmr.document_number like concat('%', #{documentNumber} ,'%') }
|
||||
?{warehouse!=null && warehouse!="", and mmr.warehouse like concat('%', #{warehouse} ,'%') }
|
||||
""");
|
||||
// group by mmr.document_number, mmr.warehouse, mmr.material_code, mmr.supplier
|
@ -1,33 +0,0 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "da0d50b5a2f34008a86055901f12d637",
|
||||
"script" : null,
|
||||
"groupId" : "a2b7765d540449b7bf93e070c1911ce9",
|
||||
"name" : "更新采购订单状态",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1732242575346,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/up/status",
|
||||
"method" : "POST",
|
||||
"parameters" : [ ],
|
||||
"options" : [ ],
|
||||
"requestBody" : "",
|
||||
"headers" : [ ],
|
||||
"paths" : [ ],
|
||||
"responseBody" : null,
|
||||
"description" : null,
|
||||
"requestBodyDefinition" : null,
|
||||
"responseBodyDefinition" : null
|
||||
}
|
||||
================================
|
||||
String status = body['status'];
|
||||
String documentNumber = body['documentNumber'];
|
||||
int res = db.table("mini_purchase_orders").where().eq('document_number', documentNumber)
|
||||
.update({
|
||||
document_number: documentNumber,
|
||||
status: status
|
||||
});
|
||||
|
||||
return res;
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,33 +0,0 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "dc813a08ffb84a09bc312d387b7a0910",
|
||||
"script" : null,
|
||||
"groupId" : "e631b317606f4246ac82585a7c1f1c5b",
|
||||
"name" : "更新销售状态",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1732242587148,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/up/status",
|
||||
"method" : "POST",
|
||||
"parameters" : [ ],
|
||||
"options" : [ ],
|
||||
"requestBody" : "",
|
||||
"headers" : [ ],
|
||||
"paths" : [ ],
|
||||
"responseBody" : null,
|
||||
"description" : null,
|
||||
"requestBodyDefinition" : null,
|
||||
"responseBodyDefinition" : null
|
||||
}
|
||||
================================
|
||||
String status = body['status'];
|
||||
String documentNumber = body['documentNumber'];
|
||||
int res = db.table("mini_sales_orders").where().eq('document_number', documentNumber)
|
||||
.update({
|
||||
document_number: documentNumber,
|
||||
status: status
|
||||
});
|
||||
|
||||
return res;
|
File diff suppressed because one or more lines are too long
@ -1,14 +0,0 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "753fe736c4d7438090c366180c352d95",
|
||||
"name" : "挤压排产",
|
||||
"type" : "function",
|
||||
"parentId" : "414d04bbdc2e4cb5a23145a0bfe0e649",
|
||||
"path" : "extrusionSchedule",
|
||||
"createTime" : 1732610226287,
|
||||
"updateTime" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"paths" : [ ],
|
||||
"options" : [ ]
|
||||
}
|
@ -1,93 +0,0 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "7f8e4140006446d28b625fcb7aa6b967",
|
||||
"script" : null,
|
||||
"groupId" : "753fe736c4d7438090c366180c352d95",
|
||||
"name" : "挤压排产列表",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1733381822225,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/list",
|
||||
"description" : null,
|
||||
"returnType" : null,
|
||||
"mappingPath" : null,
|
||||
"parameters" : [ ]
|
||||
}
|
||||
================================
|
||||
import '@/common/sql' as sql
|
||||
|
||||
String salesOrdeSelect = sql("salesOrder")
|
||||
String scheduleNumber = body["scheduleNumber"];
|
||||
String salesOrderCode = body["salesOrderCode"];
|
||||
String orderNo = body["orderNo"];
|
||||
String materialCode = body["materialCode"];
|
||||
String profileModel = body["profileModel"];
|
||||
String salesStatus = body["salesStatus"];
|
||||
|
||||
String extrusionDate = body['extrusionDate'];
|
||||
String customerId = body['customerId'];
|
||||
String surfaceMethod = body['surfaceMethod'];
|
||||
|
||||
String extrusionDateRang = body['extrusionDateRang']; // 排挤日期范围
|
||||
String extrusionMachine = body['extrusionMachine']; // 挤压机台
|
||||
String extrusionTeam = body['extrusionTeam']; // 挤压班组
|
||||
String materialName = body['materialName']; // 物料名称
|
||||
String specification = body['specification']; // 规格型号
|
||||
String orderLength = body['orderLength']; // 订单长度
|
||||
|
||||
var list = db.page("""
|
||||
select
|
||||
date_format(mes.extrusion_date, '%Y-%m-%d') as extrusion_date,
|
||||
mes.extrusion_machine,
|
||||
mpm.machine_name as extrusion_machine_name,
|
||||
mes.extrusion_team,
|
||||
su.user_name as extrusion_team_name,
|
||||
mesd.schedule_number,
|
||||
mesd.production_length,
|
||||
mesd.production_pieces,
|
||||
mesd.sawing_method,
|
||||
su2.user_name as salesperson_name,
|
||||
round((mesd.production_pieces * mesd.production_length * msm.weight), 4) as production_theoretical_weight,
|
||||
mpr.production_number,
|
||||
round((mpr.production_weight * mesd.production_length * mpr.production_number), 4) as production_weight,
|
||||
round((mesd.production_pieces - mpr.production_number), 4) as no_production_number,
|
||||
round(((mesd.production_pieces * mesd.production_length * msm.weight) - (mpr.production_weight * mesd.production_length * mpr.production_number)), 4) as no_production_weight,
|
||||
${salesOrdeSelect}
|
||||
from
|
||||
mini_extrusion_schedule_detail mesd
|
||||
left join mini_extrusion_schedule mes on mes.schedule_number = mesd.schedule_number
|
||||
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
|
||||
|
||||
left join mini_sales_order_materials msm
|
||||
on mesd.sales_order_code = msm.sales_order_code and mesd.material_code = msm.material_code and mesd.order_no = msm.order_no
|
||||
left join mini_sales_orders mso on mso.document_number = msm.sales_order_code
|
||||
left join sys_user su2 on su2.user_id = mso.salesperson
|
||||
left join (select schedule_number, sales_order_code, material_code, order_no, sum(production_number) as production_number, sum(production_weight) as production_weight
|
||||
from mini_process_report where is_completed = 1 group by schedule_number, sales_order_code, material_code, order_no) mpr
|
||||
on mesd.schedule_number = mpr.schedule_number and mesd.sales_order_code = mpr.sales_order_code
|
||||
and mesd.material_code = mpr.material_code and mesd.order_no = mpr.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}, '%')}
|
||||
?{orderNo != null and orderNo != '', and msm.order_no like concat('%', #{orderNo}, '%')}
|
||||
?{materialCode != null and materialCode != '', and msm.material_code like concat('%', #{materialCode}, '%')}
|
||||
?{profileModel != null and profileModel != '', and msm.profile_model like concat('%', #{profileModel}, '%')}
|
||||
?{salesStatus != null and salesStatus != '', and mso.status = #{salesStatus}}
|
||||
|
||||
?{extrusionDate!=null && extrusionDate!="", and date(mes.extrusion_date) = #{extrusionDate} }
|
||||
?{customerId != null and customerId != '', and mso.customer_id = #{customerId}}
|
||||
?{surfaceMethod != null and surfaceMethod != '', and msm.surface_method = #{surfaceMethod}}
|
||||
|
||||
?{extrusionDateRang != null and extrusionDateRang != '' and extrusionDateRang.size() > 0,
|
||||
and date(mes.extrusion_date) between #{extrusionDateRang[0]} and #{extrusionDateRang[1]}}
|
||||
?{extrusionMachine != null and extrusionMachine != '', and mes.extrusion_machine = #{extrusionMachine}}
|
||||
?{extrusionTeam != null and extrusionTeam != '', and mes.extrusion_team = #{extrusionTeam}}
|
||||
?{materialName != null and materialName != '', and msm.material_name like concat('%', #{materialName}, '%')}
|
||||
?{specification != null and specification != '', and msm.specification like concat('%', #{specification}, '%')}
|
||||
?{orderLength != null and orderLength != '', and msm.order_length = #{orderLength}}
|
||||
""")
|
||||
|
||||
return list.list
|
@ -1,88 +0,0 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "78482de7c59040fe9939e6628c02ee0f",
|
||||
"script" : null,
|
||||
"groupId" : "753fe736c4d7438090c366180c352d95",
|
||||
"name" : "挤压排产总数",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1733380095789,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/count",
|
||||
"description" : null,
|
||||
"returnType" : null,
|
||||
"mappingPath" : null,
|
||||
"parameters" : [ {
|
||||
"name" : "body",
|
||||
"value" : null,
|
||||
"description" : null,
|
||||
"required" : false,
|
||||
"dataType" : "String",
|
||||
"type" : null,
|
||||
"defaultValue" : null,
|
||||
"validateType" : null,
|
||||
"error" : null,
|
||||
"expression" : null,
|
||||
"children" : null
|
||||
} ]
|
||||
}
|
||||
================================
|
||||
import '@/common/sql' as sql
|
||||
|
||||
String salesOrdeSelect = sql("salesOrder")
|
||||
String scheduleNumber = body["scheduleNumber"];
|
||||
String salesOrderCode = body["salesOrderCode"];
|
||||
String orderNo = body["orderNo"];
|
||||
String materialCode = body["materialCode"];
|
||||
String profileModel = body["profileModel"];
|
||||
String salesStatus = body["salesStatus"];
|
||||
|
||||
String extrusionDate = body['extrusionDate'];
|
||||
String customerId = body['customerId'];
|
||||
String surfaceMethod = body['surfaceMethod'];
|
||||
|
||||
String extrusionDateRang = body['extrusionDateRang']; // 排挤日期范围
|
||||
String extrusionMachine = body['extrusionMachine']; // 挤压机台
|
||||
String extrusionTeam = body['extrusionTeam']; // 挤压班组
|
||||
String materialName = body['materialName']; // 物料名称
|
||||
String specification = body['specification']; // 规格型号
|
||||
String orderLength = body['orderLength']; // 订单长度
|
||||
|
||||
return db.selectInt("""
|
||||
select
|
||||
count(1)
|
||||
from
|
||||
mini_extrusion_schedule_detail mesd
|
||||
left join mini_extrusion_schedule mes on mes.schedule_number = mesd.schedule_number
|
||||
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
|
||||
|
||||
left join mini_sales_order_materials msm
|
||||
on mesd.sales_order_code = msm.sales_order_code and mesd.material_code = msm.material_code and mesd.order_no = msm.order_no
|
||||
left join mini_sales_orders mso on mso.document_number = msm.sales_order_code
|
||||
left join sys_user su2 on su2.user_id = mso.salesperson
|
||||
left join (select schedule_number, sales_order_code, material_code, order_no, sum(production_number) as production_number, sum(production_weight) as production_weight
|
||||
from mini_process_report where is_completed = 1 group by schedule_number, sales_order_code, material_code, order_no) mpr
|
||||
on mesd.schedule_number = mpr.schedule_number and mesd.sales_order_code = mpr.sales_order_code
|
||||
and mesd.material_code = mpr.material_code and mesd.order_no = mpr.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}, '%')}
|
||||
?{orderNo != null and orderNo != '', and msm.order_no like concat('%', #{orderNo}, '%')}
|
||||
?{materialCode != null and materialCode != '', and msm.material_code like concat('%', #{materialCode}, '%')}
|
||||
?{profileModel != null and profileModel != '', and msm.profile_model like concat('%', #{profileModel}, '%')}
|
||||
?{salesStatus != null and salesStatus != '', and mso.status = #{salesStatus}}
|
||||
|
||||
?{extrusionDate!=null && extrusionDate!="", and date(mes.extrusion_date) = #{extrusionDate} }
|
||||
?{customerId != null and customerId != '', and mso.customer_id = #{customerId}}
|
||||
?{surfaceMethod != null and surfaceMethod != '', and msm.surface_method = #{surfaceMethod}}
|
||||
|
||||
?{extrusionDateRang != null and extrusionDateRang != '' and extrusionDateRang.size() > 0,
|
||||
and date(mes.extrusion_date) between #{extrusionDateRang[0]} and #{extrusionDateRang[1]}}
|
||||
?{extrusionMachine != null and extrusionMachine != '', and mes.extrusion_machine = #{extrusionMachine}}
|
||||
?{extrusionTeam != null and extrusionTeam != '', and mes.extrusion_team = #{extrusionTeam}}
|
||||
?{materialName != null and materialName != '', and msm.material_name like concat('%', #{materialName}, '%')}
|
||||
?{specification != null and specification != '', and msm.specification like concat('%', #{specification}, '%')}
|
||||
?{orderLength != null and orderLength != '', and msm.order_length = #{orderLength}}
|
||||
""")
|
@ -1,14 +0,0 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "ac6602436d574b049dcf80eee3ff5d8d",
|
||||
"name" : "订单跟踪",
|
||||
"type" : "function",
|
||||
"parentId" : "414d04bbdc2e4cb5a23145a0bfe0e649",
|
||||
"path" : "orderTracking",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1732601307816,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"paths" : [ ],
|
||||
"options" : [ ]
|
||||
}
|
@ -1,318 +0,0 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "b9d2add17088436ea92dd36fd1462557",
|
||||
"script" : null,
|
||||
"groupId" : "ac6602436d574b049dcf80eee3ff5d8d",
|
||||
"name" : "订单跟踪列表",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1733381771955,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/list",
|
||||
"description" : null,
|
||||
"returnType" : null,
|
||||
"mappingPath" : null,
|
||||
"parameters" : [ {
|
||||
"name" : "salesOrderList",
|
||||
"value" : null,
|
||||
"description" : null,
|
||||
"required" : false,
|
||||
"dataType" : "String",
|
||||
"type" : "java.lang.Object",
|
||||
"defaultValue" : null,
|
||||
"validateType" : null,
|
||||
"error" : null,
|
||||
"expression" : null,
|
||||
"children" : null
|
||||
} ]
|
||||
}
|
||||
================================
|
||||
String salesOrderCode = body['salesOrderCode'];
|
||||
String orderNo = body['orderNo'];
|
||||
String materialCode = body['materialCode'];
|
||||
String profileModel = body['profileModel'];
|
||||
String customerId = body['customerId'];
|
||||
String surfaceMethod = body['surfaceMethod'];
|
||||
|
||||
println("订单跟踪列表")
|
||||
println(body)
|
||||
|
||||
// ==============================
|
||||
// 1.查询销售单明细
|
||||
// ==============================
|
||||
var sql = """
|
||||
select
|
||||
msom.sales_order_code,
|
||||
msom.order_no,
|
||||
msom.material_code,
|
||||
msom.material_name,
|
||||
msom.profile_model,
|
||||
msom.specification,
|
||||
msom.thickness,
|
||||
msom.weight,
|
||||
msom.order_length,
|
||||
msom.order_total_quantity,
|
||||
msom.surface_method,
|
||||
msom.delivery_date,
|
||||
msom.theoretical_weight,
|
||||
msom.produced_pieces,
|
||||
msom.produced_length
|
||||
from mini_sales_order_materials msom
|
||||
left join mini_sales_orders mso on mso.document_number = msom.sales_order_code
|
||||
where 1=1
|
||||
?{orderNo != null and orderNo != '', and msom.order_no like concat('%', #{orderNo}, '%')}
|
||||
?{materialCode != null and materialCode != '', and msom.material_code like concat('%', #{materialCode}, '%')}
|
||||
?{profileModel != null and profileModel != '', and msom.profile_model like concat('%', #{profileModel}, '%')}
|
||||
?{customerId != null and customerId != '', and mso.customer_id = #{customerId}}
|
||||
?{surfaceMethod != null and surfaceMethod != '', and msom.surface_method = #{surfaceMethod}}
|
||||
?{salesOrderCode != null and salesOrderCode != '', and msom.sales_order_code = #{salesOrderCode}}
|
||||
"""
|
||||
|
||||
Map pages = db.page(sql);
|
||||
|
||||
List salesOrderList = pages.list;
|
||||
|
||||
if (salesOrderList.size() == 0) {
|
||||
return []
|
||||
}
|
||||
|
||||
// ==============================
|
||||
// 2.查询生产计划数据
|
||||
// ==============================
|
||||
var sql2 = """
|
||||
select
|
||||
sales_order_code,
|
||||
order_no,
|
||||
sum(planned_pieces) as planned_pieces
|
||||
from mini_production_schedule
|
||||
where 1=1 and (sales_order_code, order_no) in (
|
||||
<foreach item='item' index='index' collection='salesOrderList' separator=','>
|
||||
(#{item.salesOrderCode}, #{item.orderNo})
|
||||
</foreach>
|
||||
)
|
||||
group by sales_order_code, order_no
|
||||
"""
|
||||
List productionScheduleList = db.select(sql2)
|
||||
|
||||
|
||||
// ==============================
|
||||
// 3.查询挤压排产数据
|
||||
// ==============================
|
||||
var sql3 = """
|
||||
select
|
||||
sales_order_code,
|
||||
order_no,
|
||||
group_concat(schedule_number order by schedule_number separator ', ') as schedule_number,
|
||||
sum(production_length) as production_length,
|
||||
sum(production_pieces) as production_pieces,
|
||||
max(sawing_method) as sawing_method
|
||||
from mini_extrusion_schedule_detail
|
||||
where 1=1 and (sales_order_code, order_no) in (
|
||||
<foreach item='item' index='index' collection='salesOrderList' separator=','>
|
||||
(#{item.salesOrderCode}, #{item.orderNo})
|
||||
</foreach>
|
||||
)
|
||||
group by sales_order_code, order_no
|
||||
"""
|
||||
List extrusionScheduleDetail = db.select(sql3)
|
||||
|
||||
|
||||
// ==============================
|
||||
// 4.查询报工数据
|
||||
// ==============================
|
||||
var sql4 = """
|
||||
select
|
||||
mpr.sales_order_code,
|
||||
mpr.order_no,
|
||||
mpr.current_process,
|
||||
round((sum(mesd.production_length) * sum(production_number) * sum(production_weight)), 4) as actual_weight_mesd,
|
||||
round((sum(msom.order_length) * sum(production_number) * sum(production_weight)), 4) as actual_weight_msom,
|
||||
sum(production_number) as production_number,
|
||||
max(production_weight) as production_weight
|
||||
from mini_process_report mpr
|
||||
left join mini_extrusion_schedule_detail mesd
|
||||
on mpr.sales_order_code = mesd.sales_order_code and mpr.order_no = mesd.order_no
|
||||
left join mini_sales_order_materials msom
|
||||
on mpr.sales_order_code = msom.sales_order_code and mpr.order_no = msom.order_no
|
||||
where 1=1 and (mpr.sales_order_code, mpr.order_no) in (
|
||||
<foreach item='item' index='index' collection='salesOrderList' separator=','>
|
||||
(#{item.salesOrderCode}, #{item.orderNo})
|
||||
</foreach>
|
||||
)
|
||||
group by mpr.sales_order_code, mpr.order_no, mpr.current_process
|
||||
"""
|
||||
|
||||
|
||||
List processReportList = db.select(sql4)
|
||||
|
||||
// 处理数据
|
||||
// actualWeightMesd 排产长度计算
|
||||
// actualWeightMsom 订单长度计算
|
||||
var processReportFinalList = []
|
||||
var arr = ['jingqie','dk','bz']
|
||||
processReportList.group(it => it.salesOrderCode + "_" + it.orderNo, // 根据api_group_id 分组
|
||||
list => list.group(item => item.currentProcess,
|
||||
obj => obj
|
||||
)
|
||||
).each((key, value) => {
|
||||
var jsonObj = {}
|
||||
value.each((key1, value1) => {
|
||||
var val = value1[0];
|
||||
jsonObj["salesOrderCode"] = val.salesOrderCode;
|
||||
jsonObj["orderNo"] = val.orderNo;
|
||||
if (arr.contains(key1)) {
|
||||
jsonObj[key1 + "_actualWeight"] = val.actualWeightMsom;
|
||||
} else {
|
||||
jsonObj[key1 + "_actualWeight"] = val.actualWeightMesd;
|
||||
}
|
||||
|
||||
jsonObj[key1 + "_productionNumber"] = val.productionNumber;
|
||||
jsonObj[key1 + "_productionWeight"] = val.productionWeight;
|
||||
})
|
||||
processReportFinalList.push(jsonObj)
|
||||
})
|
||||
|
||||
|
||||
// ==============================
|
||||
// 5.查询长料报废数据
|
||||
// 挤压、精品、氧化上排、氧化下排工序
|
||||
// ==============================
|
||||
var sql5 = """
|
||||
select
|
||||
sales_order_code,
|
||||
order_no,
|
||||
sum(scrap_number) as long_scrap_number,
|
||||
sum(scrap_weight) as long_scrap_weight
|
||||
from mini_process_report mpr
|
||||
where 1=1 and mpr.current_process in ('jiya','jinpin','yanghua1','yanghua2')
|
||||
and (mpr.sales_order_code, mpr.order_no) in (
|
||||
<foreach item='item' index='index' collection='salesOrderList' separator=','>
|
||||
(#{item.salesOrderCode}, #{item.orderNo})
|
||||
</foreach>
|
||||
)
|
||||
group by mpr.sales_order_code, mpr.order_no
|
||||
"""
|
||||
List processReportLongList = db.select(sql5)
|
||||
|
||||
// ==============================
|
||||
// 6.查询短料报废数据
|
||||
// 精切,打孔,包装工序
|
||||
// ==============================
|
||||
var sql6 = """
|
||||
select
|
||||
sales_order_code,
|
||||
order_no,
|
||||
sum(scrap_number) as shortage_scrap_number,
|
||||
sum(scrap_weight) as shortage_scrap_weight
|
||||
from mini_process_report mpr
|
||||
where 1=1 and mpr.current_process in ('jingqie','dk','bz')
|
||||
and (mpr.sales_order_code, mpr.order_no) in (
|
||||
<foreach item='item' index='index' collection='salesOrderList' separator=','>
|
||||
(#{item.salesOrderCode}, #{item.orderNo})
|
||||
</foreach>
|
||||
)
|
||||
group by mpr.sales_order_code, mpr.order_no
|
||||
"""
|
||||
List processReportShortageList = db.select(sql6)
|
||||
|
||||
// ==============================
|
||||
// 7.入库状况
|
||||
// ==============================
|
||||
var sql7 = """
|
||||
select
|
||||
mpr.sales_order_code,
|
||||
mpr.order_no,
|
||||
sum(mpr.receipt_quantity) as receipt_quantity,
|
||||
sum(mpr.actual_weight) as actual_weight
|
||||
from
|
||||
mini_product_receipt mpr
|
||||
where 1=1
|
||||
and (mpr.sales_order_code, mpr.order_no) in (
|
||||
<foreach item='item' index='index' collection='salesOrderList' separator=','>
|
||||
(#{item.salesOrderCode}, #{item.orderNo})
|
||||
</foreach>
|
||||
)
|
||||
group by mpr.sales_order_code, mpr.order_no
|
||||
"""
|
||||
List productReceiptList = db.select(sql7)
|
||||
|
||||
// ==============================
|
||||
// 8.出库和库存数据
|
||||
// ==============================
|
||||
// (sum(mwp.existing_inventory) - sum(mssm.shipment_quantity)) as no_shipment_quantity,
|
||||
// (sum(mwp.actual_weight) - sum(mssm.actual_weight)) as no_actual_weight,
|
||||
var sql8 = """
|
||||
select
|
||||
mssm.sales_order_code,
|
||||
mssm.order_no,
|
||||
sum(mssm.shipment_quantity) as shipment_quantity,
|
||||
sum(mssm.actual_weight) as shipment_actual_weight,
|
||||
sum(mwp.existing_inventory) as no_shipment_quantity,
|
||||
sum(mwp.actual_weight) as no_actual_weight,
|
||||
round((sum(mwp.existing_inventory) + sum(mssm.shipment_quantity)), 4) as existing_inventory,
|
||||
round((sum(mwp.actual_weight) + sum(mssm.actual_weight)), 4) as existing_actual_weight
|
||||
from
|
||||
mini_sales_shipment_materials mssm
|
||||
left join mini_warehouse_product mwp on
|
||||
mwp.order_no = mssm.order_no
|
||||
and mwp.sales_order_code = mssm.sales_order_code
|
||||
where 1=1
|
||||
and (mssm.sales_order_code, mssm.order_no) in (
|
||||
<foreach item='item' index='index' collection='salesOrderList' separator=','>
|
||||
(#{item.salesOrderCode}, #{item.orderNo})
|
||||
</foreach>
|
||||
)
|
||||
group by mssm.sales_order_code, mssm.order_no
|
||||
"""
|
||||
List salesShipmenList = db.select(sql8)
|
||||
|
||||
var result = select
|
||||
a.*,
|
||||
b.plannedPieces,
|
||||
c.productionLength,
|
||||
c.productionPieces,
|
||||
c.sawingMethod,
|
||||
ifnull(e.longScrapNumber, 0) longScrapNumber,
|
||||
ifnull(e.longScrapWeight, 0) longScrapWeight,
|
||||
ifnull(f.shortageScrapNumber, 0) shortageScrapNumber,
|
||||
ifnull(f.shortageScrapWeight, 0) shortageScrapWeight,
|
||||
ifnull(d.jiya_actualWeight, 0) jiya_actualWeight,
|
||||
ifnull(d.jiya_productionNumber, 0) jiya_productionNumber,
|
||||
ifnull(d.jiya_productionWeight, 0) jiya_productionWeight,
|
||||
ifnull(d.jingpin_actualWeight, 0) jingpin_actualWeight,
|
||||
ifnull(d.jingpin_productionNumber, 0) jingpin_productionNumber,
|
||||
ifnull(d.jingpin_productionWeight, 0) jingpin_productionWeight,
|
||||
ifnull(d.yanghau1_actualWeight, 0) yanghau1_actualWeight,
|
||||
ifnull(d.yanghau1_productionNumber, 0) yanghau1_productionNumber,
|
||||
ifnull(d.yanghau1_productionWeight, 0) yanghau1_productionWeight,
|
||||
ifnull(d.yanghua2_actualWeight, 0) yanghua2_actualWeight,
|
||||
ifnull(d.yanghua2_productionNumber, 0) yanghua2_productionNumber,
|
||||
ifnull(d.yanghua2_productionWeight, 0) yanghua2_productionWeight,
|
||||
ifnull(d.jingqie_actualWeight, 0) jingqie_actualWeight,
|
||||
ifnull(d.jingqie_productionNumber, 0) jingqie_productionNumber,
|
||||
ifnull(d.jingqie_productionWeight, 0) jingqie_productionWeight,
|
||||
ifnull(d.dk_actualWeight, 0) dk_actualWeight,
|
||||
ifnull(d.dk_productionNumber, 0) dk_productionNumber,
|
||||
ifnull(d.dk_productionWeight, 0) dk_productionWeight,
|
||||
ifnull(d.bz_actualWeight, 0) bz_actualWeight,
|
||||
ifnull(d.bz_productionNumber, 0) bz_productionNumber,
|
||||
ifnull(d.bz_productionWeight, 0) bz_productionWeight,
|
||||
ifnull(g.receiptQuantity, 0) receiptQuantity,
|
||||
ifnull(g.actualWeight, 0) actualWeight,
|
||||
ifnull(h.shipmentQuantity, 0) shipmentQuantity,
|
||||
ifnull(h.shipmentActualWeight, 0) shipmentActualWeight,
|
||||
ifnull(h.noShipmentQuantity, 0) noShipmentQuantity,
|
||||
ifnull(h.noActualWeight, 0) noActualWeight,
|
||||
ifnull(h.existingInventory, 0) existingInventory,
|
||||
ifnull(h.existingActualWeight, 0) existingActualWeight
|
||||
from salesOrderList a
|
||||
left join productionScheduleList b on a.salesOrderCode = b.salesOrderCode and a.orderNo = b.orderNo
|
||||
left join extrusionScheduleDetail c on a.salesOrderCode = c.salesOrderCode and a.orderNo = c.orderNo
|
||||
left join processReportFinalList d on a.salesOrderCode = d.salesOrderCode and a.orderNo = d.orderNo
|
||||
left join processReportLongList e on a.salesOrderCode = e.salesOrderCode and a.orderNo = e.orderNo
|
||||
left join processReportShortageList f on a.salesOrderCode = f.salesOrderCode and a.orderNo = f.orderNo
|
||||
left join productReceiptList g on a.salesOrderCode = g.salesOrderCode and a.orderNo = g.orderNo
|
||||
left join salesShipmenList h on a.salesOrderCode = h.salesOrderCode and a.orderNo = h.orderNo
|
||||
|
||||
return result
|
@ -1,52 +0,0 @@
|
||||
{
|
||||
"properties" : { },
|
||||
"id" : "d96963a3d8d94fb2acb55a09d05266f9",
|
||||
"script" : null,
|
||||
"groupId" : "ac6602436d574b049dcf80eee3ff5d8d",
|
||||
"name" : "订单跟踪总数",
|
||||
"createTime" : null,
|
||||
"updateTime" : 1732603321523,
|
||||
"lock" : null,
|
||||
"createBy" : null,
|
||||
"updateBy" : null,
|
||||
"path" : "/count",
|
||||
"description" : null,
|
||||
"returnType" : null,
|
||||
"mappingPath" : null,
|
||||
"parameters" : [ {
|
||||
"name" : "body",
|
||||
"value" : null,
|
||||
"description" : null,
|
||||
"required" : false,
|
||||
"dataType" : "String",
|
||||
"type" : "java.util.Map",
|
||||
"defaultValue" : null,
|
||||
"validateType" : null,
|
||||
"error" : null,
|
||||
"expression" : null,
|
||||
"children" : null
|
||||
} ]
|
||||
}
|
||||
================================
|
||||
String salesOrderCode = body['salesOrderCode'];
|
||||
String orderNo = body['orderNo'];
|
||||
String materialCode = body['materialCode'];
|
||||
String profileModel = body['profileModel'];
|
||||
String customerId = body['customerId'];
|
||||
String surfaceMethod = body['surfaceMethod'];
|
||||
|
||||
var sql = """
|
||||
select
|
||||
count(1)
|
||||
from mini_sales_order_materials msom
|
||||
left join mini_sales_orders mso on mso.document_number = msom.sales_order_code
|
||||
where 1=1
|
||||
?{orderNo != null and orderNo != '', and msom.order_no like concat('%', #{orderNo}, '%')}
|
||||
?{materialCode != null and materialCode != '', and msom.material_code like concat('%', #{materialCode}, '%')}
|
||||
?{profileModel != null and profileModel != '', and msom.profile_model like concat('%', #{profileModel}, '%')}
|
||||
?{customerId != null and customerId != '', and mso.customer_id = #{customerId}}
|
||||
?{surfaceMethod != null and surfaceMethod != '', and msom.surface_method = #{surfaceMethod}}
|
||||
?{salesOrderCode != null and salesOrderCode != '', and msom.sales_order_code = #{salesOrderCode}}
|
||||
"""
|
||||
|
||||
return db.selectInt(sql);
|
@ -1,66 +0,0 @@
|
||||
-- 物料拆分
|
||||
ALTER TABLE `883web`.mini_sales_returns_materials ADD order_no varchar(100) NULL COMMENT '订单号';
|
||||
ALTER TABLE `883web`.mini_process_report ADD order_no varchar(100) NULL COMMENT '订单号';
|
||||
ALTER TABLE `883web`.mini_production_schedule ADD order_no varchar(100) NULL COMMENT '订单号';
|
||||
ALTER TABLE `883web`.mini_extrusion_schedule_detail ADD order_no varchar(100) NULL COMMENT '订单号';
|
||||
ALTER TABLE `883web`.mini_product_receipt ADD order_no varchar(100) NULL COMMENT '订单号';
|
||||
|
||||
ALTER TABLE `883web`.mini_production_schedule ADD status TINYINT DEFAULT 0 NULL COMMENT '状态 0-未排产 1-已排产';
|
||||
ALTER TABLE `883web`.mini_extrusion_schedule_detail ADD status TINYINT DEFAULT 0 NULL COMMENT '状态 0-未完 1-完成';
|
||||
|
||||
ALTER TABLE mini_process_report
|
||||
ADD COLUMN mold_code VARCHAR(100) COMMENT '模具编码',
|
||||
ADD COLUMN mold_model VARCHAR(100) COMMENT '模具型号',
|
||||
ADD COLUMN mold_thickness DECIMAL(15,4) COMMENT '模厚',
|
||||
ADD COLUMN mold_manufacturer VARCHAR(100) COMMENT '模具厂家',
|
||||
ADD COLUMN mold_color VARCHAR(100) COMMENT '颜色',
|
||||
ADD COLUMN mold_change_reason TEXT COMMENT '换模原因',
|
||||
ADD COLUMN rod_count INT COMMENT '用棒支数';
|
||||
|
||||
ALTER TABLE mini_process_report
|
||||
ADD COLUMN stock_quantity int DEFAULT 0 COMMENT '已入库数量';
|
||||
|
||||
-- 新增菜单
|
||||
INSERT INTO `883web`.sys_menu
|
||||
(parent, name, `path`, component, redirect, meta, status, create_by, sort)
|
||||
VALUES('processReportManage', 'processReport_jy',
|
||||
'/mini/productionManagement/processReport?type=jy',
|
||||
'mini/productionManagement/processReport?type=jy', NULL,
|
||||
'{"icon": "", "type": "menu", "affix": null, "color": null, "title": "挤压报工", "active": null, "hidden": false, "hiddenBreadcrumb": false}', '0', '', NULL);
|
||||
INSERT INTO `883web`.sys_menu
|
||||
(parent, name, `path`, component, redirect, meta, status, create_by, sort)
|
||||
VALUES('processReportManage', 'processReport_dk',
|
||||
'/mini/productionManagement/processReport?type=dk',
|
||||
'mini/productionManagement/processReport?type=dk', NULL,
|
||||
'{"icon": "", "type": "menu", "affix": null, "color": null, "title": "打孔报工", "active": null, "hidden": false, "hiddenBreadcrumb": false}', '0', '', NULL);
|
||||
INSERT INTO `883web`.sys_menu
|
||||
(parent, name, `path`, component, redirect, meta, status, create_by, sort)
|
||||
VALUES('processReportManage', 'processReport_jingpin',
|
||||
'/mini/productionManagement/processReport?type=jingpin',
|
||||
'mini/productionManagement/processReport?type=jingpin', NULL,
|
||||
'{"icon": "", "type": "menu", "affix": null, "color": null, "title": "精品报工", "active": null, "hidden": false, "hiddenBreadcrumb": false}', '0', '', NULL);
|
||||
INSERT INTO `883web`.sys_menu
|
||||
(parent, name, `path`, component, redirect, meta, status, create_by, sort)
|
||||
VALUES('processReportManage', 'processReport_yanghua1',
|
||||
'/mini/productionManagement/processReport?type=yanghua1',
|
||||
'mini/productionManagement/processReport?type=yanghua1', NULL,
|
||||
'{"icon": "", "type": "menu", "affix": null, "color": null, "title": "氧化上排报工", "active": null, "hidden": false, "hiddenBreadcrumb": false}', '0', '', NULL);
|
||||
INSERT INTO `883web`.sys_menu
|
||||
(parent, name, `path`, component, redirect, meta, status, create_by, sort)
|
||||
VALUES('processReportManage', 'processReport_yanghua2',
|
||||
'/mini/productionManagement/processReport?type=yanghua2',
|
||||
'mini/productionManagement/processReport?type=yanghua2', NULL,
|
||||
'{"icon": "", "type": "menu", "affix": null, "color": null, "title": "氧化下排报工", "active": null, "hidden": false, "hiddenBreadcrumb": false}', '0', '', NULL);
|
||||
INSERT INTO `883web`.sys_menu
|
||||
(parent, name, `path`, component, redirect, meta, status, create_by, sort)
|
||||
VALUES('processReportManage', 'processReport_jingqie',
|
||||
'/mini/productionManagement/processReport?type=jingqie',
|
||||
'mini/productionManagement/processReport?type=jingqie', NULL,
|
||||
'{"icon": "", "type": "menu", "affix": null, "color": null, "title": "精切报工", "active": null, "hidden": false, "hiddenBreadcrumb": false}', '0', '', NULL);
|
||||
INSERT INTO `883web`.sys_menu
|
||||
(parent, name, `path`, component, redirect, meta, status, create_by, sort)
|
||||
VALUES('processReportManage', 'processReport_bz',
|
||||
'/mini/productionManagement/processReport?type=bz',
|
||||
'mini/productionManagement/processReport?type=bz', NULL,
|
||||
'{"icon": "", "type": "menu", "affix": null, "color": null, "title": "包装报工", "active": null, "hidden": false, "hiddenBreadcrumb": false}', '0', '', NULL);
|
||||
|
@ -1,2 +0,0 @@
|
||||
ALTER TABLE `883web`.mini_purchase_orders ADD status TINYINT DEFAULT 0 NULL COMMENT '状态 0-未完 1-完成';
|
||||
ALTER TABLE `883web`.mini_sales_orders ADD status TINYINT DEFAULT 0 NULL COMMENT '状态 0-未完 1-完成';
|
Loading…
Reference in New Issue