Compare commits

..

No commits in common. 'main' and 'v1.0.0' have entirely different histories.
main ... v1.0.0

@ -1,10 +1,8 @@
package com.currency.appengine.controller; package com.currency.appengine.controller;
import com.currency.appengine.domain.CustomerReq; import com.currency.appengine.domain.CustomerReq;
import com.currency.appengine.domain.SupplierReq;
import com.currency.appengine.service.common.CommonServices; import com.currency.appengine.service.common.CommonServices;
import com.currency.appengine.service.system.CustomerService; import com.currency.appengine.service.system.CustomerService;
import com.currency.appengine.service.system.SupplierService;
import com.currency.appengine.utils.Result; import com.currency.appengine.utils.Result;
import java.util.Map; import java.util.Map;
import java.util.Objects; import java.util.Objects;
@ -25,8 +23,7 @@ public class OpenController {
@Autowired @Autowired
private CustomerService customerService; private CustomerService customerService;
@Autowired @Autowired
private SupplierService supplierService; private CommonServices commonServices;
@PostMapping("/add") @PostMapping("/add")
public Result add(@RequestBody Map<String, Object> obj) { public Result add(@RequestBody Map<String, Object> obj) {
@ -49,23 +46,4 @@ public class OpenController {
customerReq.setCreateBy("超级管理员"); customerReq.setCreateBy("超级管理员");
return Result.suc(customerService.AsynCustomer(customerReq)); return Result.suc(customerService.AsynCustomer(customerReq));
} }
@PostMapping("/add/supplier")
public Result addSupplier(@RequestBody Map<String, Object> obj) {
SupplierReq supplierReq = new SupplierReq();
supplierReq.setSupplierName(obj.get("name").toString());
if (Objects.nonNull(obj.get("phone"))) {
supplierReq.setContactPhone(obj.get("phone").toString());
}
if (Objects.nonNull(obj.get("address"))) {
supplierReq.setAddress(obj.get("address").toString());
}
supplierReq.setStatus(1);
supplierReq.setIsAuto(true);
supplierReq.setSettlementCurrency("CNY");
supplierReq.setTax("text2");
supplierReq.setIsTaxIncluded(1);
supplierReq.setCreateBy("超级管理员");
return Result.suc(supplierService.AsynSupplier(supplierReq));
}
} }

@ -4,10 +4,8 @@ import cn.hutool.captcha.CaptchaUtil;
import cn.hutool.captcha.LineCaptcha; import cn.hutool.captcha.LineCaptcha;
import com.currency.appengine.annotation.CheckToken; import com.currency.appengine.annotation.CheckToken;
import com.currency.appengine.domain.CustomerReq; import com.currency.appengine.domain.CustomerReq;
import com.currency.appengine.domain.SupplierReq;
import com.currency.appengine.domain.system.SysParam; import com.currency.appengine.domain.system.SysParam;
import com.currency.appengine.service.system.CustomerService; import com.currency.appengine.service.system.CustomerService;
import com.currency.appengine.service.system.SupplierService;
import com.currency.appengine.service.system.SysMenuService; import com.currency.appengine.service.system.SysMenuService;
import com.currency.appengine.service.system.SysParamService; import com.currency.appengine.service.system.SysParamService;
import com.currency.appengine.service.system.SysRoleService; import com.currency.appengine.service.system.SysRoleService;
@ -48,8 +46,6 @@ public class SystemController {
SysParamService sysParamService; SysParamService sysParamService;
@Autowired @Autowired
CustomerService customerService; CustomerService customerService;
@Autowired
SupplierService supplierService;
/* /*
* *
@ -337,9 +333,7 @@ public class SystemController {
return sysParamService.cacheUpdate(); return sysParamService.cacheUpdate();
} }
/**
*
*/
@PostMapping("/customer/add") @PostMapping("/customer/add")
@CheckToken @CheckToken
public Result addCustomer(HttpServletRequest request, @RequestBody CustomerReq customerReq) { public Result addCustomer(HttpServletRequest request, @RequestBody CustomerReq customerReq) {
@ -347,14 +341,4 @@ public class SystemController {
customerReq.setUserId(userId); customerReq.setUserId(userId);
return Result.suc(customerService.addCustomer(customerReq)); return Result.suc(customerService.addCustomer(customerReq));
} }
/**
*
*/
@PostMapping("/supplier/add")
@CheckToken
public Result addSupplier(HttpServletRequest request, @RequestBody SupplierReq supplierReq) {
String userId = StringUtil.objectToString(request.getAttribute("openid"));
supplierReq.setUserId(userId);
return Result.suc(supplierService.addSupplier(supplierReq));
}
} }

