Compare commits

..

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

@ -1,18 +1,26 @@
package com.currency.appengine.config;
import com.currency.appengine.handler.GlobalInterceptor;
import com.currency.appengine.filter.RepeatedlyReadFilter;
import com.currency.appengine.handler.CustomMethodArgumentResolver;
import com.currency.appengine.handler.GlobalInterceptor;
import com.currency.appengine.handler.SignInterceptor;
import com.currency.appengine.handler.magic.DevInterceptor;
import java.util.List;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.*;
import java.util.List;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
@EnableWebMvc
public class WebMvcConfig implements WebMvcConfigurer {
/**
* Interceptor verification token
*
@ -28,9 +36,15 @@ public class WebMvcConfig implements WebMvcConfigurer {
return new DevInterceptor();
}
@Bean
public SignInterceptor signInterceptor() {
return new SignInterceptor();
}
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(GlobalInterceptor()).addPathPatterns("/**");
registry.addInterceptor(signInterceptor()).addPathPatterns("/open/**");//只拦截open前缀的接口
registry.addInterceptor(DevInterceptor()).addPathPatterns("/swagger-ui.html").addPathPatterns("/magic/**");
}
@ -47,8 +61,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
// .allowedOrigins("*")
.allowedOriginPatterns("*")
.allowCredentials(true)
.allowedMethods("GET","HEAD","POST","PUT","DELETE","OPTIONS")
.maxAge(3600);
.allowedMethods("GET", "HEAD", "POST", "PUT", "DELETE", "OPTIONS")
.maxAge(3600)
;
}
/*
@ -69,4 +84,15 @@ public class WebMvcConfig implements WebMvcConfigurer {
registry.addResourceHandler("doc.html").addResourceLocations(
"classpath:knife4j/");
}
@SuppressWarnings({ "rawtypes", "unchecked" })
@Bean
public FilterRegistrationBean someFilterRegistration()
{
FilterRegistrationBean registration = new FilterRegistrationBean();
registration.setFilter(new RepeatedlyReadFilter());
registration.addUrlPatterns("/*");
registration.setName("repeatableFilter");
registration.setOrder(Ordered.LOWEST_PRECEDENCE);
return registration;
}
}

@ -1,10 +1,8 @@
package com.currency.appengine.controller;
import com.currency.appengine.domain.CustomerReq;
import com.currency.appengine.domain.SupplierReq;
import com.currency.appengine.service.common.CommonServices;
import com.currency.appengine.service.system.CustomerService;
import com.currency.appengine.service.system.SupplierService;
import com.currency.appengine.utils.Result;
import java.util.Map;
import java.util.Objects;
@ -25,8 +23,7 @@ public class OpenController {
@Autowired
private CustomerService customerService;
@Autowired
private SupplierService supplierService;
private CommonServices commonServices;
@PostMapping("/add")
public Result add(@RequestBody Map<String, Object> obj) {
@ -49,23 +46,4 @@ public class OpenController {
customerReq.setCreateBy("超级管理员");
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));
}
}

@ -3,7 +3,9 @@ package com.currency.appengine.controller;
import cn.hutool.captcha.CaptchaUtil;
import cn.hutool.captcha.LineCaptcha;
import com.currency.appengine.annotation.CheckToken;
import com.currency.appengine.domain.CustomerReq;
import com.currency.appengine.domain.system.SysParam;
import com.currency.appengine.service.system.CustomerService;
import com.currency.appengine.service.system.SysMenuService;
import com.currency.appengine.service.system.SysParamService;
import com.currency.appengine.service.system.SysRoleService;
@ -12,16 +14,20 @@ import com.currency.appengine.utils.JsonUtil;
import com.currency.appengine.utils.ReqParamsUtil;
import com.currency.appengine.utils.Result;
import com.currency.appengine.utils.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* @date 2021/07/25
@ -29,6 +35,7 @@ import java.util.Map;
@RestController
@RequestMapping("/sys/authority")
public class SystemController {
@Autowired
SysUserService sysUserService;
@Autowired
@ -37,10 +44,12 @@ public class SystemController {
SysRoleService sysRoleService;
@Autowired
SysParamService sysParamService;
@Autowired
CustomerService customerService;
/*
*
* */
*
* */
@RequestMapping("/kaptcha")
public void getKaptchaImage(HttpServletRequest request, HttpServletResponse response) throws Exception {
HttpSession session = request.getSession();
@ -64,6 +73,7 @@ public class SystemController {
/**
*
*
* @param params
* @return
*/
@ -82,10 +92,10 @@ public class SystemController {
if (StringUtil.notEmpty(session.getAttribute("KAPTCHA_SESSION_KEY"))) {
String vercode = String.valueOf(params.get("verifycode"));
if (!code.equals(vercode)) {
return Result.fail(-14,"验证码错误");
return Result.fail(-14, "验证码错误");
}
} else {
return Result.fail(-14,"验证码错误");
return Result.fail(-14, "验证码错误");
}
return sysUserService.userLogin(params);
}
@ -164,6 +174,7 @@ public class SystemController {
/**
*
*
* @return
*/
@GetMapping("/role/list/all")
@ -235,12 +246,13 @@ public class SystemController {
/**
*
*
* @return
*/
@GetMapping("/menu/list/all")
@CheckToken
public Result menuListAll() {
return sysMenuService.getRouterListAll();
return sysMenuService.getRouterListAll();
}
@PostMapping("/menu/add")
@ -320,4 +332,13 @@ public class SystemController {
public Result cacheUpdate() {
return sysParamService.cacheUpdate();
}
@PostMapping("/customer/add")
@CheckToken
public Result addCustomer(HttpServletRequest request, @RequestBody CustomerReq customerReq) {
String userId = StringUtil.objectToString(request.getAttribute("openid"));
customerReq.setUserId(userId);
return Result.suc(customerService.addCustomer(customerReq));
}
}

@ -1,21 +1,17 @@
package com.currency.appengine.controller.export;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.handler.inter.IExcelExportServer;
import com.currency.appengine.annotation.CheckToken;
import com.currency.appengine.domain.export.UserInfoExport;
import com.currency.appengine.export.ExportServer;
import com.currency.appengine.export.impl.ExportServerImpl;
import com.currency.appengine.utils.StringUtil;
import com.currency.appengine.utils.export.poi.ExcelExportUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import sun.security.util.PendingException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@RestController
@ -39,4 +35,5 @@ public class ExportController {
exportServer.exportExpertWord(json, request, response);
}
}

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

@ -56,7 +56,7 @@ public class GlobalInterceptor implements HandlerInterceptor {
log.info(">>>>>>>Call before request processing (check token) ");
Map<String, String> headers = HttpUtil.getHeadersInfo(request);
String token = headers.get("authorization");;
String token = headers.get("authorization");
if (token == null || token.isEmpty()) {
HttpUtil.returnJson(response, JsonUtil.generate(Result.fail(-2, "result.not_token")));
log.info(">>>>>>>check token fail");

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

@ -25,13 +25,12 @@ public class CommonServices {
/**
*
*
* @param type
* @param data
* @return
*/
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<>();
grantTypeMap.put("CustomerCode", params -> customerCode(params)); // 客户编码
grantTypeMap.put("SupplierCode", params -> supplierCode(params)); // 供应商编码
@ -39,12 +38,11 @@ public class CommonServices {
grantTypeMap.put("OrderNumber", params -> orderNumber(params)); // 订单编号
grantTypeMap.put("ProductionPlan", params -> productionPlan(params)); // 生产计划
grantTypeMap.put("ProductionSchedulingNumber", params -> productionSchedulingNumber(params)); // 排产编号
grantTypeMap.put("ProductionOrderNumber", params -> productionOrderNumber(params)); // 报工单号 -- 废弃
grantTypeMap.put("ProductionOrderNumberSub", params -> productionOrderNumberSub(params)); // 报工单号 -- 细分
grantTypeMap.put("ProductionOrderNumber", params -> productionOrderNumber(params)); // 排产单号
grantTypeMap.put("PurchaseNumber", params -> purchaseNumber(params)); // 采购编号
Function<Map<String, Object>, String> result = grantTypeMap.get(type);
if (result != null) {
Function<Map<String, Object>,String> result = grantTypeMap.get(type);
if(result!=null){
//传入resourceId 执行这段表达式获得String型的grantType
return result.apply(data);
}
@ -54,7 +52,6 @@ public class CommonServices {
/**
* C+5
* mini_customer_info
*
* @param params
* @return
*/
@ -80,7 +77,6 @@ public class CommonServices {
/**
* V+5
*
* @param params
* @return
*/
@ -107,7 +103,6 @@ public class CommonServices {
/**
* ++3SW20240929-001SW20240929-002SW20240929-003..)
*
* @param params
* @return
*/
@ -126,7 +121,6 @@ public class CommonServices {
/**
* +0010100102
*
* @param params
* @return
*/
@ -144,7 +138,6 @@ public class CommonServices {
/**
* :P+3
*
* @param params
* @return
*/
@ -161,7 +154,6 @@ public class CommonServices {
/**
* JY+3
*
* @param params
* @return
*/
@ -178,7 +170,6 @@ public class CommonServices {
/**
* BG++3
*
* @param params
* @return
*/
@ -193,47 +184,8 @@ public class CommonServices {
}
}
/**
* BG++3
*
* @param params
* @return
*/
public String productionOrderNumberSub(Map<String, Object> params) {
String currentProcess = String.valueOf(params.get("currentProcess"));
try {
return LockUtils.doWithLock(() -> {
int count = commonMapper.count("mini_process_report", "date(create_time) = curdate() and current_process=#{currentProcess}",
new HashMap() {{
put("currentProcess", currentProcess);
}});
switch (currentProcess) {
case "jiya":
return "JY" + DateUtil.getYyMMdd() + formatNumber(count, "2");
case "dk":
return "DK" + DateUtil.getYyMMdd() + formatNumber(count, "2");
case "jingpin":
return "JP" + DateUtil.getYyMMdd() + formatNumber(count, "2");
case "yanghau1":
return "YH" + DateUtil.getYyMMdd() + formatNumber(count, "2");
case "yanghua2":
return "YHH" + DateUtil.getYyMMdd() + formatNumber(count, "2");
case "jingqie":
return "JQ" + DateUtil.getYyMMdd() + formatNumber(count, "2");
case "bz":
return "BZ" + DateUtil.getYyMMdd() + formatNumber(count, "2");
default:
return "BG" + DateUtil.getYyyyMMdd() + formatNumber(count, "3");
}
});
} catch (Exception e) {
return null;
}
}
/**
* PO++
*
* @param params
* @return
*/
@ -264,7 +216,6 @@ public class CommonServices {
}
return pinyinFirstLetters.toString();
}
public static void main(String[] arg) {
// int sequenceNumber = 123456; // 假设这是你的序号
// String formattedSequence = String.format("%05d", sequenceNumber);

@ -3,17 +3,12 @@ package com.currency.appengine.service.export;
import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import java.util.LinkedHashMap;
import java.util.Map;
public interface ExportDataPageService {
int findCount(Map<String, Object> params, int method);
Object findPage(Map<String, Object> params, int method);
void setWorkbook(SXSSFWorkbook wb, SXSSFSheet eachSheet, Integer startRowCount, Integer endRowCount, Object datas, int method);
void magicExport(Integer count, Map bodyObj, String className, String sqlFunc, String fileName, String excelTitle,
String sheetName);
}

@ -1,13 +1,9 @@
package com.currency.appengine.service.export.impl;
import cn.afterturn.easypoi.excel.entity.ExportParams;
import cn.afterturn.easypoi.handler.inter.IExcelExportServer;
import com.currency.appengine.domain.export.UserInfoExport;
import com.currency.appengine.handler.exception.MyException;
import com.currency.appengine.mapper.export.ExportMapper;
import com.currency.appengine.service.export.ExportDataPageService;
import com.currency.appengine.utils.ObjectUtil;
import com.currency.appengine.utils.export.poi.ExcelExportUtil;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
@ -17,14 +13,11 @@ import org.apache.poi.xssf.streaming.SXSSFSheet;
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.context.request.RequestAttributes;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import org.ssssssss.magicapi.core.context.RequestContext;
import org.ssssssss.magicapi.core.service.MagicAPIService;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@Service
public class ExportDataPageServiceImpl implements ExportDataPageService {
@ -32,12 +25,8 @@ public class ExportDataPageServiceImpl implements ExportDataPageService {
@Autowired
private ExportMapper exportMapper;
@Autowired
MagicAPIService service;
/**
*
*
*
* @param params
* @param method
* @return
@ -48,36 +37,34 @@ public class ExportDataPageServiceImpl implements ExportDataPageService {
}
/**
* sql
*
* sql
* @param params
* @param method
* @return
*/
private String sql(Map<String, Object> params, int method) {
private String sql(Map<String, Object> params, int method){
StringBuffer buffer = new StringBuffer();
switch (method) {
case 0:// 0 用户信息
buffer.append("select id, user_id, status, date_format(create_time,'%Y-%m-%d %T') create_time, nick_name, user_img from mini_user where 1=1 ");
if (Objects.nonNull(params.get("userId"))) {
if(Objects.nonNull(params.get("userId"))){
buffer.append(" and user_id like CONCAT('%',#{userId},'%') ");
}
if (Objects.nonNull(params.get("nickName"))) {
if(Objects.nonNull(params.get("nickName"))){
buffer.append(" and nick_name like CONCAT('%',#{nickName},'%') ");
}
if (Objects.nonNull(params.get("status"))) {
if(Objects.nonNull(params.get("status"))){
buffer.append(" and and status = #{status} ");
}
break;
default:
throw new MyException("导出失败传入method参数不匹配请检查代码");
default:
throw new MyException("导出失败传入method参数不匹配请检查代码");
}
return buffer.toString();
}
/**
*
*
*
* @param params
* @param method
* @return
@ -87,7 +74,7 @@ public class ExportDataPageServiceImpl implements ExportDataPageService {
Object list = new ArrayList<>();
switch (method) {
case 0:// 0 用户信息
params.put("sql", this.sql(params, method));
params.put("sql",this.sql(params, method));
list = exportMapper.findUserInfoPage(params);
break;
}
@ -97,13 +84,12 @@ public class ExportDataPageServiceImpl implements ExportDataPageService {
/**
* 使
*
* @param wb
* @param eachSheet
* @param startRowCount
* @param endRowCount
* @param datas
* @param method
* @param method
*/
@Override
public void setWorkbook(SXSSFWorkbook wb, SXSSFSheet eachSheet, Integer startRowCount, Integer endRowCount, Object datas, int method) {
@ -120,41 +106,6 @@ public class ExportDataPageServiceImpl implements ExportDataPageService {
}
}
@Override
public void magicExport(Integer count, Map bodyObj, String className, String sqlFunc, String fileName, String excelTitle,
String sheetName) {
try {
IExcelExportServer iExcelExportServer = new IExcelExportServer() {
@Override
// 分页查询 obj 总页数 page 第几页
public List<Object> selectListForExcelExport(Object obj, int page) {
bodyObj.put("page", page);
Map<String, Object> params = new HashMap<>();
params.put("body", bodyObj);
Object value = service.invoke(sqlFunc, params);
try {
List<Object> list = new ArrayList<>();
list.addAll(ObjectUtil.convertObjectToListBean(value, Class.forName(className)));
return list;
} catch (ClassNotFoundException e) {
throw new RuntimeException(e);
}
}
};
ExportParams exportParams = new ExportParams(excelTitle, sheetName);
ExcelExportUtil.exportBigEasyPoi(getResponse(), exportParams, fileName, Class.forName(className), iExcelExportServer, count);
} catch (Exception e) {
e.printStackTrace();
}
}
private HttpServletResponse getResponse() {
RequestAttributes requestAttributes = RequestContextHolder.getRequestAttributes();
return requestAttributes instanceof ServletRequestAttributes ? ((ServletRequestAttributes) requestAttributes).getResponse() : RequestContext.getHttpServletResponse().getResponse();
}
private void setUserInfoExportData(SXSSFWorkbook wb, SXSSFSheet eachSheet, Integer startRowCount, Integer endRowCount, List<UserInfoExport> list) {
for (int i = startRowCount; i <= endRowCount; i++) {
@ -167,10 +118,10 @@ public class ExportDataPageServiceImpl implements ExportDataPageService {
eachDataRow.createCell(3).setCellValue(model.getCreateTime());
eachDataRow.createCell(4).setCellValue(model.getStatus());
if ("1".equals(model.getStatus())) {
if("1".equals(model.getStatus())) {
int physicalNumberOfCells = eachDataRow.getPhysicalNumberOfCells();
for (int j = 0; j < physicalNumberOfCells; j++) {
if (i <= 1) {
if(i <= 1){
eachSheet.setColumnWidth(j, 20 * 256);
}
//获取当前单元格 中的value

@ -1,88 +0,0 @@
package com.currency.appengine.service.export.model;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class ExtrusionScheduleExport {
@Excel(name = "排产单号", width = 40)
private String scheduleNumber;
@Excel(name = "挤压排产日期", width = 40)
private String extrusionDate;
@Excel(name = "挤压机台", width = 40)
private String extrusionMachineName;
@Excel(name = "挤压班组", width = 40)
private String extrusionTeamName;
@Excel(name = "销售订单编号", width = 40)
private String salesOrderCode;
@Excel(name = "销售员", width = 40)
private String salespersonName;
@Excel(name = "物料编码", width = 40)
private String materialCode;
@Excel(name = "物料名称", width = 40)
private String materialName;
@Excel(name = "订单长度 (M)", width = 40)
private BigDecimal orderLength;
@Excel(name = "订单总数 (支)", width = 40)
private Integer orderTotalQuantity;
@Excel(name = "表面方式 (颜色)", width = 40)
private String surfaceMethod;
@Excel(name = "规格型号 (MM)", width = 40)
private String specification;
@Excel(name = "客方料号", width = 40)
private String customerMaterialCode;
@Excel(name = "壁厚", width = 40)
private BigDecimal thickness;
@Excel(name = "理论重量 (KG)", width = 40)
private BigDecimal theoreticalWeight;
@Excel(name = "实际总重量KG)", width = 40)
private BigDecimal actualWeight;
@Excel(name = "包装数量(扎数)", width = 40)
private Integer packingQuantity;
@Excel(name = "包装方式", width = 40)
private String packagingMethod;
@Excel(name = "排产长度", width = 40)
private BigDecimal productionLength;
@Excel(name = "排产支数", width = 40)
private Integer productionPieces;
@Excel(name = "锯切方式", width = 40)
private String sawingMethod;
@Excel(name = "排产理论重量", width = 40)
private BigDecimal productionTheoreticalWeight;
@Excel(name = "完工支数", width = 40)
private BigDecimal productionNumber;
@Excel(name = "未完工支数", width = 40)
private BigDecimal noProductionNumber;
@Excel(name = "完工重量", width = 40)
private BigDecimal productionWeight;
@Excel(name = "未完工重量", width = 40)
private BigDecimal noProductionWeight;
}

@ -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,7 +1,6 @@
package com.currency.appengine.service.system;
import com.currency.appengine.domain.CustomerReq;
import com.currency.appengine.domain.SupplierReq;
/**
* @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;
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;
@ -48,7 +47,6 @@ public class CustomerServiceImpl implements CustomerService {
customerMapper.updateCodeById(customerReq);
try {
aysnO2(customerReq);
aysnO1(customerReq);
} catch (Exception 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())
.replace("/", "-").replace("小程序端API-", "");
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);
if (!m.find()) continue;
SwaggerEntity.Path path = new SwaggerEntity.Path(info.getId());

@ -7,8 +7,6 @@ import org.apache.commons.lang3.ArrayUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.*;
public class ObjectUtil {
@ -59,47 +57,6 @@ public class ObjectUtil {
return null;
}
public static <T> List<T> convertObjectToListBean(Object obj, Class<T> beanClass) {
List<T> beanList = new ArrayList<>();
if (obj instanceof List<?>) {
@SuppressWarnings("unchecked")
List<Map<String, Object>> listMap = (List<Map<String, Object>>) obj;
for (Map<String, Object> map : listMap) {
T bean;
try {
bean = beanClass.newInstance(); // 创建Bean实例
Field[] fields = beanClass.getDeclaredFields(); // 获取Bean的所有字段
for (Field field : fields) {
field.setAccessible(true); // 设置字段可访问
Object value = map.get(field.getName()); // 从Map中获取值
if (value != null) {
if (value != null && !field.getType().isAssignableFrom(value.getClass())) {
// 进行类型转换
if (BigDecimal.class.isAssignableFrom(field.getType())) {
value = new BigDecimal(value.toString());
} else if (Integer.class.isAssignableFrom(field.getType())) {
value = Integer.parseInt(value.toString());
} else if (Double.class.isAssignableFrom(field.getType())) {
value = Double.parseDouble(value.toString());
} else {
value = String.valueOf(value);
}
// 其他类型转换...
}
field.set(bean, value); // 将值设置到Bean的字段中
}
}
beanList.add(bean); // 将填充好的Bean添加到列表中
} catch (InstantiationException | IllegalAccessException e) {
e.printStackTrace();
}
}
}
return beanList;
}
public static <K, V> List<Map<K, V>> castListMap(Object obj, Class<K> kCalzz, Class<V> vCalzz) {
List<Map<K, V>> result = new ArrayList<>();
if (obj instanceof List<?>) {

@ -16,7 +16,6 @@ public class DateUtil {
private final static SimpleDateFormat FORMAT_yyyyMMddHHmmss = new SimpleDateFormat("yyyyMMddHHmmss");
private final static SimpleDateFormat FORMAT_yyyyMMdd = new SimpleDateFormat("yyyyMMdd");
private final static SimpleDateFormat FORMAT_yyMMdd = new SimpleDateFormat("yyMMdd");
/**
* yyyy-MM-dd HH:mm:ss
* @param timeStr
@ -91,10 +90,6 @@ public class DateUtil {
return FORMAT_yyyyMMdd.format(new Date());
}
public static String getYyMMdd() {
return FORMAT_yyMMdd.format(new Date());
}
/**
*
* @param format yyyy-MM-dd HH:mm:ss

@ -5,7 +5,7 @@
"groupId" : "40879f3a602c40e493f0b273de9fc01e",
"name" : "列表仓库物料",
"createTime" : null,
"updateTime" : 1732449052120,
"updateTime" : 1728715379207,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -51,7 +51,6 @@ String materialCode = body.materialCode;
String materialName = body.materialName;
String profileModel = body.profileModel;
String warehouse = body.warehouse;
String queryType = body['type']; // 1-只查看有库存的
return db.page("""
select
@ -89,5 +88,4 @@ return db.page("""
?{materialName != null and materialName != "", and mwm.material_name like concat('%', #{materialName}, '%') }
?{profileModel != null and profileModel != "", and mwm.profile_model like concat('%', #{profileModel}, '%') }
?{warehouse != null and warehouse != "", and mwm.warehouse = #{warehouse} }
?{queryType != null and queryType != "" and queryType == 1, and mwm.existing_inventory > 0 }
""");

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

@ -5,7 +5,7 @@
"groupId" : "681f3a382ebf4b45a94a17bf7c967968",
"name" : "新增",
"createTime" : null,
"updateTime" : 1731567501231,
"updateTime" : 1726408511094,
"lock" : null,
"createBy" : null,
"updateBy" : null,

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

@ -5,7 +5,7 @@
"groupId" : "4aa6b5de02c244e2981c22bf5a95394d",
"name" : "新增",
"createTime" : null,
"updateTime" : 1731737780581,
"updateTime" : 1729160184169,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -73,7 +73,6 @@ try{
actual_weight: marerial.actualWeight,
unstocked_quantity: marerial.unstockedQuantity,
stocked_quantity: marerial.stockedQuantity,
order_no: marerial.orderNo,
create_by: createBy
})
})
@ -163,52 +162,27 @@ try{
ON DUPLICATE KEY UPDATE
packing_quantity = CASE
<foreach collection="materialsList" item="item" separator=" ">
WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode}
and warehouse = #{item.warehouse} and order_no = #{item.orderNo}
THEN packing_quantity + #{item.warehouseQuantity}
WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode} and warehouse = #{item.warehouse} THEN packing_quantity + #{item.warehouseQuantity}
</foreach>
ELSE packing_quantity
END,
existing_inventory = CASE
<foreach collection="materialsList" item="item" separator=" ">
WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode}
and warehouse = #{item.warehouse} and order_no = #{item.orderNo}
THEN existing_inventory + #{item.receiptQuantity}
WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode} and warehouse = #{item.warehouse} THEN existing_inventory + #{item.receiptQuantity}
</foreach>
ELSE existing_inventory
END,
actual_weight = CASE
<foreach collection="materialsList" item="item" separator=" ">
WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode}
and order_no = #{item.orderNo} and warehouse = #{item.warehouse}
THEN actual_weight + #{item.actualWeight}
WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode} and warehouse = #{item.warehouse} THEN actual_weight + #{item.actualWeight}
</foreach>
ELSE actual_weight
END
""")
if (res > 0) {
// 更新报工中已入库的数量
res = db.update("""
update mini_process_report
SET stock_quantity = CASE
<foreach collection="materialsList" item="item" separator=" ">
WHEN material_code = #{item.materialCode} and sales_order_code = #{item.salesOrderCode}
and order_no = #{item.orderNo}
THEN stock_quantity + #{item.receiptQuantity}
</foreach>
ELSE stock_quantity
END
WHERE is_completed = 1 and sales_order_code in (
<foreach collection="materialsList" item="item" separator=",">
#{item.salesOrderCode}
</foreach>
)
""")
if (res > 0) {
tx.commit(); // 提交事务
exit 0, "执行成功", null;
}
tx.commit(); // 提交事务
exit 0, "执行成功", null;
}
}
tx.rollback();

@ -5,7 +5,7 @@
"groupId" : "4aa6b5de02c244e2981c22bf5a95394d",
"name" : "详情",
"createTime" : null,
"updateTime" : 1731567422340,
"updateTime" : 1729153406281,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -52,7 +52,7 @@ return {
${warehouseProductMaterial}
from mini_product_receipt mpr
left join mini_warehouse_product mwp on mwp.sales_order_code = mpr.sales_order_code
and mwp.material_code = mpr.material_code and mwp.order_no = mpr.order_no
and mwp.material_code = mpr.material_code
where 1=1
and mpr.document_number = #{documentNumber}
"""),

@ -5,7 +5,7 @@
"groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a",
"name" : "修改",
"createTime" : null,
"updateTime" : 1732245009288,
"updateTime" : 1729144854213,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -25,10 +25,10 @@
"expression" : null,
"children" : null
} ],
"requestBody" : "{\r\n \"id\": 2772,\r\n \"productionNumber\": 100,\r\n \"productionWeight\": 100,\r\n \"scrapNumber\": 0,\r\n \"scrapReason\": null,\r\n \"frameNumber\": null,\r\n \"nextProcess\": \"yanghua2\",\r\n \"isCompleted\": 0,\r\n \"remarks\": \"\",\r\n \"reportNumber\": \"JY24111500\",\r\n \"machine\": null,\r\n \"operator\": null,\r\n \"workshop\": null,\r\n \"reportDate\": \"2024-11-15\",\r\n \"currentProcess\": \"jiya\",\r\n \"salesOrderCode\": \"KFCS20241114-000\",\r\n \"scheduleNumber\": \"JY20241115006\",\r\n \"profileModel\": \"6430-120\",\r\n \"moldCode\": null,\r\n \"moldModel\": null,\r\n \"moldThickness\": null,\r\n \"moldManufacturer\": null,\r\n \"moldColor\": null,\r\n \"moldChangeReason\": null,\r\n \"rodCount\": null\r\n}",
"requestBody" : "{\r\n \"id\": 2,\r\n \"productionNumber\": 12,\r\n \"productionWeight\": 12,\r\n \"scrapNumber\": 12,\r\n \"scrapReason\": \"243\",\r\n \"frameNumber\": \"123\",\r\n \"nextProcess\": \"yanghua\",\r\n \"isCompleted\": \"\",\r\n \"remarks\": \"11\",\r\n \"reportNumber\": \"20240807\",\r\n \"machine\": \"测试机台2\",\r\n \"operator\": \"张三\",\r\n \"workshop\": \"挤压车间2\",\r\n \"reportDate\": \"2024-09-02 00:00:00\",\r\n \"currentProcess\": \"挤压报工\"\r\n}",
"headers" : [ {
"name" : "authorization",
"value" : "5E34C0D7EA601026B93C26119C7E1AD5304936225AC6AC0DD5E00182C1DF3624BE38DB349BDC91696CBC04B5F9AB5B53",
"value" : "5E34C0D7EA601026B93C26119C7E1AD59CF35D76F0DCA5272366FC6A87E41372412D8F4473A6A7BD5E5C1D4E94AEFD40",
"description" : "登录token",
"required" : false,
"dataType" : "String",
@ -40,14 +40,12 @@
"children" : null
} ],
"paths" : [ ],
"responseBody" : "{\n \"code\": 0,\n \"data\": null,\n \"message\": \"success\"\n}",
"responseBody" : "{\n \"code\": -2,\n \"message\": \"token无效\",\n \"data\": null,\n \"timestamp\": 1726813009589,\n \"executeTime\": null\n}",
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : null
}
================================
import 'commonServices' as CommonServices
String id = body.id;
String productionNumber = body.productionNumber;
String productionWeight = body.productionWeight;
@ -55,27 +53,10 @@ String scrapNumber = body.scrapNumber;
String scrapReason = body.scrapReason;
String frameNumber = body.frameNumber;
String nextProcess = body.nextProcess;
String netReceipts = body.netReceipts;
String isCompleted = body.isCompleted;
String machine = body.machine;
String workshop = body.workshop;
String operator = body.operator;
String remarks = body.remarks;
String reportDate = body.reportDate;
String remarks = body.remarks;
Map map = db.selectOne("""
select mpr.*,
mesd.production_length,
mesd.production_pieces,
mesd.sawing_method
from mini_process_report mpr
left join mini_extrusion_schedule_detail mesd
on mpr.sales_order_code = mesd.sales_order_code and mpr.material_code = mesd.material_code and mpr.order_no = mesd.order_no
where mpr.id=#{id}
""")
Map map = db.selectOne("select * from mini_process_report where id=#{id}")
var tx = db.transaction()
try {
@ -87,74 +68,39 @@ try {
scrap_number: scrapNumber,
scrap_reason: scrapReason,
frame_number: frameNumber,
net_receipts: netReceipts,
next_process: nextProcess,
is_completed: isCompleted,
machine: machine,
workshop: workshop,
operator: operator,
remarks: remarks,
report_date: reportDate
})
if (res <= 0) {
tx.rollback();
exit - 1, "失败"
exit -1, "失败"
}
// if ((Objects.isNull(nextProcess) || nextProcess == "")) {
// if (isCompleted == 1) {
// // 完成更新
// }
// tx.commit()
// return;
// }
if ((Objects.isNull(nextProcess) || nextProcess == "")) {
if (isCompleted == 1) {
if (isCompleted == 1) {
// 完成更新
}
// 更新订单表中的生产数量
res = db.update("""
update mini_sales_order_materials
SET produced_pieces = produced_pieces + #{map.productionPieces},
produced_length = produced_length + #{map.productionLength}
WHERE material_code = #{map.materialCode} and sales_order_code = #{map.salesOrderCode}
and order_no = #{map.orderNo}
""")
// 完成更新
tx.commit()
return;
}
map.preReportNumber = map.reportNumber;
// 自动生成编码
Map codeParams = new HashMap();
codeParams.put("currentProcess", nextProcess);
map.reportNumber = CommonServices.getCode("ProductionOrderNumberSub", codeParams)
// 插入新工序
res = db.table("mini_process_report").insert({
pre_report_number: map.preReportNumber,
schedule_number: map.scheduleNumber,
report_number: map.reportNumber,
machine: map.machine,
operator: map.operator,
workshop: map.workshop,
report_date: map.reportDate,
current_process: nextProcess,
create_by: map.createBy,
source_number: productionNumber,
net_receipts: productionNumber,
sales_order_code: map.salesOrderCode,
order_no: map.orderNo,
material_code: map.materialCode,
frame_number: map.frameNumber,
mold_code: map.moldCode,
mold_model: map.moldModel,
mold_thickness: map.moldThickness,
mold_manufacturer: map.moldManufacturer,
mold_color: map.moldColor,
mold_change_reason: map.moldChangeReason,
rod_count: map.rodCount,
})
if (res > 0) {
@ -162,10 +108,9 @@ try {
return;
}
tx.rollback();
exit - 1, "失败"
exit -1, "失败"
return;
} catch (e) {
print(e.getMessage())
} catch(e) {
tx.rollback()
exit - 1, "失败"
exit -1, "失败"
}

@ -5,7 +5,7 @@
"groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a",
"name" : "列表",
"createTime" : null,
"updateTime" : 1731729532436,
"updateTime" : 1726815371252,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -46,80 +46,31 @@
"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 currentProcess = body.currentProcess; // 当前工序
String reportDate = body.reportDate;
String profileModel = body.profileModel;
// 产品代码 型材型号 物料名称 规格型号 壁厚 米重
// 订单长度M 表面方式 订单总数 排产长度(m) 排产支数 排产日期 锯切方式 交货日期
var sql = """
select
mpr.id,
mpr.report_number,
mpr.machine,
mpr.operator,
mpr.workshop,
date_format(mpr.report_date, '%Y-%m-%d') as report_date,
mpr.current_process,
mpr.next_process,
mpr.production_number,
mpr.production_weight,
mpr.scrap_number,
mpr.scrap_reason,
mpr.frame_number,
mpr.is_completed,
mpr.sales_order_code,
mpr.schedule_number,
mpr.source_number,
mpr.net_receipts,
mpr.mold_code,
mpr.mold_model,
mpr.mold_thickness,
mpr.mold_manufacturer,
mpr.mold_color,
mpr.mold_change_reason,
mpr.rod_count,
mesd.production_length,
mesd.production_pieces,
mesd.sawing_method,
msm.profile_model,
msm.weight,
msm.specification,
msm.thickness,
msm.order_length,
msm.order_total_quantity,
msm.surface_method,
date_format(msm.delivery_date, '%Y-%m-%d') as delivery_date,
msm.material_code,
msm.material_name
from mini_process_report mpr
left join mini_extrusion_schedule_detail mesd
on mpr.sales_order_code = mesd.sales_order_code and mpr.material_code = mesd.material_code and mpr.order_no = mesd.order_no
left join mini_sales_order_materials msm
on mpr.sales_order_code = msm.sales_order_code and mpr.material_code = msm.material_code and mpr.order_no = msm.order_no
id,
report_number,
machine,
operator,
workshop,
date_format(report_date, '%Y-%m-%d') as report_date,
current_process,
next_process,
production_number,
production_weight,
scrap_number,
scrap_reason,
frame_number,
is_completed
from mini_process_report
where 1 = 1
-- and next_process is null
?{salesOrderCode != null and salesOrderCode != '', and mpr.sales_order_code like concat('%', #{salesOrderCode}, '%')}
?{scheduleNumber != null and scheduleNumber != '', and mpr.schedule_number like concat('%', #{scheduleNumber}, '%')}
?{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}, '%')}
?{reportNumber != null and reportNumber != '', and report_number like concat('%', #{reportNumber}, '%')}
?{reportDate != null and reportDate != '', and date_format(report_date, '%Y-%m-%d') = #{reportDate}}
-- group by report_number
"""
return db.page(sql);
// profileModel

@ -5,7 +5,7 @@
"groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a",
"name" : "新增",
"createTime" : null,
"updateTime" : 1731736113438,
"updateTime" : 1728723877581,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -55,11 +55,9 @@ String userId = StringUtil.objectToString(request.get().getAttribute("openid"));
// 查询数据库获取对应 userId 的用户名
String createBy = db.selectOne("""SELECT user_name FROM sys_user WHERE user_id = #{userId}""").userName;
orderInfo.currentProcess = "jiya"
if (orderInfo.isAuto) {
// 自动生成编码
orderInfo.reportNumber = CommonServices.getCode("ProductionOrderNumberSub", orderInfo)
orderInfo.reportNumber = CommonServices.getCode("ProductionOrderNumber", orderInfo)
}
@ -75,16 +73,8 @@ try{
report_date: orderInfo.reportDate,
current_process: orderInfo.currentProcess,
sales_order_code: materialsList.get(0).salesOrderCode,
order_no: materialsList.get(0).orderNo,
material_code: materialsList.get(0).materialCode,
remarks: orderInfo.remarks,
mold_code: materialsList.get(0).moldCode,
mold_model: materialsList.get(0).moldModel,
mold_thickness: materialsList.get(0).moldThickness,
mold_manufacturer: materialsList.get(0).moldManufacturer,
mold_color: materialsList.get(0).moldColor,
mold_change_reason: materialsList.get(0).moldChangeReason,
rod_count: materialsList.get(0).rodCount,
create_by: createBy
})

@ -5,7 +5,7 @@
"groupId" : "06bb1cef20924ed8887b1c3ae8a91d3a",
"name" : "查询完成的列表",
"createTime" : null,
"updateTime" : 1732243852549,
"updateTime" : 1729148530659,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -50,13 +50,11 @@ return db.page("""
mpr.frame_number,
mpr.scrap_reason,
mpr.remarks ,
mpr.stock_quantity,
${salesOrdeSelect}
from mini_process_report mpr
left join mini_sales_orders mso on mso.document_number = mpr.sales_order_code
left join mini_sales_order_materials msm
on mpr.sales_order_code = msm.sales_order_code and mpr.material_code = msm.material_code and mpr.order_no = msm.order_no
where mpr.is_completed = 1 and mso.status = 0 and (mpr.production_number - mpr.stock_quantity) > 0
on mpr.sales_order_code = msm.sales_order_code and mpr.material_code = msm.material_code
where mpr.is_completed = 1
?{salesOrderCode != null and salesOrderCode != '', and mpr.sales_order_code like concat('%', #{salesOrderCode}, '%')}
?{materialCode != null and materialCode != '', and mpr.material_code like concat('%', #{materialCode}, '%')}
""")

@ -5,7 +5,7 @@
"groupId" : "f4b3acf704cf4db29258ba70e24f8fc5",
"name" : "修改",
"createTime" : null,
"updateTime" : 1731567308993,
"updateTime" : 1728727443545,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -75,7 +75,6 @@ try{
list.add({
schedule_number: orderInfo.scheduleNumber,
sales_order_code: marerial.salesOrderCode,
order_no: marerial.orderNo,
material_code: marerial.materialCode,
production_length: marerial.productionLength,
production_pieces: marerial.productionPieces,

@ -5,7 +5,7 @@
"groupId" : "f4b3acf704cf4db29258ba70e24f8fc5",
"name" : "列表",
"createTime" : null,
"updateTime" : 1732611589866,
"updateTime" : 1728727705064,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -25,10 +25,10 @@
"expression" : null,
"children" : null
} ],
"requestBody" : "{\r\n \"page\": 1,\r\n \"size\": 30\r\n}",
"requestBody" : "",
"headers" : [ {
"name" : "authorization",
"value" : "5E34C0D7EA601026B93C26119C7E1AD5FD8181534AF63488EA20A16DC159FCC834A620E0A0B1706ADEAA4B0F75B5AF85",
"value" : null,
"description" : "登录token",
"required" : false,
"dataType" : "String",
@ -40,7 +40,7 @@
"children" : null
} ],
"paths" : [ ],
"responseBody" : "{\n \"code\": -1,\n \"data\": null,\n \"message\": \"系统内部出现错误\"\n}",
"responseBody" : null,
"description" : null,
"requestBodyDefinition" : null,
"responseBodyDefinition" : null
@ -66,11 +66,10 @@ var sql = """
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
?{scheduleNumber!=null && scheduleNumber!="", and mes.schedule_number like concat('%', #{scheduleNumber} ,'%') }
?{extrusionDate!=null && extrusionDate!="", and date(mes.extrusion_date) = #{extrusionDate} }
?{extrusionMachine!=null && extrusionMachine!="", and mes.extrusion_machine = #{extrusionMachine} }
?{extrusionTeam!=null && extrusionTeam!="", and mes.extrusion_team = #{extrusionTeam} }
?{scheduleNumber!=null && scheduleNumber!="", and mes.schedule_number like concat('%', #{scheduleNumber} ,'%') }
?{extrusionDate!=null && extrusionDate!="", and date(mes.extrusion_date) = #{extrusionDate} }
?{extrusionMachine!=null && extrusionMachine!="", and mes.extrusion_machine = #{extrusionMachine} }
?{extrusionTeam!=null && extrusionTeam!="", and mes.extrusion_team = #{extrusionTeam} }
"""
return db.page(sql)
return db.page(sql);

@ -5,7 +5,7 @@
"groupId" : "f4b3acf704cf4db29258ba70e24f8fc5",
"name" : "新增",
"createTime" : null,
"updateTime" : 1731651357563,
"updateTime" : 1728726723475,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -76,12 +76,33 @@ try{
if (res > 0) {
println("挤压排产单插入成功")
// res = db.update("""
// update mini_production_schedule
// SET productioned_pieces = CASE
// <foreach collection="materialsList" item="item" separator=" ">
// WHEN material_code = #{item.materialCode} and sales_order_code = #{purchInfo.documentNumber} THEN productioned_pieces + #{item.productionPieces}
// </foreach>
// ELSE productioned_pieces
// END
// WHERE (sales_order_code, material_code) in (
// <foreach collection="materialsList" item="item" separator=",">
// (#{purchInfo.documentNumber}, #{item.materialCode})
// </foreach>
// )
// """)
// if (res <= 0) {
// tx.rollback();
// println("更新计划表失败")
// exit -1, "提交失败";
// }
List list = new ArrayList();
List list2 = new ArrayList();
materialsList.map(marerial => {
list.add({
schedule_number: orderInfo.scheduleNumber,
sales_order_code: marerial.salesOrderCode,
order_no: marerial.orderNo,
material_code: marerial.materialCode,
production_length: marerial.productionLength,
production_pieces: marerial.productionPieces,
@ -93,29 +114,6 @@ try{
res = db.table("mini_extrusion_schedule_detail").batchInsert(list)
if (res > 0) {
// 更新计划排产信息
res = db.update("""
update mini_production_schedule
SET status = 1, productioned_pieces = CASE
<foreach collection="materialsList" item="item" separator=" ">
WHEN order_no = #{item.orderNo} and sales_order_code = #{item.salesOrderCode}
THEN productioned_pieces + #{item.productionPieces}
</foreach>
ELSE productioned_pieces
END
WHERE (sales_order_code, order_no) in (
<foreach collection="materialsList" item="item" separator=",">
(#{item.salesOrderCode}, #{item.orderNo})
</foreach>
)
""")
if (res <= 0) {
tx.rollback();
println("更新计划表失败", res)
exit -1, "提交失败";
}
tx.commit(); // 提交事务
exit 0, "执行成功", null;
}

@ -5,7 +5,7 @@
"groupId" : "f4b3acf704cf4db29258ba70e24f8fc5",
"name" : "详情",
"createTime" : null,
"updateTime" : 1731567258141,
"updateTime" : 1728728158049,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -59,7 +59,7 @@ return {
left join sys_user su on su.user_id = mso.salesperson
left join mini_customer_info mci on mci.customer_code = mso.customer_id
left join mini_sales_order_materials msm
on mesd.sales_order_code = msm.sales_order_code and mesd.material_code = msm.material_code and mesd.order_no = msm.order_no
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" : "e95307c32dc1437e82df26a97f1f194e",
"name" : "列表",
"createTime" : null,
"updateTime" : 1732269376384,
"updateTime" : 1727082831997,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -52,7 +52,7 @@ return db.page("""
select
id,
document_number,
date_format(return_date,'%Y-%m-%d') as return_date,
date_format(return_date,'%Y-%m-%d %H:%i:%S') as return_date,
department,
recipient,
warehouse,

@ -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} ,'%') }
""");

@ -5,7 +5,7 @@
"groupId" : "d4e06c480fb04ecaaaee36cd3ad92aea",
"name" : "列表",
"createTime" : null,
"updateTime" : 1732269382705,
"updateTime" : 1729072453053,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -52,7 +52,7 @@ return db.page("""
select
mmr.id,
mmr.document_number,
date_format(mmr.requisition_date,'%Y-%m-%d') as requisition_date,
date_format(mmr.requisition_date,'%Y-%m-%d %H:%i:%S') as requisition_date,
mmr.department,
mmr.recipient,
mmr.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

@ -5,7 +5,7 @@
"groupId" : "d4e06c480fb04ecaaaee36cd3ad92aea",
"name" : "领料物料列表",
"createTime" : null,
"updateTime" : 1732592621097,
"updateTime" : 1729136886715,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -27,12 +27,6 @@ import '@/common/sql' as sql
String documentNumber = body.documentNumber;
String warehouse = body.warehouse;
String orderNo = body['orderNo'];
String materialCode = body['materialCode'];
String profileModel = body['profileModel'];
String customerId = body['customerId'];
String surfaceMethod = body['surfaceMethod'];
String warehouseMaterial = sql("warehouseMaterial")
return db.page("""
@ -47,9 +41,9 @@ return db.page("""
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 and mwm.material_code = mmr.material_code
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} ,'%') }

@ -5,7 +5,7 @@
"groupId" : "06d35cc5db5f4e6681262a1648c871c3",
"name" : "修改",
"createTime" : null,
"updateTime" : 1731567452397,
"updateTime" : 1726362872013,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -50,11 +50,10 @@ String salesOrderCode = body.salesOrderCode;
String materialCode = body.materialCode;
String plannedPieces = body.plannedPieces;
String remarks = body.remarks;
String orderNo = body.orderNo;
return db.update("""
update mini_production_schedule set
planned_pieces=#{plannedPieces},
remarks = #{remarks}
where sales_order_code=#{salesOrderCode} and material_code=#{materialCode} and order_no=#{orderNo}
where sales_order_code=#{salesOrderCode} and material_code=#{materialCode}
""")

@ -5,7 +5,7 @@
"groupId" : "06d35cc5db5f4e6681262a1648c871c3",
"name" : "列表",
"createTime" : null,
"updateTime" : 1732243435733,
"updateTime" : 1728726289833,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -160,12 +160,6 @@ import '@/common/sql' as sql
String documentNumber = body["documentNumber"];
String salesOrderCode = body["salesOrderCode"];
String materialName = body["materialName"];
String materialCode = body["materialCode"];
String deliveryDate = body["deliveryDate"];
String customerName = body["customerName"];
String orderNo = body["orderNo"];
String orderStatus = body["orderStatus"]; // 订单状态
String salesOrdeSelect = sql("salesOrder")
String sql = """
@ -181,7 +175,6 @@ String sql = """
mso.pricing_date,
mso.tax_rate,
mso.processing_fee,
mps.status as plan_status,
${salesOrdeSelect}
from
mini_production_schedule mps
@ -189,16 +182,11 @@ String sql = """
left join sys_user su on su.user_id = mso.salesperson
left join mini_customer_info mci on mci.customer_code = mso.customer_id
left join mini_sales_order_materials msm
on mps.sales_order_code = msm.sales_order_code and mps.material_code = msm.material_code and mps.order_no = msm.order_no
where 1=1 and mso.status=0
on mps.sales_order_code = msm.sales_order_code and mps.material_code = msm.material_code
where 1=1
?{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}, '%')}
?{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}}
""";
// ?{orderStatus != null and orderStatus != '', and mps.status = #{orderStatus}}
return db.page(sql);

@ -5,7 +5,7 @@
"groupId" : "06d35cc5db5f4e6681262a1648c871c3",
"name" : "新增",
"createTime" : null,
"updateTime" : 1731575808607,
"updateTime" : 1728724750705,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -48,33 +48,11 @@
================================
import 'commonServices' as CommonServices
String type = body["type"];
List selection = body.selection;
Map orderInfo = body.orderInfo;
List selection = new ArrayList();
// 判断是否一键生成计划单
if (Objects.nonNull(type) && "once".equals(type)) {
// 一键生成计划单
// 获取订单物料信息
selection = db.select("""
select
msom.id,
msom.sales_order_code,
msom.material_code,
msom.order_no,
msom.order_total_quantity as planned_pieces
from mini_sales_order_materials msom
where 1=1 and msom.sales_order_code = #{orderInfo.documentNumber}
""")
} else {
selection = body['selection'];
}
Map form = body.form;
if (Objects.isNull(selection) || selection.size() <= 0) {
exit - 1, "数据为空"
exit -1, "数据为空"
}
String userId = StringUtil.objectToString(request.get().getAttribute("openid"));
@ -89,20 +67,19 @@ if (form.isAuto) {
}
var tx = db.transaction(); //开启事务
try {
var tx = db.transaction(); //开启事务
try{
var res = db.insert("""
insert into mini_production_schedule(
document_number,
sales_order_code,
order_no,
material_code,
planned_pieces,
remarks,
create_by
) values
<foreach collection="selection" item="item" separator=",">
(#{documentNumber}, #{orderInfo.documentNumber}, #{item.orderNo}, #{item.materialCode},#{item.plannedPieces},#{item.remarks},#{createBy})
(#{documentNumber}, #{orderInfo.documentNumber}, #{item.materialCode},#{item.plannedPieces},#{item.remarks},#{createBy})
</foreach>
""")
if (res > 0) {
@ -111,10 +88,10 @@ try {
""")
var res2 = db.update("""
update mini_sales_order_materials set status = 1
where (sales_order_code, order_no) in (
update mini_sales_order_materials set status=1
where (sales_order_code, material_code) in (
<foreach collection="selection" item="item" separator=",">
(#{orderInfo.documentNumber}, #{item.orderNo})
(#{orderInfo.documentNumber}, #{item.materialCode})
</foreach>
)
""")
@ -125,11 +102,11 @@ try {
}
}
tx.rollback()
exit - 1, "失败"
} catch (e) {
exit -1, "失败"
} catch(e) {
println(e)
tx.rollback()
exit - 1, "失败"
exit -1, "失败"
}

@ -5,7 +5,7 @@
"groupId" : "06d35cc5db5f4e6681262a1648c871c3",
"name" : "详情",
"createTime" : null,
"updateTime" : 1731567386509,
"updateTime" : 1728721582011,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -35,7 +35,7 @@ String sql = """
from
mini_production_schedule mps
left join mini_sales_order_materials msm
on mps.sales_order_code = msm.sales_order_code and mps.material_code = msm.material_code and mps.order_no = msm.order_no
on mps.sales_order_code = msm.sales_order_code and mps.material_code = msm.material_code
where 1=1 and mps.sales_order_code = #{salesOrderCode}
""";

@ -5,7 +5,7 @@
"groupId" : "a2b7765d540449b7bf93e070c1911ce9",
"name" : "列表",
"createTime" : null,
"updateTime" : 1733368094450,
"updateTime" : 1726243288668,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -52,10 +52,6 @@ String purchaseDate = body.purchaseDate;
String purchaser = body.purchaser;
String price = body.price;
String deliveryDate = body.deliveryDate;
String status = body.status
List purchaseDateRang = body.purchaseDateRang;
List deliveryDateRang = body.deliveryDateRang;
var sql = """
select
@ -70,23 +66,20 @@ var sql = """
date_format(mpo.delivery_date, '%Y-%m-%d') as delivery_date,
mpo.remarks,
mpo.is_warehouse,
mpo.status,
date_format(mpo.create_time, '%Y-%m-%d %H:%i:%S') as create_time,
date_format(mpo.update_time, '%Y-%m-%d %H:%i:%S') as update_time
from mini_purchase_orders mpo
left join mini_supplier_info msi on msi.id = mpo.supplier
left join sys_user su on su.user_id = mpo.purchaser
where 1 = 1
?{documentNumber != null and documentNumber != '', and mpo.document_number like concat('%', #{documentNumber} ,'%')}
?{documentNumber != null and documentNumber != '', and mpo.document_number = #{documentNumber}}
?{supplier != null and supplier != '', and mpo.supplier = #{supplier}}
?{purchaseDateRang != null and purchaseDateRang != '' and purchaseDateRang.size() > 0, and date(mpo.purchase_date) between #{purchaseDateRang[0]} and #{purchaseDateRang[1]}}
?{purchaseDate != null and purchaseDate != '', and mpo.purchase_date = #{purchaseDate}}
?{purchaser != null and purchaser != '', and mpo.purchaser = #{purchaser}}
?{price != null and price != '', and mpo.price = #{price}}
?{deliveryDateRang != null and deliveryDateRang != '' and deliveryDateRang.size() > 0, and date(mpo.delivery_date) between #{deliveryDateRang[0]} and #{deliveryDateRang[1]}}
?{status != null and status != '', and mpo.status = #{status}}
?{deliveryDate != null and deliveryDate != '', and mpo.delivery_date = #{deliveryDate}}
"""
// ?{purchaseDate != null and purchaseDate != '', and mpo.purchase_date = #{purchaseDate}}
// ?{deliveryDate != null and deliveryDate != '', and mpo.delivery_date = #{deliveryDate}}
String supplier = body.supplier;
String purchaseDate = body.purchaseDate;
String purchaser = body.purchaser;

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

@ -5,7 +5,7 @@
"groupId" : "a170047f79ab4cb1b892edc5cccd823e",
"name" : "新增",
"createTime" : null,
"updateTime" : 1731743100652,
"updateTime" : 1729160792624,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -25,10 +25,10 @@
"expression" : 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" : [ {
"name" : "authorization",
"value" : "5E34C0D7EA601026B93C26119C7E1AD50FF4301C7ED4F6D71B9389266C4D0154EA305F5647F993754318DA0ED39E8450",
"value" : null,
"description" : "登录token",
"required" : false,
"dataType" : "String",
@ -81,35 +81,14 @@ try{
create_by: createBy,
})
String whSql = ""
if (Objects.nonNull(marerial.warehouse)) {
whSql = "and warehouse=#{marerial.warehouse}"
} else {
whSql = "and warehouse is null"
}
// 库存扣除
var res2 = db.update("""
update mini_warehouse_product set
existing_inventory = existing_inventory - #{marerial.shipmentQuantity} ,
actual_weight = actual_weight - #{marerial.actualWeight}
where order_no = #{marerial.orderNo}
and material_code = #{marerial.materialCode} and sales_order_code = #{marerial.salesOrderCode}
""" + whSql)
if (res2 <= 0) {
tx.rollback();
exit -1, "提交失败";
}
// 更新销售单
var res3 = db.update("""
update mini_sales_order_materials set
shipmentsed_number = shipmentsed_number + #{marerial.shipmentQuantity}
where order_no = #{marerial.orderNo}
and material_code = #{marerial.materialCode} and sales_order_code = #{marerial.salesOrderCode}
where warehouse=#{marerial.warehouse} and material_code = #{marerial.materialCode} and sales_order_code = #{marerial.salesOrderCode}
""")
print(res3)
if (res3 <= 0) {
if (res2 <= 0) {
tx.rollback();
exit -1, "提交失败";
}

@ -5,7 +5,7 @@
"groupId" : "e631b317606f4246ac82585a7c1f1c5b",
"name" : "列表",
"createTime" : null,
"updateTime" : 1733370728955,
"updateTime" : 1728721690603,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -47,19 +47,11 @@
}
================================
String documentNumber = body.documentNumber;
String salesperson = body.salesperson;
String customerName = body.customerName;
String deliveryDate = body.deliveryDate;
String salesDate = body.salesDate;
String price = body.price;
String status = body.status
String customerId = body.customerId; // 客户
String salesperson = body.salesperson; // 销售员
String remarks = body.remarks; // 备注
List salesDateRang = body.salesDateRang; // 销售日期范围
List deliveryDateRang = body.deliveryDateRang; // 交货日期范围
var sql = """
select
@ -77,25 +69,17 @@ var sql = """
mso.processing_fee,
mso.remarks,
mso.create_by,
mso.no_edit,
mso.status,
date_format(mso.create_time, '%Y-%m-%d %H:%i:%S') as create_time
from mini_sales_orders mso
left join sys_user su on su.user_id = mso.salesperson
left join mini_customer_info mci on mci.customer_code = mso.customer_id
where 1 = 1
?{documentNumber != null and documentNumber != '', and mso.document_number like concat('%', #{documentNumber}, '%')}
?{salesperson != null and salesperson != '', and mso.salesperson like concat('%', #{salesperson}, '%')}
?{salesDate != null and salesDate != '', and mso.sales_date like concat('%', #{salesDate}, '%')}
?{price != null and price != '', and mso.price = #{price}}
?{customerId != null and customerId != '', and mso.customer_id like concat('%', #{customerId}, '%')}
?{deliveryDate != null and deliveryDate != '', and mso.delivery_date = #{deliveryDate}}
?{status != null and status != '', and mso.status = #{status}}
?{salesperson != null and salesperson != '', and mso.salesperson = #{salesperson}}
?{remarks != null and remarks != '', and mso.remarks like concat('%', #{remarks}, '%')}
?{customerId != null and customerId != '', and mso.customer_id = #{customerId}}
?{salesDateRang != null and salesDateRang != '' and salesDateRang.size() > 0, and date(mso.sales_date) between #{salesDateRang[0]} and #{salesDateRang[1]}}
?{deliveryDateRang != null and deliveryDateRang != '' and deliveryDateRang.size() > 0, and date(mso.delivery_date) between #{deliveryDateRang[0]} and #{deliveryDateRang[1]}}
"""
return db.page(sql);

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

@ -5,7 +5,7 @@
"groupId" : "e631b317606f4246ac82585a7c1f1c5b",
"name" : "详情",
"createTime" : null,
"updateTime" : 1732247167464,
"updateTime" : 1726804865592,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -42,12 +42,5 @@ return {
left join sys_user su on su.user_id = mso.salesperson
where mso.document_number = #{documentNumber}
"""),
materials: db.select("""
select
msom.*,
ifNull(msm.color_name, msom.surface_method) as surface_method_name
from mini_sales_order_materials msom
left join mini_surface_methods msm on msm.color_code = msom.surface_method
where msom.sales_order_code = #{documentNumber}
"""),
materials: db.select("select * from mini_sales_order_materials where sales_order_code = #{documentNumber}"),
}

@ -5,7 +5,7 @@
"groupId" : "e631b317606f4246ac82585a7c1f1c5b",
"name" : "详情列表",
"createTime" : null,
"updateTime" : 1733380763524,
"updateTime" : 1726398795041,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -22,25 +22,9 @@
"responseBodyDefinition" : null
}
================================
String salesOrderCode = body.salesOrderCode; // 销售单号
String salesOrderCode = body.salesOrderCode;
String status = body.status;
String orderNo = body['orderNo']; // 订单号
String materialCode = body['materialCode']; // 物料编码
String profileModel = body['profileModel']; // 型材型号
String customerId = body['customerId']; // 客户
String surfaceMethod = body['surfaceMethod']; // 表面方式
String salesperson = body['salesperson']; // 销售员
String materialName = body['materialName']; // 物料名称
String specification = body['specification']; // 规格型号
String orderLength = body['orderLength']; // 订单长度
List salesDateRang = body['salesDateRang']; // 销售日期范围
List deliveryDateRang = body['deliveryDateRang']; // 交货日期范围
String deliveryFg = body['deliveryFg']; // 是否完成交货
return db.page("""
select
msom.id,
@ -60,7 +44,6 @@ return db.page("""
msom.order_length,
msom.order_total_quantity,
msom.surface_method,
ifNull(msm.color_name, msom.surface_method) as surface_method_name,
msom.theoretical_weight_per_piece,
msom.theoretical_weight,
msom.packing_quantity,
@ -79,45 +62,14 @@ return db.page("""
msom.unit_price,
msom.order_no,
msom.status,
mso.customer_id,
mci.customer_name,
mso.salesperson,
su.user_name as salesperson_name,
date_format(mso.sales_date, '%Y-%m-%d') as sales_date,
date_format(mso.pricing_date, '%Y-%m-%d') as pricing_date,
mso.processing_fee,
mso.price,
mso.tax_rate,
mwp.existing_inventory,
mwp.actual_weight,
(msom.order_total_quantity - mwp.existing_inventory) as completed_inventor,
((msom.order_length * msom.order_total_quantity * msom.weight) - mwp.actual_weight) as completed_weight,
if((msom.order_total_quantity - msom.shipmentsed_number) <= 0 , 1, 2) deliveryFg
mso.customer_id,
mso.price,
mso.tax_rate
from mini_sales_order_materials msom
left join mini_sales_orders mso on msom.sales_order_code = mso.document_number
left join mini_surface_methods msm on msm.color_code = msom.surface_method
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_warehouse_product mwp on
mwp.order_no = msom.order_no
and mwp.sales_order_code = msom.sales_order_code
where 1=1
?{salesOrderCode != null and salesOrderCode != "", and msom.sales_order_code list concat('%',#{salesOrderCode},'%') }
?{status != null and status != "", and msom.status = #{status} }
?{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}}
?{salesperson != null and salesperson != '', and mso.salesperson = #{salesperson}}
?{salesDateRang != null and salesDateRang != '' and salesDateRang.size() > 0, and date(mso.sales_date) between #{salesDateRang[0]} and #{salesDateRang[1]}}
?{deliveryDateRang != null and deliveryDateRang != '' and deliveryDateRang.size() > 0, and date(mso.delivery_date) between #{deliveryDateRang[0]} and #{deliveryDateRang[1]}}
?{materialName != null and materialName != '', and msom.material_name like concat('%', #{materialName}, '%')}
?{specification != null and specification != '', and msom.specification like concat('%', #{specification}, '%')}
?{orderLength != null and orderLength != '', and msom.order_length = #{orderLength}}
?{deliveryFg!=null && deliveryFg !="" && deliveryFg == 1, and (msom.order_total_quantity - msom.shipmentsed_number) <= 0 }
?{deliveryFg!=null && deliveryFg !="" && deliveryFg == 2, and (msom.order_total_quantity - msom.shipmentsed_number) > 0 }
?{salesOrderCode != null and salesOrderCode != "",
and msom.sales_order_code list concat('%',#{salesOrderCode},'%') }
?{status != null and status != "",
and msom.status = #{status} }
""")

@ -5,7 +5,7 @@
"groupId" : "388106ae8a6c473093fbfd5473f6a755",
"name" : "新增",
"createTime" : null,
"updateTime" : 1733381195085,
"updateTime" : 1726418533973,
"lock" : null,
"createBy" : null,
"updateBy" : null,
@ -68,7 +68,7 @@ try{
})
if (res > 0) {
println("销售退货插入成功")
println("采购入库单插入成功")
// 更新采购订单状态
res = db.update("""
@ -81,21 +81,21 @@ try{
}
// 更新退货数量
// res = db.update("""
// update mini_sales_order_materials
// SET returned_number = CASE order_no
// <foreach collection="materialsList" item="item" separator=" ">
// WHEN #{item.orderNo} THEN returned_number + #{item.returnQuantity}
// </foreach>
// ELSE returned_number
// END
// WHERE sales_order_code = #{purchInfo.documentNumber};
// """)
res = db.update("""
update mini_sales_order_materials
SET returned_number = CASE material_code
<foreach collection="materialsList" item="item" separator=" ">
WHEN #{item.materialCode} THEN returned_number + #{item.returnQuantity}
</foreach>
ELSE returned_number
END
WHERE sales_order_code = #{purchInfo.documentNumber};
""")
// if (res <= 0) {
// tx.rollback();
// exit -1, "提交失败";
// }
if (res <= 0) {
tx.rollback();
exit -1, "提交失败";
}
List list = new ArrayList();
List list2 = new ArrayList();
@ -104,7 +104,6 @@ try{
sales_return_code: orderInfo.documentNumber,
material_code: marerial.materialCode,
material_name: marerial.materialName,
order_no: marerial.orderNo,
profile_model: marerial.profileModel,
weight: marerial.weight,
specification: marerial.specification,
@ -129,39 +128,6 @@ try{
remark: marerial.remark,
create_by: createBy
})
String whSql = ""
if (Objects.nonNull(marerial.warehouse)) {
whSql = "and warehouse=#{marerial.warehouse}"
} else {
whSql = "and warehouse is null"
}
// 库存增加
var res2 = db.update("""
update mini_warehouse_product set
existing_inventory = existing_inventory + #{marerial.returnQuantity} ,
actual_weight = actual_weight + #{marerial.actualWeight}
where order_no = #{marerial.orderNo}
and material_code = #{marerial.materialCode} and sales_order_code = #{marerial.salesOrderCode}
""" + whSql)
if (res2 <= 0) {
tx.rollback();
exit -1, "提交失败";
}
// 更新销售单
var res3 = db.update("""
update mini_sales_order_materials set
returned_number = returned_number + #{marerial.returnQuantity}
where order_no = #{marerial.orderNo}
and material_code = #{marerial.materialCode} and sales_order_code = #{marerial.salesOrderCode}
""")
if (res3 <= 0) {
tx.rollback();
exit -1, "提交失败";
}
})
res = db.table("mini_sales_returns_materials").batchInsert(list)

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

@ -5,7 +5,7 @@
"groupId" : "c3fc8c12916e40319e19fc434a708a83",
"name" : "公共sql",
"createTime" : null,
"updateTime" : 1731567002826,
"updateTime" : 1728704818002,
"lock" : null,
"createBy" : null,
"updateBy" : null,

@ -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,8 +1,8 @@
spring:
profiles:
active: local # test 本地
# active: local # test 本地
# active: dev # test 测试
# active: pro # pro 生产
active: pro # pro 生产
# 通用配置
servlet:
@ -69,16 +69,3 @@ o2:
enabled: true
# 同步新增o2的客户api地址
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

@ -70,6 +70,7 @@
<script>
import module from "./module";
import config from "@/config";
import savePage from "./savePage";
export default {

@ -116,6 +116,7 @@
</template>
<script>
import useTabs from "@/utils/useTabs";
import selectPage from "./selectPage";
import module from "./module";
@ -303,6 +304,12 @@ export default {
}
},
back() {
// useTabs.closeNext((tags) => {
// //'/usercenter'
// console.log(tags);
// this.$router.push(this.path);
// this.$route.is = true;
// });
this.visible = false;
},
save() {

@ -91,6 +91,8 @@
</template>
<script>
import useTabs from "@/utils/useTabs";
import module from "./module";
export default {
@ -302,6 +304,12 @@ export default {
this.detailListData = [...data, ...this.detailListData];
},
back() {
// useTabs.closeNext((tags) => {
// //'/usercenter'
// console.log(tags);
// this.$router.push(this.path);
// this.$route.is = true;
// });
this.visible = false;
},
save() {

@ -4,7 +4,6 @@
v-model="visible"
:width="panelWidth"
destroy-on-close
:append-to-body="true"
@closed="$emit('closed')"
>
<el-container>
@ -33,21 +32,17 @@
clearable
>
</el-input>
<el-input v-model="search.orderNo" placeholder="订单号" clearable>
</el-input>
<el-input
v-model="search.customerName"
placeholder="客户名称"
clearable
>
</el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="upsearch"
></el-button>
<el-button type="primary" plain @click="add"></el-button>
<el-button
type="primary"
plain
@click="add"
>添加</el-button>
</div>
</el-header>
<el-main class="nopadding">
@ -59,10 +54,7 @@
row-key="id"
@selection-change="selectionChange"
>
<el-table-column
type="selection"
width="50"
:reserve-selection="true"
<el-table-column type="selection" width="50" :reserve-selection="true"
:selectable="selectable"
></el-table-column>
</scTable>
@ -96,15 +88,14 @@ export default {
params: module.tableSelect.params,
selection: [],
materialCategoryItem: {
options: {
tb: "product_material_categories",
placeholder: "物料/产品分类",
},
options: { tb: 'product_material_categories', placeholder: '物料/产品分类' }
},
listData: [],
listData: []
};
},
mounted() {},
mounted() {
},
methods: {
//
open() {
@ -114,28 +105,26 @@ export default {
materialName: "",
productCode: "",
profileModel: "",
};
}
this.$forceUpdate();
this.visible = true;
return this;
},
setData(listData) {
console.log("listData", listData);
console.log(typeof listData);
console.log("listData", listData)
console.log(typeof listData)
this.listData = listData;
},
selectable(row, index) {
console.log("this.listData", this.listData);
return !this.listData.some(
(item) => row.documentNumber == item.documentNumber
);
console.log("this.listData", this.listData)
return !this.listData.some(item => row.documentNumber == item.documentNumber)
},
//
selectionChange(selection) {
this.selection = selection;
},
add() {
this.$emit("success", this.selection);
this.$emit("success", this.selection)
this.visible = false;
},
//
@ -146,5 +135,5 @@ export default {
};
</script>
<style lang="less" scoped>
<style>
</style>

@ -117,19 +117,19 @@ export default {
"title": "选计划排产订单",
"panelWidth": "1000px",
"api": "productionSchedule.list",
"params": { "status": 1, "orderStatus": 1 },
"params": { "status": 1 },
"column": [
{ label: "", prop: "id", width: "200", hide: true },
{ label: "计划单号", prop: "documentNumber", width: "200" },
{ label: "销售单号", prop: "salesOrderCode", width: "200" },
{ label: "客户名称", prop: "customerName", width: "200" },
{ "label": "客户名称", "prop": "customerName", "width": "200" },
{
label: "销售日期",
prop: "salesDate",
width: "200",
},
{ label: "销售员", prop: "salespersonName", width: "200" },
{ label: "价格", prop: "price", width: "200" },
{ "label": "销售员", "prop": "salespersonName", "width": "200" },
{ "label": "价格", "prop": "price", "width": "200" },
{
label: "定价日期",
prop: "pricingDate",
@ -140,10 +140,9 @@ export default {
prop: "deliveryDate",
width: "200",
},
{ label: "税率", prop: "taxRate", width: "200" },
{ label: "加工费", prop: "processingFee", width: "200" },
{ label: "备注", prop: "remarks", width: "200" },
{ label: "订单号", prop: "orderNo", width: "200" },
{ "label": "税率", "prop": "taxRate", "width": "200" },
{ "label": "加工费", "prop": "processingFee", "width": "200" },
{ "label": "备注", "prop": "remarks", "width": "200" },
{ label: "物料编号", prop: "materialCode", width: "200" },
{ label: "型材型号", prop: "profileModel", width: "200" },
{ label: "物料名称", prop: "materialName", width: "200" },
@ -151,6 +150,7 @@ export default {
{ label: "壁厚", prop: "thickness", width: "200" },
{ label: "米重 (kg/m)", prop: "weight", width: "200" },
{ label: "支/扎", prop: "piecesBundle", width: "200" },
{ label: "物料/产品分类", prop: "materialCategoryName", width: "200" },
{ label: "包装方式", prop: "packagingMethod", width: "200" },
],
},

@ -80,6 +80,7 @@
v-model="scoped.row.productionPieces"
:step="1"
:min="1"
:max="Number(scoped.row.plannedPieces) - Number(scoped.row.productionedPieces)"
:precision="0"
:controls="true"
@ -137,12 +138,14 @@ export default {
selection: [],
dialog: {
product: false,
selectPage: false,
},
supplier: {},
path: this.$route.query.path,
detailId: this.$route.query.id,
mode: "add",
dialog: {
selectPage: false,
},
visible: false,
orderInfo: {}
};
@ -172,7 +175,6 @@ export default {
handler(newVal) {
if (!newVal) return;
newVal.forEach((item) => {
/* 支数 */
item["pieces"] = parseFloat(
Number(item["piecesBundle"]) * Number(item["returnQuantity"])
@ -191,8 +193,8 @@ export default {
item["theoreticalWeight"] = parseFloat(
(
Number(item["weight"]) *
Number(item["orderLength"]) *
Number(item["plannedPieces"])
Number(item["defaultLength"]) *
Number(item["returnQuantity"])
).toFixed(2)
);
@ -248,7 +250,7 @@ export default {
this.listData = this.listData.filter(
(item1) =>
!this.selection.some(
(item2) => item2.orderNo === item1.orderNo
(item2) => item2.materialCode === item1.materialCode
)
);
this.selection = [];
@ -263,11 +265,8 @@ export default {
item[key] = _this.initComputed[key];
}
}
item["productionLength"] = item["orderLength"]
item["productionPieces"] = item["plannedPieces"]
});
console.log("2", this, this.listData)
this.listData = [...data];
},
async queryInventoryQuantity(row) {

@ -37,7 +37,8 @@
<script>
import saveDialog from './save'
import module from './module'
import savePage from './savePage'
import config from "@/config"
import savePage from './savePage'
export default {
components: {

@ -107,6 +107,8 @@
</template>
<script>
import useTabs from "@/utils/useTabs";
import module from "./module";
import materialsSelect from "./materialsSelect";
@ -313,6 +315,12 @@ export default {
}
},
back() {
// useTabs.closeNext((tags) => {
// //'/usercenter'
// console.log(tags);
// this.$router.push(this.path);
// this.$route.is = true;
// });
this.visible = false;
},
save() {

@ -37,7 +37,8 @@
<script>
import saveDialog from './save'
import module from './module'
import savePage from './savePage'
import config from "@/config"
import savePage from './savePage'
export default {
components: {

@ -102,6 +102,8 @@
</template>
<script>
import useTabs from "@/utils/useTabs";
import module from "./module";
import materialsSelect from "./materialsSelect";
@ -211,6 +213,12 @@ export default {
},
created() {},
mounted() {
//tab
// this.$store.commit(
// "updateViewTagsTitle",
// this.id ? `CURDID:${this.id}` : "CURD"
// );
// this.loadDetail();
},
methods: {
open(mode="add") {
@ -281,6 +289,12 @@ export default {
}
},
back() {
// useTabs.closeNext((tags) => {
// //'/usercenter'
// console.log(tags);
// this.$router.push(this.path);
// this.$route.is = true;
// });
this.visible = false;
},
save() {

@ -79,7 +79,6 @@
v-model="scoped.row.receiptQuantity"
:step="1"
:min="1"
:max="scoped.row.productionNumber - scoped.row.stockQuantity"
:precision="0"
:controls="true"
v-if="mode=='add'"
@ -294,7 +293,6 @@ export default {
item[key] = _this.initComputed[key];
}
}
item['receiptQuantity'] = item['productionNumber']
});
this.listData = [...data, ...this.listData];
},

@ -1,190 +1,102 @@
<template>
<el-container style="position: relative">
<el-container style="position: relative;">
<el-header>
<div class="left-panel">
<el-button
type="primary"
icon="el-icon-plus"
@click="page_add"
v-if="isFirst"
></el-button>
<el-button type="primary" icon="el-icon-plus" @click="page_add"></el-button>
</div>
<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
v-model="search.reportNumber"
placeholder="报工单号"
clearable
>
v-model="search.reportNumber"
placeholder="报工单号"
clearable>
</el-input>
<dicselect v-model="search.currentProcess" :item="currentProcessItem">
</dicselect>
<el-date-picker
v-model="search.reportDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="报工日期"
style="width: 600px"
v-model="search.date"
type="date"
value-format="YYYY-MM-DD"
placeholder="日期"
style="width: 600px"
></el-date-picker>
<el-button
type="primary"
icon="el-icon-search"
@click="upsearch"
></el-button>
<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
:column="column"
:remoteFilter="config.remoteFilter"
:params="params"
row-key=""
@selection-change="selectionChange"
>
<scTable 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
label="操作"
fixed="right"
align="center"
width="120"
v-if="config.option"
>
<el-table-column label="操作" fixed="right" align="center" width="120" v-if="config.option">
<template #default="scope">
<el-button
type="text"
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' && (!scope.row.nextProcess)"
>完成</el-button
>
<el-button type="text" 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>
</el-table-column>
</scTable>
</el-main>
<save-page
ref="savePage"
v-if="dialog.savePage"
@closed="dialog.savePage = false"
@success="handleSuccess"
></save-page>
<save-page ref="savePage" v-if="dialog.savePage" @closed="dialog.savePage = false" @success="handleSuccess"></save-page>
</el-container>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSuccess"
@closed="dialog.save = false"
></save-dialog>
<info-dialog
v-if="dialog.info"
ref="infoDialog"
@closed="dialog.info = false"
></info-dialog>
<save-dialog v-if="dialog.save" 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>
<script>
import saveDialog from "./save";
import module from "./module";
import savePage from "./savePage";
import infoDialog from "./info";
import dicselect from "@/components/scForm/items/dicselect";
import saveDialog from './save'
import module from './module'
import config from "@/config"
import savePage from './savePage'
import infoDialog from './info'
export default {
components: {
saveDialog,
savePage,
infoDialog,
dicselect,
infoDialog
},
data() {
let currentProcess = "";
if (this.$route.path.startsWith("/processReport/")) {
currentProcess = this.$route.path.replace("/processReport/", "");
}
return {
dialog: {
save: false,
info: false,
product: false,
finish: false,
savePage: false,
savePage: false
},
loading: false,
file: "",
loading:false,
file:"",
search: {
reportNumber: "",
date: "",
reportNumber:"",
date:""
},
params: {
currentProcess: currentProcess
},
isFirst: currentProcess == 'jiya',
apiObj: this.$API[module.name][module.list],
apiObj:this.$API[module.name][module.list],
selection: [],
config: module.config,
options: module.options,
column: module.column,
currentProcessItem: {
options: { group: "working", placeholder: "当前工序" },
},
};
},
watch: {
params: {
handler() {
this.$refs.table.upData()
},
deep: true
column: module.column
}
},
created() {
mounted(){
},
methods: {
//
importExcel() {
this.dialog.importExcel = true;
importExcel(){
this.dialog.importExcel = true
this.$nextTick(() => {
this.$refs.importExcelDialog.open();
});
this.$refs.importExcelDialog.open()
})
},
//
handleReset() {
console.log("handleReset method called");
handleReset(){
console.log('handleReset method called');
// 1.
this.search = {};
var search = {
email: "",
var search = {
email: ""
}; // {}
// 2.
@ -194,81 +106,79 @@ export default {
}
},
//
add() {
this.dialog.save = true;
add(){
this.dialog.save = true
this.$nextTick(() => {
this.$refs.saveDialog.open("add", this.list);
});
this.$refs.saveDialog.open('add', this.list)
})
},
page_add() {
this.dialog.savePage = true;
this.dialog.savePage = true
this.$nextTick(() => {
this.$refs.savePage.open("add");
});
this.$refs.savePage.open('add')
})
},
//
finish(row) {
this.dialog.finish = true;
finish(row){
this.dialog.finish = true
this.$nextTick(() => {
this.$refs.finishDialog.open("add", this.list).setData(row);
});
this.$refs.finishDialog.open('add', this.list).setData(row)
})
},
//
table_edit(row) {
this.dialog.save = true;
table_edit(row){
this.dialog.save = true
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)
});
})
},
show_info(row) {
this.dialog.info = true;
show_info(row){
this.dialog.info = true
this.$nextTick(() => {
this.$refs.infoDialog.open().setData(row);
});
this.$refs.infoDialog.open().setData(row)
})
},
//
async table_del(row, index) {
var reqData = { id: row[this.config.preId ? this.config.preId : "id"] };
async table_del(row, index){
var reqData = {id: row[this.config.preId?this.config.preId:"id"]}
var res = await this.$API[module.name][module.del].http(reqData);
if (res.code == 0) {
if(res.code == 0){
// OR /
this.$refs.table.upData();
this.$message.success("删除成功");
} else {
this.$alert(res.message, "提示", { type: "error" });
}else{
this.$alert(res.message, "提示", {type: 'error'})
}
},
//
async batch_del() {
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, "提示", {
type: "warning",
})
.then(async () => {
const loading = this.$loading();
console.log(this.selection);
var idArr = [];
this.selection.forEach((item) => {
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();
async batch_del(){
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
type: 'warning'
}).then(async () => {
const loading = this.$loading();
console.log(this.selection)
var idArr = [];
this.selection.forEach(item => {
idArr.push(item[this.config.preId?this.config.preId:"id"])
})
.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;
},
filterChange(obj) {
@ -276,20 +186,20 @@ export default {
this.upsearch();
},
//
upsearch() {
upsearch(){
this.$refs.table.upData(this.search);
},
//
handleSuccess(data, mode) {
this.$refs.table.upData();
handleSuccess(data, mode){
this.$refs.table.upData()
},
},
};
}
}
</script>
<style>
.upload {
color: #409eff;
color: #409EFF;
background: #ecf5ff;
min-height: 32px;
padding: 9px 15px;
@ -301,4 +211,5 @@ export default {
.sc-upload-uploader {
border: none !important;
}
</style>

@ -1,21 +1,13 @@
<template>
<el-dialog
title="查看"
v-model="visible"
:width="panelWidth"
destroy-on-close
@closed="$emit('closed')"
title="查看"
v-model="visible"
:width="panelWidth"
destroy-on-close
@closed="$emit('closed')"
>
<ex-desc v-model="descData" :descProps="descProps" :descInfo="descInfo">
<template #actualWeight="{ item }">
<span>{{ dealData("actualWeight") }}</span>
</template>
<template #scrapWeight="{ item }">
<span>{{ dealData("scrapWeight") }}</span>
</template>
<template #theoreticalWeight="{ item }">
<span>{{ dealData("theoreticalWeight") }}</span>
</template>
</ex-desc>
</el-dialog>
</template>
@ -27,7 +19,7 @@ export default {
data() {
return {
mode: "add",
panelWidth: module.infoOption.panelWidth || "500",
panelWidth:module.infoOption.panelWidth || "500",
visible: false,
isSaveing: false,
loading: false,
@ -38,7 +30,8 @@ export default {
descData: {},
};
},
mounted() {},
mounted() {
},
methods: {
//
open() {
@ -48,31 +41,7 @@ export default {
//
setData(data) {
//
Object.assign(this.descData, data);
},
dealData(key) {
switch (key) {
case "actualWeight":
return (
Number(this.descData["productionWeight"]) *
Number(this.descData["productionLength"]) *
Number(this.descData["productionNumber"])
);
case "scrapWeight":
return (
Number(this.descData["productionWeight"]) *
Number(this.descData["productionLength"]) *
Number(this.descData["scrapNumber"])
);
case "theoreticalWeight":
return (
Number(this.descData["weight"]) *
Number(this.descData["productionLength"]) *
Number(this.descData["productionNumber"])
);
default:
return "";
}
Object.assign(this.descData, data)
},
},
};

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

@ -1,3 +1,6 @@
import $API from '@/api'
import $CONFIG from '@/config'
export default {
name: "processReport",
dec: "工序报工",
@ -27,21 +30,6 @@ export default {
{ label: "", prop: "id", width: "200", hide: true },
{ label: "报工单号", prop: "reportNumber", width: "200" },
{ label: "机台", prop: "machine", width: "200" },
{ label: "销售订单编码", prop: "salesOrderCode", width: "200" },
{ label: "挤压排产编码", prop: "scheduleNumber", width: "200" },
{ label: "产品代码", prop: "materialCode", width: "200" },
{ label: "型材型号", prop: "profileModel", width: "200" },
{ label: "物料名称", prop: "materialName", width: "200" },
{ label: "规格型号", prop: "specification", width: "200" },
{ label: "壁厚", prop: "thickness", width: "200" },
{ label: "米重", prop: "weight", width: "200" },
{ label: "订单长度M", prop: "orderLength", width: "200" },
{ label: "表面方式", prop: "surfaceMethod", width: "200" },
{ label: "订单总数", prop: "orderTotalQuantity", width: "200" },
{ label: "排产长度(m)", prop: "productionLength", width: "200" },
{ label: "排产支数", prop: "productionPieces", width: "200" },
{ label: "锯切方式", prop: "sawingMethod", width: "200" },
{ label: "交货日期", prop: "deliveryDate", width: "200" },
{ label: "操作员", prop: "operator", width: "200" },
{ label: "车间", prop: "workshop", width: "200" },
{
@ -66,64 +54,24 @@ export default {
},
items: [
{
label: "来料支数", name: "sourceNumber", value: "", component: "", span: 1,
hideHandle: "$.currentProcess == 'jiya'"
},
{
label: "实收支数", name: "netReceipts", value: "", component: "", span: 1,
hideHandle: "$.currentProcess == 'jiya'"
},
{
label: "生产支数", name: "productionNumber", value: "", component: "", span: 1,
label: "完成数量", name: "productionNumber", value: "", component: "", span: 1,
},
{
label: "实际米重", name: "productionWeight", value: "", component: "", span: 1,
},
{
label: "实际总重量(KG)", name: "actualWeight", value: "", component: "other", span: 1,
label: "完成重量", name: "productionWeight", value: "", component: "ther", span: 1,
},
{ label: "报废支数", name: "scrapNumber", value: "", component: "", span: 1 },
{
label: "报废重量(KG)", name: "scrapWeight", value: "", component: "other", span: 1,
},
{ label: "报废原因", name: "scrapReason", value: "", component: "", span: 1 },
{
label: "理论重量(KG)", name: "theoreticalWeight", value: "", component: "other", span: 1,
},
{ label: "框号", name: "frameNumber", value: "", component: "", span: 1 },
{ label: "模具编码", name: "moldCode", value: "", component: "", span: 1,
hideHandle: "$.currentProcess != 'jiya' && $.currentProcess != 'jingpin'"
},
{ label: "模具型号", name: "moldModel", value: "", component: "", span: 1,
hideHandle: "$.currentProcess != 'jiya' && $.currentProcess != 'jingpin'"
},
{ label: "模厚", name: "moldThickness", value: "", component: "", span: 1,
hideHandle: "$.currentProcess != 'jiya' && $.currentProcess != 'jingpin'"
},
{ label: "模具厂家", name: "moldManufacturer", value: "", component: "", span: 1,
hideHandle: "$.currentProcess != 'jiya' && $.currentProcess != 'jingpin'"
},
{ label: "颜色", name: "moldColor", value: "", component: "", span: 1,
hideHandle: "$.currentProcess != 'jiya' && $.currentProcess != 'jingpin'"
},
{ label: "换模原因", name: "moldChangeReason", value: "", component: "", span: 1,
hideHandle: "$.currentProcess != 'jiya' && $.currentProcess != 'jingpin'"
},
{ label: "用棒支数", name: "rodCount", value: "", component: "", span: 1,
hideHandle: "$.currentProcess != 'jiya' && $.currentProcess != 'jingpin'"
},
{
label: "当前工序", name: "currentProcess", value: "", component: "dic", group: "working", span: 1,
},
{
label: "下一工序", name: "nextProcess", value: "", component: "dic", group: "working", span: 1,
hideHandle: "$.isCompleted == true"
hideHandle: "$.currentProcess == 'bz'"
},
{
label: "是否完成", name: "isCompleted", value: "", component: "", span: 1,
// hideHandle: "$.currentProcess != 'bz'",
hideHandle: "$.currentProcess != 'bz'",
format(value) {
switch (value + "") {
case "1":
@ -145,20 +93,14 @@ export default {
size: 'medium',
formItems: [
{
label: "实收支数", name: "netReceipts", value: "", component: "other", span: 24,
options: { maxlength: "256", placeholder: "请输入实收支数" },
rules: [{ required: true, message: "请输入实收支数", trigger: "blur" }],
hideHandle: "$.currentProcess == 'jiya'"
},
{
label: "生产支数", name: "productionNumber", value: "", component: "other", span: 24,
options: { maxlength: "256", placeholder: "请输入生产支数" },
rules: [{ required: true, message: "请输入生产支数", trigger: "blur" }]
label: "完成数量", name: "productionNumber", value: "", component: "other", span: 24,
options: { maxlength: "256", placeholder: "请输入完成数量" },
rules: [{ required: true, message: "请输入完成数量", trigger: "blur" }]
},
{
label: "实际米重", name: "productionWeight", value: "", component: "other", span: 24,
options: { maxlength: "256", placeholder: "请输入实际米重" },
rules: [{ required: true, message: "请输入实际米重", trigger: "blur" }]
label: "完成重量", name: "productionWeight", value: "", component: "other", span: 24,
options: { maxlength: "256", placeholder: "请输入完成重量" },
rules: [{ required: true, message: "请输入完成重量", trigger: "blur" }]
},
{ label: "报废支数", name: "scrapNumber", value: "", component: "other", span: 24, options: { maxlength: "256", placeholder: "请输入报废支数" }, rules: [{ required: false, message: "请输入报废支数", trigger: "blur" }] },
{ label: "报废原因", name: "scrapReason", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入报废原因" }, rules: [{ required: false, message: "请输入报废原因", trigger: "blur" }] },
@ -167,11 +109,10 @@ export default {
label: "下一工序", name: "nextProcess", value: "", component: "dic", span: 24,
options: { group: "working", placeholder: "请输入下一工序" },
rules: [{ required: true, message: "请输入下一工序", trigger: "blur" }],
// hideHandle: "$.currentProcess == 'bz'"
hideHandle: "$.isCompleted == true"
hideHandle: "$.currentProcess == 'bz'"
},
{
label: "是否完成", name: "isCompleted", value: 0, component: "select",
label: "是否完成", name: "isCompleted", value: 1, component: "select",
span: 24,
options: {
multiple: false,
@ -187,11 +128,27 @@ export default {
]
},
rules: [{ required: false, message: "请选择", trigger: "blur" }],
// hideHandle: "$.currentProcess != 'bz'"
hideHandle: "$.currentProcess != 'bz'"
},
{ label: "备注", name: "remarks", value: "", component: "textarea", span: 24, options: { maxlength: "500", placeholder: "请输入备注" } }
]
},
finishFormOption: {
labelWidth: '100px',
labelPosition: 'center',
panelWidth: "800",
size: 'medium',
formItems: [
{ label: "完成数量", name: "completionQuantity", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入完成数量" }, rules: [{ required: true, message: "请输入完成数量", trigger: "blur" }] },
{ label: "完成重量", name: "completionWeight", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入完成重量" }, rules: [{ required: true, message: "请输入完成重量", trigger: "blur" }] },
{ label: "报废支数", name: "scrapPieces", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入报废支数" }, rules: [{ required: false, message: "请输入报废支数", trigger: "blur" }] },
{ label: "报废原因", name: "scrapReason", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入报废原因" }, rules: [{ required: false, message: "请输入报废原因", trigger: "blur" }] },
{ label: "框号", name: "frameNumber", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入框号" }, rules: [{ required: false, message: "请输入框号", trigger: "blur" }] },
{ label: "下一工序", name: "nextProcess", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入下一工序" }, rules: [{ required: false, message: "请输入下一工序", trigger: "blur" }] },
{ label: "是否完成", name: "isCompleted", value: "", component: "input", span: 24, options: { maxlength: "256", placeholder: "请输入是否完成" }, rules: [{ required: false, message: "请输入是否完成", trigger: "blur" }] },
{ label: "备注", name: "remarks", value: "", component: "textarea", span: 24, options: { maxlength: "500", placeholder: "请输入备注" } }
]
},
pageForm: {
title: "工序报工",
form: {
@ -221,11 +178,11 @@ export default {
options: { valueFormat: "YYYY-MM-DD", placeholder: "请选择采购日期" },
rules: [{ required: true, message: "请选择采购日期", trigger: "change" }]
},
// {
// label: "当前工序", name: "currentProcess", value: "", component: "dic", span: 6,
// options: { group: "working" },
// rules: [{ required: true, message: "请选择当前工序", trigger: "change" }]
// },
{
label: "当前工序", name: "currentProcess", value: "", component: "dic", span: 6,
options: { group: "working" },
rules: [{ required: true, message: "请选择当前工序", trigger: "change" }]
},
{ label: "备注", name: "remarks", value: "", component: "textarea", span: 24, options: { maxlength: "500", placeholder: "请输入备注" } },
]
},
@ -261,13 +218,6 @@ export default {
{ label: "生产支数", prop: "productionPieces", width: "200" },
{ label: "锯切方式", prop: "sawingMethod", width: "200" },
{ label: "生产理论重量", prop: "productionWeight", width: "200" },
{ label: "模具编码", prop: "moldCode", width: "200" },
{ label: "模具型号", prop: "moldModel", width: "200" },
{ label: "模厚", prop: "moldThickness", width: "200" },
{ label: "模具厂家", prop: "moldManufacturer", width: "200" },
{ label: "颜色", prop: "moldColor", width: "200" },
{ label: "换模原因", prop: "moldChangeReason", width: "200" },
{ label: "用棒支数", prop: "rodCount", width: "200" },
]
},
tableSelect: {

@ -7,17 +7,6 @@
@closed="$emit('closed')"
>
<sc-form ref="formref" :config="config" v-model="form" :loading="loading" :formMode="mode" @submit="submit">
<!-- 入库数量 -->
<template #netReceipts>
<el-input-number
v-model="form.netReceipts"
:step="1"
:min="0"
:precision="0"
:controls="true"
></el-input-number>
</template>
<!-- 入库数量 -->
<template #productionNumber>
<el-input-number

@ -87,34 +87,6 @@
<span v-else>{{ scoped.row.inventoryQuantity }}</span>
</div>
</template>
<!-- 模具编码 -->
<template #moldCode="scoped">
<el-input v-model="scoped.row['moldCode']" placeholder=""></el-input>
</template>
<!-- 模具型号 -->
<template #moldModel="scoped">
<el-input v-model="scoped.row['moldModel']" placeholder=""></el-input>
</template>
<!-- 模厚 -->
<template #moldThickness="scoped">
<el-input v-model="scoped.row['moldThickness']" placeholder=""></el-input>
</template>
<!-- 模具厂家 -->
<template #moldManufacturer="scoped">
<el-input v-model="scoped.row['moldManufacturer']" placeholder=""></el-input>
</template>
<!-- 颜色 -->
<template #moldColor="scoped">
<el-input v-model="scoped.row['moldColor']" placeholder=""></el-input>
</template>
<!-- 换模原因 -->
<template #moldChangeReason="scoped">
<el-input v-model="scoped.row['moldChangeReason']" placeholder=""></el-input>
</template>
<!-- 用棒支数 -->
<template #rodCount="scoped">
<el-input v-model="scoped.row['rodCount']" placeholder=""></el-input>
</template>
</scTable>
</el-card>
</el-main>
@ -129,6 +101,8 @@
</template>
<script>
import useTabs from "@/utils/useTabs";
import module from "./module";
import materialsSelect from "./materialsSelect";
@ -304,6 +278,12 @@ export default {
}
},
back() {
// useTabs.closeNext((tags) => {
// //'/usercenter'
// console.log(tags);
// this.$router.push(this.path);
// this.$route.is = true;
// });
this.visible = false;
},
save() {

@ -7,20 +7,25 @@
<div class="right-panel-search">
<el-input
v-model="search.documentNumber"
placeholder="计划单号"
v-model="search.orderNumber"
placeholder="排产单号"
clearable>
</el-input>
<el-input
v-model="search.salesOrderCode"
placeholder="销售单号"
v-model="search.salesOrderNumber"
placeholder="单号"
clearable>
</el-input>
<el-input
v-model="search.materialCode"
v-model="search.productCode"
placeholder="产品编码"
clearable>
</el-input>
<el-input
v-model="search.customerPartNumber"
placeholder="客方料号"
clearable>
</el-input>
<el-date-picker
v-model="search.deliveryDate"
type="date"
@ -39,8 +44,8 @@
<el-table-column label="操作" fixed="right" align="center" width="120" v-if="config.option">
<template #default="scope">
<el-button type="text" size="medium" @click="table_edit(scope.row, scope.$index)" v-if="config.option.edit && scope.row.planStatus == 0"></el-button>
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)" v-if="config.option.del && scope.row.planStatus == 0">
<el-button type="text" size="medium" @click="table_edit(scope.row, scope.$index)" v-if="config.option.edit"></el-button>
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)" v-if="config.option.del">
<template #reference>
<el-button type="text" size="medium">删除</el-button>
</template>

@ -142,7 +142,6 @@ export default {
},
column2: [
{ label: "", prop: "id", width: "200", hide: true },
{ label: "订单号", prop: "orderNo", width: "200" },
{ label: "物料编码", prop: "materialCode", width: "200" },
{ label: "物料名称", prop: "materialName", width: "200" },
{ label: "订单长度 (M)", prop: "orderLength", width: "200" },

@ -1,74 +1,32 @@
<template>
<el-container style="position: relative">
<el-container style="position: relative;">
<el-header>
<div class="left-panel">
<!-- <el-button type="primary" icon="el-icon-plus" @click="add"></el-button> -->
<el-button
type="primary"
icon="el-icon-plus"
@click="page_add"
></el-button>
<el-button
type="danger"
v-if="config && config.bathDel"
@click="batch_del"
>删除</el-button
>
<el-button type="primary" icon="el-icon-plus" @click="page_add"></el-button>
<el-button type="danger" v-if="config && config.bathDel" @click="batch_del"></el-button>
</div>
<div class="right-panel-search">
<el-input
v-model="search.documentNumber"
placeholder="单据编号"
clearable
>
v-model="search.documentNumber"
placeholder="单据编号"
clearable>
</el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="upsearch"
></el-button>
<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
:column="column"
:remoteFilter="config.remoteFilter"
row-key=""
@selection-change="selectionChange"
>
<scTable 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
label="操作"
fixed="right"
align="center"
width="200"
v-if="config.option"
>
<el-table-column label="操作" fixed="right" align="center" width="120" v-if="config.option">
<template #default="scope">
<!-- <el-button type="text" size="medium" @click="table_edit(scope.row, scope.$index)" v-if="config.option.edit"></el-button> -->
<el-button
type="text"
size="medium"
@click="page_edit(scope.row)"
v-if="config.option.edit && scope.row.noEdit == 0"
>编辑</el-button
>
<el-button
type="text"
size="medium"
@click="once_add_plan(scope.row)"
v-if="config.option.edit && scope.row.noEdit == 0"
>生成计划单</el-button
>
<el-popconfirm
title="确定删除吗?"
@confirm="table_del(scope.row, scope.$index)"
v-if="config.option.del && scope.row.noEdit == 0"
>
<el-button type="text" size="medium" @click="page_edit(scope.row)" v-if="config.option.edit && scope.row.isWarehouse != 1"></el-button>
<el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)" v-if="config.option.del && scope.row.isWarehouse != 1">
<template #reference>
<el-button type="text" size="medium">删除</el-button>
</template>
@ -77,62 +35,59 @@
</el-table-column>
</scTable>
</el-main>
<save-page
ref="savePage"
v-if="dialog.savePage"
@closed="dialog.savePage = false"
@success="handleSuccess"
></save-page>
<save-page ref="savePage" v-if="dialog.savePage" @closed="dialog.savePage = false" @success="handleSuccess"></save-page>
</el-container>
</template>
<script>
import module from "./module";
import config from "@/config";
import module from './module'
import config from "@/config"
import savePage from "./savePage";
import savePage from './savePage'
export default {
components: {
savePage,
savePage
},
data() {
return {
dialog: {
save: false,
product: false,
savePage: false,
savePage: false
},
loading: false,
file: "",
loading:false,
file:"",
search: {
documentNumber: "",
documentNumber: ""
},
apiObj: this.$API[module.name][module.list],
apiObj:this.$API[module.name][module.list],
selection: [],
config: module.config,
options: module.options,
column: module.column,
};
column: module.column
}
},
mounted(){
},
mounted() {},
methods: {
//
importExcel() {
this.dialog.importExcel = true;
importExcel(){
this.dialog.importExcel = true
this.$nextTick(() => {
this.$refs.importExcelDialog.open();
});
this.$refs.importExcelDialog.open()
})
},
//
handleReset() {
console.log("handleReset method called");
handleReset(){
console.log('handleReset method called');
// 1.
this.search = {};
var search = {
email: "",
var search = {
email: ""
}; // {}
// 2.
@ -142,117 +97,94 @@ export default {
}
},
//
add() {
add(){
// this.dialog.save = true
this.dialog.product = true;
this.dialog.product = true
this.$nextTick(() => {
this.$refs.productMaterialsDialog.open("add", this.list);
this.$refs.productMaterialsDialog.open('add', this.list)
// this.$refs.saveDialog.open('add', this.list)
});
})
},
page_add() {
// this.$router.push({
// path: '/mini/procurement/purchaseOrders/savePage',
// this.$router.push({
// path: '/mini/procurement/purchaseOrders/savePage',
// query: {
// path: '/mini/procurement/purchaseOrders',
// }
// })
this.dialog.savePage = true;
// }
// })
this.dialog.savePage = true
this.$nextTick(() => {
this.$refs.savePage.open("add");
this.$refs.savePage.open('add')
// this.$refs.saveDialog.open('add', this.list)
});
})
},
page_edit(row) {
// this.$router.push({
// path: '/mini/procurement/purchaseOrders/savePage',
// path: '/mini/procurement/purchaseOrders/savePage',
// query: {
// path: '/mini/procurement/purchaseOrders',
// id: row.documentNumber
// }
// })
this.dialog.savePage = true;
// }
// })
this.dialog.savePage = true
this.$nextTick(() => {
this.$refs.savePage.open("edit").setData(row);
this.$refs.savePage.open('edit').setData(row);
// this.$refs.saveDialog.open('add', this.list)
});
},
//
async once_add_plan(row) {
const loading = this.$loading();
var reqData = {
type: "once",
orderInfo: row,
form: {
isAuto: true,
},
};
var res = await this.$API.productionSchedule.save.http(reqData);
if (res.code == 0) {
this.$refs.table.refresh();
this.$message.success("计划单生成成功");
} else {
this.$alert(res.message, "提示", { type: "error" });
}
loading.close();
})
},
//
table_edit(row) {
this.dialog.product = true;
table_edit(row){
this.dialog.product = true
this.$nextTick(() => {
this.$refs.productMaterialsDialog.open("edit", this.list).setData(row);
this.$refs.productMaterialsDialog.open('edit', this.list).setData(row)
// this.$refs.saveDialog.open('edit', this.list).setData(row)
});
})
},
//
async table_del(row, index) {
var reqData = { id: row[this.config.delId ? this.config.delId : "id"] };
async table_del(row, index){
var reqData = {id: row[this.config.delId?this.config.delId:"id"]}
var res = await this.$API[module.name][module.del].http(reqData);
if (res.code == 0) {
if(res.code == 0){
// OR /
this.$refs.table.upData();
this.$message.success("删除成功");
} else {
this.$alert(res.message, "提示", { type: "error" });
}else{
this.$alert(res.message, "提示", {type: 'error'})
}
},
//
async batch_del() {
async batch_del(){
if (this.selection.length == 0) {
this.$alert("请选择需要删除的数据", "提示", { type: "warning" });
this.$alert("请选择需要删除的数据", "提示", {type: 'warning'})
return;
}
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, "提示", {
type: "warning",
})
.then(async () => {
const loading = this.$loading();
console.log(this.selection);
var idArr = [];
this.selection.forEach((item) => {
idArr.push(item[this.config.delId ? this.config.delId : "id"]);
});
var reqData = { type: "batch", 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();
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?`, '提示', {
type: 'warning'
}).then(async () => {
const loading = this.$loading();
console.log(this.selection)
var idArr = [];
this.selection.forEach(item => {
idArr.push(item[this.config.delId?this.config.delId:"id"])
})
.catch(() => {
this.$message.success("操作失败");
});
var reqData = {type: "batch", 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;
},
filterChange(obj) {
@ -260,20 +192,20 @@ export default {
this.upsearch();
},
//
upsearch() {
upsearch(){
this.$refs.table.upData(this.search);
},
//
handleSuccess(data, mode) {
this.$refs.table.upData();
handleSuccess(data, mode){
this.$refs.table.upData()
},
},
};
}
}
</script>
<style lang="less" scoped>
.upload {
color: #409eff;
color: #409EFF;
background: #ecf5ff;
min-height: 32px;
padding: 9px 15px;

@ -4,7 +4,6 @@
v-model="visible"
:width="panelWidth"
destroy-on-close
:append-to-body="true"
@closed="$emit('closed')"
>
<el-container>
@ -110,8 +109,7 @@ export default {
return this;
},
setData(listData) {
// this.listData = listData;
this.listData = [];
this.listData = listData;
},
selectable(row, index) {
return !this.listData.some(item => row.materialCode == item.materialCode)
@ -132,8 +130,5 @@ export default {
};
</script>
<style lang="less" scoped>
.el-dialog__header {
padding: 20px 20px 10px;
}
<style>
</style>

@ -181,11 +181,13 @@ export default {
},
'form.customerId': {
handler(value, old) {
console.log('form.customerId', value)
const formItems = module.pageForm.form.formItems
const fields = formItems.filter(item => {
return item.name == 'customerId'
})[0]
const items = fields.options.items
console.log(fields)
if (!!items) {
const curObj = items.filter(item => {
return item.value == value
@ -199,6 +201,7 @@ export default {
},
listData: {
handler(newVal) {
console.log(this.form)
newVal.forEach((item) => {
/* 理论支重 */
item["theoreticalWeightPerPiece"] = parseFloat(
@ -237,6 +240,7 @@ export default {
);
/* 含税单价 */
console.log("item", item)
item["priceWithTax"] = parseFloat(
(Number(item["unitPrice"]) +
parseFloat(
@ -306,29 +310,17 @@ export default {
});
},
delete_materials() {
this.listData = this.listData.filter(
(item1) =>
!this.selection.some(
(item2) => item2.curIndex === item1.curIndex
(item2) => item2.materialCode === item1.materialCode
)
);
let curIndex = 0;
this.listData.forEach((item) => {
curIndex = curIndex + 1
item['curIndex'] = curIndex;
});
this.selection = [];
},
handleSuccess(data) {
const _this = this;
let curIndex = this.listData.length
data.forEach((item) => {
curIndex = curIndex + 1
item['curIndex'] = curIndex;
for (let key in _this.initComputed) {
if (!item[key]) {
item[key] = _this.initComputed[key];
@ -336,7 +328,6 @@ export default {
}
});
this.listData = [...data, ...this.listData];
console.log("this.listData", this.listData)
},
async queryInventoryQuantity(row) {
//
@ -352,6 +343,7 @@ export default {
back() {
// useTabs.closeNext((tags) => {
// //'/usercenter'
// console.log(tags);
// this.$router.push(this.path);
// this.$route.is = true;
// });
@ -369,6 +361,7 @@ export default {
materials: this.listData,
orderInfo: this.form,
};
console.log(params);
var res = null;
if (this.mode == "edit") {

@ -166,7 +166,6 @@ export default {
},
column2: [
{ label: "", prop: "id", width: "200", hide: true },
{ label: "订单号", prop: "orderNo", width: "200" },
{ label: "物料编码", prop: "materialCode", width: "200" },
{ label: "物料名称", prop: "materialName", width: "200" },
{ label: "订单长度 (M)", prop: "orderLength", width: "200" },

@ -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…
Cancel
Save