@ -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);
}

@ -38,7 +38,7 @@ public class CommonServices {
grantTypeMap.put("OrderNumber", params -> orderNumber(params)); // 订单编号 grantTypeMap.put("OrderNumber", params -> orderNumber(params)); // 订单编号
grantTypeMap.put("ProductionPlan", params -> productionPlan(params)); // 生产计划 grantTypeMap.put("ProductionPlan", params -> productionPlan(params)); // 生产计划
grantTypeMap.put("ProductionSchedulingNumber", params -> productionSchedulingNumber(params)); // 排产编号 grantTypeMap.put("ProductionSchedulingNumber", params -> productionSchedulingNumber(params)); // 排产编号
grantTypeMap.put("ProductionOrderNumber", params -> productionOrderNumber(params)); // 报工单号 grantTypeMap.put("ProductionOrderNumber", params -> productionOrderNumber(params)); // 排产单号
grantTypeMap.put("PurchaseNumber", params -> purchaseNumber(params)); // 采购编号 grantTypeMap.put("PurchaseNumber", params -> purchaseNumber(params)); // 采购编号
Function<Map<String, Object>,String> result = grantTypeMap.get(type); Function<Map<String, Object>,String> result = grantTypeMap.get(type);

@ -1,7 +1,6 @@
package com.currency.appengine.service.system; package com.currency.appengine.service.system;
import com.currency.appengine.domain.CustomerReq; import com.currency.appengine.domain.CustomerReq;
import com.currency.appengine.domain.SupplierReq;
/** /**
* @author zk * @author zk

@ -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,7 +1,6 @@
package com.currency.appengine.service.system.imp; package com.currency.appengine.service.system.imp;
import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.io.IORuntimeException;
import cn.hutool.extra.spring.SpringUtil; import cn.hutool.extra.spring.SpringUtil;
import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpResponse;
@ -48,7 +47,6 @@ public class CustomerServiceImpl implements CustomerService {
customerMapper.updateCodeById(customerReq); customerMapper.updateCodeById(customerReq);
try { try {
aysnO2(customerReq); aysnO2(customerReq);
aysnO1(customerReq);
} catch (Exception e) { } catch (Exception e) {
log.warn("同步客户信息异常", e); log.warn("同步客户信息异常", e);
} }
@ -109,46 +107,4 @@ public class CustomerServiceImpl implements CustomerService {
} }
} }
} }
/**
* O1
*/
private static void aysnO1(CustomerReq req) {
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.customer");
Map<String, String> map = new HashMap<>();
AysnCustomer customer = new AysnCustomer();
customer.setName(req.getCustomerName());
customer.setPhone(req.getContactPhone());
customer.setRemark(req.getRemarks());
customer.setAddress(req.getAddress());
// customer.setCreateTime(crmCustomer.getCreateTime().getTime());
Map<String, Object> toMap = BeanUtil.beanToMap(customer, 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(customer))
.execute();
} catch (IORuntimeException e) {
log.warn("同步失败", e);
return;
}
String body = response.body();
if (response.isOk()) {
log.info("同步成功");
}
}
}
} }

@ -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("请求成功");
}
}
}
}

@ -66,7 +66,7 @@ public class SwaggerProvider {
String groupName = this.magicResourceService.getGroupName(info.getGroupId()) String groupName = this.magicResourceService.getGroupName(info.getGroupId())
.replace("/", "-").replace("小程序端API-", ""); .replace("/", "-").replace("小程序端API-", "");
String requestPath = PathUtils.replaceSlash(this.prefix + this.magicResourceService.getGroupPath(info.getGroupId()) + "/" + info.getPath()); String requestPath = PathUtils.replaceSlash(this.prefix + this.magicResourceService.getGroupPath(info.getGroupId()) + "/" + info.getPath());
Pattern p = Pattern.compile("^/web/(?!test).*"); Pattern p = Pattern.compile("^/api/(?!test).*");
Matcher m = p.matcher(requestPath); Matcher m = p.matcher(requestPath);
if (!m.find()) continue; if (!m.find()) continue;
SwaggerEntity.Path path = new SwaggerEntity.Path(info.getId()); SwaggerEntity.Path path = new SwaggerEntity.Path(info.getId());

@ -5,7 +5,7 @@
"groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a", "groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a",
"name" : "列表", "name" : "列表",
"createTime" : null, "createTime" : null,
"updateTime" : 1730109402968, "updateTime" : 1726815371252,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -46,54 +46,31 @@
"responseBodyDefinition" : null "responseBodyDefinition" : null
} }
================================ ================================
// 销售订单编号,挤压编号,报工单号,型材型号,当前工序,报工日期
sales_order_code
schedule_number
report_number
current_process
report_date
String salesOrderCode = body.salesOrderCode;
String scheduleNumber = body.scheduleNumber;
String reportNumber = body.reportNumber; String reportNumber = body.reportNumber;
String currentProcess = body.currentProcess;
String reportDate = body.reportDate; String reportDate = body.reportDate;
String profileModel = body.profileModel;
var sql = """ var sql = """
select select
mpr.id, id,
mpr.report_number, report_number,
mpr.machine, machine,
mpr.operator, operator,
mpr.workshop, workshop,
date_format(mpr.report_date, '%Y-%m-%d') as report_date, date_format(report_date, '%Y-%m-%d') as report_date,
mpr.current_process, current_process,
mpr.next_process, next_process,
mpr.production_number, production_number,
mpr.production_weight, production_weight,
mpr.scrap_number, scrap_number,
mpr.scrap_reason, scrap_reason,
mpr.frame_number, frame_number,
mpr.is_completed, is_completed
mpr.sales_order_code, from mini_process_report
mpr.schedule_number,
msm.profile_model
from mini_process_report mpr
left join mini_sales_order_materials msm
on mpr.sales_order_code = msm.sales_order_code and mpr.material_code = msm.material_code
where 1 = 1 where 1 = 1
-- and next_process is null -- and next_process is null
?{salesOrderCode != null and salesOrderCode != '', and mpr.sales_order_code like concat('%', #{salesOrderCode}, '%')} ?{reportNumber != null and reportNumber != '', and report_number like concat('%', #{reportNumber}, '%')}
?{scheduleNumber != null and scheduleNumber != '', and mpr.schedule_number like concat('%', #{scheduleNumber}, '%')} ?{reportDate != null and reportDate != '', and date_format(report_date, '%Y-%m-%d') = #{reportDate}}
?{reportNumber != null and reportNumber != '', and mpr.report_number like concat('%', #{reportNumber}, '%')}
?{currentProcess != null and currentProcess != '', and mpr.current_process = #{currentProcess}}
?{reportDate != null and reportDate != '', and date_format(mpr.report_date, '%Y-%m-%d') = #{reportDate}}
?{profileModel != null and profileModel != '', and msm.profile_model like concat('%', #{profileModel}, '%')}
-- group by report_number -- group by report_number
""" """
return db.page(sql); return db.page(sql);
// profileModel

@ -5,7 +5,7 @@
"groupId" : "06d35cc5db5f4e6681262a1648c871c3", "groupId" : "06d35cc5db5f4e6681262a1648c871c3",
"name" : "列表", "name" : "列表",
"createTime" : null, "createTime" : null,
"updateTime" : 1730451538439, "updateTime" : 1728726289833,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -160,10 +160,6 @@ import '@/common/sql' as sql
String documentNumber = body["documentNumber"]; String documentNumber = body["documentNumber"];
String salesOrderCode = body["salesOrderCode"]; String salesOrderCode = body["salesOrderCode"];
String materialName = body["materialName"]; String materialName = body["materialName"];
String materialCode = body["materialCode"];
String deliveryDate = body["deliveryDate"];
String customerName = body["customerName"];
String orderNo = body["orderNo"];
String salesOrdeSelect = sql("salesOrder") String salesOrdeSelect = sql("salesOrder")
String sql = """ String sql = """
@ -190,11 +186,7 @@ String sql = """
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}} ?{documentNumber != null and documentNumber != "", and mps.document_number = #{documentNumber}}
?{materialName != null and materialName != "", and msm.material_name like concat('%', #{materialName}, '%')} ?{materialName != null and materialName != "", and msm.material_name like concat('%', #{materialName}, '%')}
?{materialCode != null and materialCode != "", and mps.material_code like concat('%', #{materialCode}, '%')}
?{customerName != null and customerName != "", and mci.customer_name like concat('%', #{customerName}, '%')}
?{orderNo != null and orderNo != "", and msm.order_no like concat('%', #{orderNo}, '%')}
?{deliveryDate != null and deliveryDate != '', and mso.delivery_date = #{deliveryDate}}
"""; """;
return db.page(sql); return db.page(sql);

@ -5,7 +5,7 @@
"groupId" : "a170047f79ab4cb1b892edc5cccd823e", "groupId" : "a170047f79ab4cb1b892edc5cccd823e",
"name" : "新增", "name" : "新增",
"createTime" : null, "createTime" : null,
"updateTime" : 1729825162357, "updateTime" : 1729160792624,
"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" : "{\r\n \"materials\": [\r\n {\r\n \"salesOrderCode\": \"20241020001C\",\r\n \"materialCode\": \"A03H-001\",\r\n \"materialName\": \"两头料已加图2\",\r\n \"profileModel\": \"A03H\",\r\n \"weight\": 0.499,\r\n \"specification\": \"47*29.5\",\r\n \"thickness\": 1,\r\n \"piecesBundle\": 140,\r\n \"materialCategory\": \"004\",\r\n \"defaultLength\": null,\r\n \"packagingMethod\": null,\r\n \"source\": \"source1\",\r\n \"unit\": \"支\",\r\n \"orderLength\": 1.97,\r\n \"orderTotalQuantity\": 100,\r\n \"surfaceMethod\": \"Y00007\",\r\n \"theoreticalWeightPerPiece\": 0.983,\r\n \"theoreticalWeight\": 0,\r\n \"packingQuantity\": null,\r\n \"deliveryDate\": \"2024-11-21 00:00:00\",\r\n \"customerMaterialCode\": null,\r\n \"producedPieces\": 0,\r\n \"producedLength\": 0,\r\n \"priceWithTax\": null,\r\n \"amountWithTax\": null,\r\n \"remark\": null,\r\n \"shipmentsedNumber\": 0,\r\n \"returnedNumber\": null,\r\n \"unitPrice\": 0,\r\n \"orderNo\": \"33012\",\r\n \"existingInventory\": 1,\r\n \"actualWeight\": 239,\r\n \"customerId\": null,\r\n \"warehouse\": null,\r\n \"customerName\": null,\r\n \"shipmentQuantity\": 1,\r\n \"pieces\": 140,\r\n \"undeliveredQuantity\": 100\r\n }\r\n ],\r\n \"orderInfo\": {\r\n \"documentNumber\": \"ces\",\r\n \"shipmentDate\": \"2024-10-25\",\r\n \"customerId\": \"C00002\",\r\n \"shipmentInspectionReport\": \"cs\",\r\n \"remarks\": \"测试\"\r\n }\r\n}", "requestBody" : "",
"headers" : [ { "headers" : [ {
"name" : "authorization", "name" : "authorization",
"value" : "5E34C0D7EA601026B93C26119C7E1AD50FF4301C7ED4F6D71B9389266C4D0154EA305F5647F993754318DA0ED39E8450", "value" : null,
"description" : "登录token", "description" : "登录token",
"required" : false, "required" : false,
"dataType" : "String", "dataType" : "String",

@ -5,7 +5,7 @@
"groupId" : "447d969bf99243f188b84289aff1ba91", "groupId" : "447d969bf99243f188b84289aff1ba91",
"name" : "测试token", "name" : "测试token",
"createTime" : null, "createTime" : null,
"updateTime" : 1729650958697, "updateTime" : 1722826729086,
"lock" : null, "lock" : null,
"createBy" : null, "createBy" : null,
"updateBy" : null, "updateBy" : null,
@ -28,7 +28,7 @@
"requestBody" : "", "requestBody" : "",
"headers" : [ ], "headers" : [ ],
"paths" : [ ], "paths" : [ ],
"responseBody" : "{\n \"code\": 0,\n \"data\": {\n \"token\": \"5E34C0D7EA601026B93C26119C7E1AD5BFD0EE445CC2CCC8BCF8F8565A8AF9D250A9A70E3579385B6FCD1148027C97D7\",\n \"userId\": \"1\"\n },\n \"message\": \"success\"\n}", "responseBody" : null,
"description" : null, "description" : null,
"requestBodyDefinition" : null, "requestBodyDefinition" : null,
"responseBodyDefinition" : null "responseBodyDefinition" : null

@ -1,8 +1,8 @@
spring: spring:
profiles: profiles:
active: local # test 本地 # active: local # test 本地
# active: dev # test 测试 # active: dev # test 测试
# active: pro # pro 生产 active: pro # pro 生产
# 通用配置 # 通用配置
servlet: servlet:
@ -69,16 +69,3 @@ o2:
enabled: true enabled: true
# 同步新增o2的客户api地址 # 同步新增o2的客户api地址
create-url: http://127.0.0.1:8182/open/api/add create-url: http://127.0.0.1:8182/open/api/add
# o1 同步配置
# o1 同步配置
o1:
sync:
access-key: 8ceeH0H6w4ZIR5nHSDB7
# 密钥
secret-key: alLv8CPzZjM6EAgvKqvVjf4kOuTPSmoQTbgK25jz
# 是否启用同步
enabled: true
# 同步新增o1的客户api地址
create-url:
customer: http://127.0.0.1:48080/admin-api/open/api/customerCompany/create
supplier: http://127.0.0.1:48080/admin-api/open/api/customerCompany/create/supplier

@ -32,18 +32,6 @@
clearable clearable
> >
</el-input> </el-input>
<el-input
v-model="search.orderNo"
placeholder="订单号"
clearable
>
</el-input>
<el-input
v-model="search.customerName"
placeholder="客户名称"
clearable
>
</el-input>
<el-button <el-button
type="primary" type="primary"

@ -1,129 +1,60 @@
<template> <template>
<el-container style="position: relative"> <el-container style="position: relative;">
<el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button <el-button type="primary" icon="el-icon-plus" @click="page_add"></el-button>
type="primary"
icon="el-icon-plus"
@click="page_add"
></el-button>
</div> </div>
<div class="right-panel-search"> <div class="right-panel-search">
<!-- 销售订单编号挤压编号报工单号型材型号当前工序报工日期 -->
<el-input
v-model="search.salesOrderCode"
placeholder="销售单号"
clearable
>
</el-input>
<el-input
v-model="search.scheduleNumber"
placeholder="挤压编号"
clearable
>
</el-input>
<el-input
v-model="search.profileModel"
placeholder="型材型号"
clearable
>
</el-input>
<el-input <el-input
v-model="search.reportNumber" v-model="search.reportNumber"
placeholder="报工单号" placeholder="报工单号"
clearable clearable>
>
</el-input> </el-input>
<dicselect v-model="search.currentProcess" :item="currentProcessItem">
</dicselect>
<el-date-picker <el-date-picker
v-model="search.reportDate" v-model="search.date"
type="date" type="date"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD"
placeholder="报工日期" placeholder="日期"
style="width: 600px" style="width: 600px"
></el-date-picker> ></el-date-picker>
<el-button <el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
type="primary"
icon="el-icon-search"
@click="upsearch"
></el-button>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
<scTable <scTable ref="table" :apiObj="apiObj" :column="column" :remoteFilter="config.remoteFilter" row-key="" @selection-change="selectionChange">
ref="table"
:apiObj="apiObj"
:column="column"
:remoteFilter="config.remoteFilter"
row-key=""
@selection-change="selectionChange"
>
<!-- <el-table-column type="selection" width="50"></el-table-column> --> <!-- <el-table-column type="selection" width="50"></el-table-column> -->
<el-table-column <el-table-column label="操作" fixed="right" align="center" width="120" v-if="config.option">
label="操作"
fixed="right"
align="center"
width="120"
v-if="config.option"
>
<template #default="scope"> <template #default="scope">
<el-button <el-button type="text" size="medium" @click="show_info(scope.row, scope.$index)" v-if="config.option.edit"></el-button>
type="text" <el-button type="text" size="medium" @click="table_edit(scope.row, scope.$index)" v-if="config.option.edit && scope.row.isCompleted != '1'"></el-button>
size="medium"
@click="show_info(scope.row, scope.$index)"
v-if="config.option.edit"
>查看</el-button
>
<el-button
type="text"
size="medium"
@click="table_edit(scope.row, scope.$index)"
v-if="config.option.edit && scope.row.isCompleted != '1'"
>完成</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</scTable> </scTable>
</el-main> </el-main>
<save-page <save-page ref="savePage" v-if="dialog.savePage" @closed="dialog.savePage = false" @success="handleSuccess"></save-page>
ref="savePage"
v-if="dialog.savePage"
@closed="dialog.savePage = false"
@success="handleSuccess"
></save-page>
</el-container> </el-container>
<save-dialog <save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSuccess" @closed="dialog.save=false"></save-dialog>
v-if="dialog.save" <info-dialog v-if="dialog.info" ref="infoDialog" @closed="dialog.info=false"></info-dialog>
ref="saveDialog"
@success="handleSuccess"
@closed="dialog.save = false"
></save-dialog>
<info-dialog
v-if="dialog.info"
ref="infoDialog"
@closed="dialog.info = false"
></info-dialog>
</template> </template>
<script> <script>
import saveDialog from "./save"; import saveDialog from './save'
import module from "./module"; import module from './module'
import config from "@/config"; import config from "@/config"
import savePage from "./savePage"; import savePage from './savePage'
import infoDialog from "./info"; import infoDialog from './info'
import dicselect from "@/components/scForm/items/dicselect";
export default { export default {
components: { components: {
saveDialog, saveDialog,
savePage, savePage,
infoDialog, infoDialog
dicselect,
}, },
data() { data() {
return { return {
@ -132,41 +63,40 @@ export default {
info: false, info: false,
product: false, product: false,
finish: false, finish: false,
savePage: false, savePage: false
}, },
loading: false, loading:false,
file: "", file:"",
search: { search: {
reportNumber: "", reportNumber:"",
date: "", date:""
}, },
apiObj: this.$API[module.name][module.list], apiObj:this.$API[module.name][module.list],
selection: [], selection: [],
config: module.config, config: module.config,
options: module.options, options: module.options,
column: module.column, column: module.column
currentProcessItem: { }
options: { group: "working", placeholder: "当前工序" }, },
} mounted(){
};
}, },
mounted() {},
methods: { methods: {
// //
importExcel() { importExcel(){
this.dialog.importExcel = true; this.dialog.importExcel = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.importExcelDialog.open(); this.$refs.importExcelDialog.open()
}); })
}, },
// //
handleReset() { handleReset(){
console.log("handleReset method called"); console.log('handleReset method called');
// 1. // 1.
this.search = {}; this.search = {};
var search = { var search = {
email: "", email: ""
}; // {} }; // {}
// 2. // 2.
@ -176,81 +106,79 @@ export default {
} }
}, },
// //
add() { add(){
this.dialog.save = true; this.dialog.save = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open("add", this.list); this.$refs.saveDialog.open('add', this.list)
}); })
}, },
page_add() { page_add() {
this.dialog.savePage = true; this.dialog.savePage = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.savePage.open("add"); this.$refs.savePage.open('add')
}); })
}, },
// //
finish(row) { finish(row){
this.dialog.finish = true; this.dialog.finish = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.finishDialog.open("add", this.list).setData(row); this.$refs.finishDialog.open('add', this.list).setData(row)
}); })
}, },
// //
table_edit(row) { table_edit(row){
this.dialog.save = true; this.dialog.save = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.saveDialog.open("edit", this.list).setData(row); this.$refs.saveDialog.open('edit', this.list).setData(row)
// this.$refs.saveDialog.open('edit', this.list).setData(row) // this.$refs.saveDialog.open('edit', this.list).setData(row)
}); })
}, },
show_info(row) { show_info(row){
this.dialog.info = true; this.dialog.info = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.infoDialog.open().setData(row); this.$refs.infoDialog.open().setData(row)
}); })
}, },
// //
async table_del(row, index) { async table_del(row, index){
var reqData = { id: row[this.config.preId ? this.config.preId : "id"] }; var reqData = {id: row[this.config.preId?this.config.preId:"id"]}
var res = await this.$API[module.name][module.del].http(reqData); var res = await this.$API[module.name][module.del].http(reqData);
if (res.code == 0) { if(res.code == 0){
// OR / // OR /
this.$refs.table.upData(); this.$refs.table.upData();
this.$message.success("删除成功"); this.$message.success("删除成功");
} else { }else{
this.$alert(res.message, "提示", { type: "error" }); this.$alert(res.message, "提示", {type: 'error'})
} }
}, },
// //
async batch_del() { async batch_del(){
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, "提示", { this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
type: "warning", type: 'warning'
}) }).then(async () => {
.then(async () => { const loading = this.$loading();
const loading = this.$loading(); console.log(this.selection)
console.log(this.selection); var idArr = [];
var idArr = []; this.selection.forEach(item => {
this.selection.forEach((item) => { idArr.push(item[this.config.preId?this.config.preId:"id"])
idArr.push(item[this.config.preId ? this.config.preId : "id"]);
});
var reqData = { ids: idArr.join(",") };
var res = await this.$API[module.name][module.del].http(reqData);
if (res.code == 0) {
// OR /
this.$refs.table.refresh();
this.$message.success("删除成功");
} else {
this.$alert(res.message, "提示", { type: "error" });
}
loading.close();
}) })
.catch(() => {
this.$message.success("操作失败"); var reqData = {ids: idArr.join(",")}
}); var res = await this.$API[module.name][module.del].http(reqData);
if(res.code == 0){
// OR /
this.$refs.table.refresh();
this.$message.success("删除成功");
}else{
this.$alert(res.message, "提示", {type: 'error'})
}
loading.close();
}).catch(() => {
this.$message.success("操作失败")
})
}, },
// //
selectionChange(selection) { selectionChange(selection){
this.selection = selection; this.selection = selection;
}, },
filterChange(obj) { filterChange(obj) {
@ -258,20 +186,20 @@ export default {
this.upsearch(); this.upsearch();
}, },
// //
upsearch() { upsearch(){
this.$refs.table.upData(this.search); this.$refs.table.upData(this.search);
}, },
// //
handleSuccess(data, mode) { handleSuccess(data, mode){
this.$refs.table.upData(); this.$refs.table.upData()
}, },
}, }
}; }
</script> </script>
<style> <style>
.upload { .upload {
color: #409eff; color: #409EFF;
background: #ecf5ff; background: #ecf5ff;
min-height: 32px; min-height: 32px;
padding: 9px 15px; padding: 9px 15px;
@ -283,4 +211,5 @@ export default {
.sc-upload-uploader { .sc-upload-uploader {
border: none !important; border: none !important;
} }
</style> </style>

@ -9,48 +9,29 @@
<el-container> <el-container>
<el-header> <el-header>
<div class="right-panel-search"> <div class="right-panel-search">
<!-- <thirdselect <thirdselect
v-model="search.materialCategory" v-model="search.materialCategory"
:item="materialCategoryItem" :item="materialCategoryItem"
> >
</thirdselect> --> </thirdselect>
<!-- 物料名称输入框 -->
<el-input <el-input
v-model="search.scheduleNumber" v-model="search.scheduleNumber"
placeholder="挤压编码" placeholder="挤压编码"
clearable clearable
> >
</el-input> </el-input>
<el-input
v-model="search.salesOrderCode"
placeholder="销售单号"
clearable
>
</el-input>
<el-input
v-model="search.orderNo"
placeholder="订单号"
clearable
>
</el-input>
<el-input
v-model="search.materialCode"
placeholder="物料编码"
clearable
>
</el-input>
<el-input
v-model="search.profileModel"
placeholder="型材型号"
clearable
>
</el-input>
<el-button <el-button
type="primary" type="primary"
icon="el-icon-search" icon="el-icon-search"
@click="upsearch" @click="upsearch"
></el-button> ></el-button>
<el-button type="primary" plain @click="add"></el-button> <el-button
type="primary"
plain
@click="add"
>添加</el-button>
</div> </div>
</el-header> </el-header>
<el-main class="nopadding"> <el-main class="nopadding">
@ -98,15 +79,14 @@ export default {
params: module.tableSelect.params, params: module.tableSelect.params,
selection: [], selection: [],
materialCategoryItem: { materialCategoryItem: {
options: { options: { tb: 'product_material_categories', placeholder: '物料/产品分类' }
tb: "product_material_categories",
placeholder: "物料/产品分类",
},
}, },
listData: [], listData: []
}; };
}, },
mounted() {}, mounted() {
},
methods: { methods: {
// //
open() { open() {
@ -118,9 +98,7 @@ export default {
this.listData = listData; this.listData = listData;
}, },
selectable(row, index) { selectable(row, index) {
return !this.listData.some( return !this.listData.some(item => row.materialCode == item.materialCode)
(item) => row.materialCode == item.materialCode
);
}, },
currentChange(row) { currentChange(row) {
this.selection = [row]; this.selection = [row];
@ -130,7 +108,7 @@ export default {
this.selection = selection; this.selection = selection;
}, },
add() { add() {
this.$emit("success", this.selection); this.$emit("success", this.selection)
this.visible = false; this.visible = false;
}, },
// //

@ -30,9 +30,6 @@ export default {
{ label: "", prop: "id", width: "200", hide: true }, { label: "", prop: "id", width: "200", hide: true },
{ label: "报工单号", prop: "reportNumber", width: "200" }, { label: "报工单号", prop: "reportNumber", width: "200" },
{ label: "机台", prop: "machine", width: "200" }, { label: "机台", prop: "machine", width: "200" },
{ label: "销售订单编码", prop: "salesOrderCode", width: "200" },
{ label: "挤压排产编码", prop: "scheduleNumber", width: "200" },
{ label: "型材型号", prop: "profileModel", width: "200" },
{ label: "操作员", prop: "operator", width: "200" }, { label: "操作员", prop: "operator", width: "200" },
{ label: "车间", prop: "workshop", width: "200" }, { label: "车间", prop: "workshop", width: "200" },
{ {

@ -7,20 +7,25 @@
<div class="right-panel-search"> <div class="right-panel-search">
<el-input <el-input
v-model="search.documentNumber" v-model="search.orderNumber"
placeholder="计划单号" placeholder="排产单号"
clearable> clearable>
</el-input> </el-input>
<el-input <el-input
v-model="search.salesOrderCode" v-model="search.salesOrderNumber"
placeholder="销售单号" placeholder="单号"
clearable> clearable>
</el-input> </el-input>
<el-input <el-input
v-model="search.materialCode" v-model="search.productCode"
placeholder="产品编码" placeholder="产品编码"
clearable> clearable>
</el-input> </el-input>
<el-input
v-model="search.customerPartNumber"
placeholder="客方料号"
clearable>
</el-input>
<el-date-picker <el-date-picker
v-model="search.deliveryDate" v-model="search.deliveryDate"
type="date" type="date"

Loading…
Cancel
Save