add:排产相关功能。 rev:修改工单管理,销售订单管理,工厂日历功能;
add:排产相关功能。 rev:修改工单管理,销售订单管理,工厂日历功能;
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package org.nl.common.domain.query;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public class ColaBeanUtils extends BeanUtils {
|
||||
public static <S, T> List<T> copyListProperties(List<S> sources, Supplier<T> target) {
|
||||
return copyListProperties(sources, target, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author Johnson
|
||||
* 使用场景:Entity、Bo、Vo层数据的复制,因为BeanUtils.copyProperties只能给目标对象的属性赋值,却不能在List集合下循环赋值,因此添加该方法
|
||||
* 如:List<AdminEntity> 赋值到 List<AdminVo> ,List<AdminVo>中的 AdminVo 属性都会被赋予到值
|
||||
* S: 数据源类 ,T: 目标类::new(eg: AdminVo::new)
|
||||
*/
|
||||
public static <S, T> List<T> copyListProperties(List<S> sources, Supplier<T> target, ColaBeanUtilsCallBack<S, T> callBack) {
|
||||
List<T> list = new ArrayList<>(sources.size());
|
||||
for (S source : sources) {
|
||||
T t = target.get();
|
||||
copyProperties(source, t);
|
||||
if (callBack != null) {
|
||||
// 回调
|
||||
callBack.callBack(source, t);
|
||||
}
|
||||
list.add(t);
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package org.nl.common.domain.query;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface ColaBeanUtilsCallBack<S, T> {
|
||||
void callBack(S t, T s);
|
||||
}
|
||||
@@ -72,6 +72,7 @@ public enum StatusEnum {
|
||||
// 1-PC创建、2-Excel导入
|
||||
PCINTO("1","PC创建", "",null),
|
||||
EXCELINTO("2","EXCEL导入", "2",null),
|
||||
APSINTO("3","APS导入", "3",null),
|
||||
// 1白班、2夜班
|
||||
DAYSHIFT("1","白班", "1",null),
|
||||
NIGHTSHIFT("2","夜班", "2",null);
|
||||
|
||||
@@ -17,6 +17,7 @@ package org.nl.config.thread;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.AsyncConfigurer;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
@@ -26,14 +27,16 @@ import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
/**
|
||||
* 异步任务线程池装配类
|
||||
*
|
||||
* @author https://juejin.im/entry/5abb8f6951882555677e9da2
|
||||
* @date 2019年10月31日15:06:18
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
public class AsyncTaskExecutePool implements AsyncConfigurer {
|
||||
|
||||
/** 注入配置类 */
|
||||
public class AsyncTaskExecutePool implements AsyncConfigurer{
|
||||
/**
|
||||
* 注入配置类
|
||||
*/
|
||||
private final AsyncTaskProperties config;
|
||||
|
||||
public AsyncTaskExecutePool(AsyncTaskProperties config) {
|
||||
@@ -60,11 +63,40 @@ public class AsyncTaskExecutePool implements AsyncConfigurer {
|
||||
return executor;
|
||||
}
|
||||
|
||||
/**
|
||||
* 线程池配置
|
||||
* @return java.util.concurrent.Executor
|
||||
* @author gbx
|
||||
* @since 2023-06-16
|
||||
*/
|
||||
@Bean(name = "taskExecutor")
|
||||
public ThreadPoolTaskExecutor threadPoolTaskExecutor() {
|
||||
ThreadPoolTaskExecutor threadPoolTaskExecutor = new ThreadPoolTaskExecutor();
|
||||
// 核心线程池大小
|
||||
threadPoolTaskExecutor.setCorePoolSize(config.getCorePoolSize());
|
||||
// 最大线程数
|
||||
threadPoolTaskExecutor.setMaxPoolSize(config.getMaxPoolSize());
|
||||
// 队列容量
|
||||
threadPoolTaskExecutor.setQueueCapacity(config.getQueueCapacity());
|
||||
// 活跃时间
|
||||
threadPoolTaskExecutor.setKeepAliveSeconds(config.getKeepAliveSeconds());
|
||||
// 主线程等待子线程执行时间
|
||||
threadPoolTaskExecutor.setAwaitTerminationSeconds(30);
|
||||
// 线程名字前缀
|
||||
threadPoolTaskExecutor.setThreadNamePrefix("test-thread-");
|
||||
// RejectedExecutionHandler:当pool已经达到max-size的时候,如何处理新任务
|
||||
// CallerRunsPolicy:不在新线程中执行任务,而是由调用者所在的线程来执行
|
||||
threadPoolTaskExecutor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
|
||||
// 初始化
|
||||
threadPoolTaskExecutor.initialize();
|
||||
return threadPoolTaskExecutor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
|
||||
return (throwable, method, objects) -> {
|
||||
log.error("===="+throwable.getMessage()+"====", throwable);
|
||||
log.error("exception method:"+method.getName());
|
||||
log.error("====" + throwable.getMessage() + "====", throwable);
|
||||
log.error("exception method:" + method.getName());
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package org.nl.modules.schedule;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.mps_manage.ordermanage.service.saleOrder.IMpsSaleOrderService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* Aps排产相关定时任务
|
||||
*
|
||||
* @author gbx
|
||||
* @since 2023-06-16
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
@EnableScheduling
|
||||
public class ApsSchedule{
|
||||
@Autowired
|
||||
private IMpsSaleOrderService iMpsSaleOrderService;
|
||||
|
||||
@Async("taskExecutor")
|
||||
//@Scheduled(cron = "0/30 * * * * *")
|
||||
public void setApsStatus() {
|
||||
long start = System.currentTimeMillis();
|
||||
long end = System.currentTimeMillis();
|
||||
//log.info("定时同步Aps排产信息完毕,耗时{}!", end - start);
|
||||
}
|
||||
}
|
||||
@@ -126,8 +126,8 @@ public class MdPbClassstandardServiceImpl extends ServiceImpl<MdPbClassstandardM
|
||||
if (ObjectUtil.isNotEmpty(whereJson.get("parent_class_id"))) {
|
||||
query.eq("parent_class_id",whereJson.get("parent_class_id"));
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(whereJson.get("class_idStr"))) {
|
||||
query.in("class_id",whereJson.get("class_idStr"));
|
||||
if(ObjectUtil.isNotEmpty(whereJson.get("class_idStr"))) {
|
||||
query.last("and class_id in (" + whereJson.get("class_idStr") + ")");
|
||||
}
|
||||
List<Map<String, Object>> list = this.listMaps(query);
|
||||
return getMaps(list);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.nl.wms.mps_manage.ordermanage.controller.saleOrder;
|
||||
|
||||
|
||||
import cn.dev33.satoken.annotation.SaIgnore;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -12,9 +13,10 @@ import org.nl.wms.mps_manage.ordermanage.service.saleOrder.dto.OrderQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -28,6 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "生产订单")
|
||||
@Slf4j
|
||||
@SaIgnore
|
||||
@RequestMapping("/api/mpsSaleOrder")
|
||||
public class MpsSaleOrderController {
|
||||
|
||||
@@ -41,5 +44,16 @@ public class MpsSaleOrderController {
|
||||
return new ResponseEntity<>(iMpsSaleOrderService.pageQuery(query,page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/excelImport")
|
||||
@Log("excel导入")
|
||||
@ApiOperation("excel导入")
|
||||
public ResponseEntity<Object> excelImport(@RequestParam("file") MultipartFile file, HttpServletRequest request) {
|
||||
iMpsSaleOrderService.excelImport(file,request);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,9 @@ import org.nl.common.domain.query.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.nl.wms.mps_manage.ordermanage.service.saleOrder.dao.MpsSaleOrder;
|
||||
import org.nl.wms.mps_manage.ordermanage.service.saleOrder.dto.OrderQuery;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -27,4 +30,13 @@ public interface IMpsSaleOrderService extends IService<MpsSaleOrder> {
|
||||
Object pageQuery(OrderQuery query, PageQuery page);
|
||||
|
||||
List<Map> getPdaMaterial(JSONObject json);
|
||||
|
||||
|
||||
/**
|
||||
* excel导入
|
||||
* @param file
|
||||
* @param request
|
||||
*/
|
||||
void excelImport(MultipartFile file, HttpServletRequest request);
|
||||
|
||||
}
|
||||
|
||||
@@ -2,9 +2,14 @@ package org.nl.wms.mps_manage.ordermanage.service.saleOrder.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import jdk.nashorn.internal.ir.annotations.Ignore;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@@ -19,150 +24,146 @@ import lombok.EqualsAndHashCode;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("mps_sale_order")
|
||||
public class MpsSaleOrder implements Serializable {
|
||||
|
||||
public class MpsSaleOrder implements Serializable{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 销售单标识
|
||||
*/
|
||||
@TableId
|
||||
private String sale_id;
|
||||
|
||||
private Long sale_id;
|
||||
/**
|
||||
* 销售单号
|
||||
*/
|
||||
private String sale_code;
|
||||
|
||||
/**
|
||||
* 明细序号
|
||||
*/
|
||||
private BigDecimal seq_no;
|
||||
|
||||
/**
|
||||
* aps映射订单编码
|
||||
*/
|
||||
private String aps_sale_code;
|
||||
/**
|
||||
* aps映射订单类型
|
||||
*/
|
||||
private String aps_sale_type;
|
||||
/**
|
||||
* aps映射订单状态
|
||||
*/
|
||||
private String aps_status;
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String material_code;
|
||||
/**
|
||||
* 销售单类型
|
||||
*/
|
||||
private String sale_type;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 销售数量
|
||||
*/
|
||||
private BigDecimal sale_qty;
|
||||
|
||||
/**
|
||||
* 生产顺序
|
||||
*/
|
||||
private BigDecimal produce_seq;
|
||||
|
||||
/**
|
||||
* 客户标识
|
||||
*/
|
||||
private String cust_id;
|
||||
|
||||
private Long cust_id;
|
||||
/**
|
||||
* 客户编码
|
||||
*/
|
||||
private String cust_code;
|
||||
|
||||
/**
|
||||
* 客户名称
|
||||
*/
|
||||
private String cust_name;
|
||||
|
||||
/**
|
||||
* 计量单位标识
|
||||
*/
|
||||
private String qty_unit_id;
|
||||
|
||||
|
||||
/**
|
||||
* 计量单位
|
||||
*/
|
||||
@TableField(exist = false)
|
||||
private String qty_unit_name;
|
||||
|
||||
/**
|
||||
* 计划交期
|
||||
*/
|
||||
private String plandeliver_date;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建人姓名
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
/**
|
||||
* 提交人
|
||||
*/
|
||||
private String audit_optid;
|
||||
|
||||
private String audit_id;
|
||||
/**
|
||||
* 提交时间
|
||||
*/
|
||||
private String audit_time;
|
||||
|
||||
/**
|
||||
* 提交人姓名
|
||||
*/
|
||||
private String audit_optname;
|
||||
|
||||
private String audit_name;
|
||||
/**
|
||||
* 确认人
|
||||
*/
|
||||
private String confirm_optid;
|
||||
|
||||
private Long confirm_id;
|
||||
/**
|
||||
* 确认人姓名
|
||||
*/
|
||||
private String confirm_optname;
|
||||
|
||||
private String confirm_name;
|
||||
/**
|
||||
* 确认时间
|
||||
*/
|
||||
private String confirm_time;
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String is_delete;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 车间标识
|
||||
*/
|
||||
private String workshop_id;
|
||||
|
||||
private String product_area;
|
||||
/**
|
||||
* 生产数量
|
||||
*/
|
||||
private BigDecimal product_qty;
|
||||
|
||||
/**
|
||||
* 预入库数量
|
||||
*/
|
||||
private BigDecimal instor_qty;
|
||||
|
||||
/**
|
||||
* 发货数量
|
||||
*/
|
||||
private BigDecimal sendout_qty;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package org.nl.wms.mps_manage.ordermanage.service.saleOrder.dao.mapper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.MapKey;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.wms.mps_manage.ordermanage.service.saleOrder.dao.MpsSaleOrder;
|
||||
@@ -20,8 +21,13 @@ import java.util.Map;
|
||||
*/
|
||||
public interface MpsSaleOrderMapper extends BaseMapper<MpsSaleOrder> {
|
||||
|
||||
@MapKey("sale_id")
|
||||
List<Map> pageQuery(@Param("query") OrderQuery query, @Param("pageQuery") PageQuery pageQuery);
|
||||
|
||||
@MapKey("sale_id")
|
||||
List<Map> getPdaMaterial(JSONObject json);
|
||||
|
||||
@MapKey("sale_id")
|
||||
List<Map> queryAll(@Param("query") OrderQuery query);
|
||||
|
||||
}
|
||||
|
||||
@@ -4,16 +4,57 @@
|
||||
|
||||
<select id="pageQuery" resultType="java.util.Map">
|
||||
SELECT
|
||||
der.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec,
|
||||
mater.net_weight AS unit_weight,
|
||||
unit.unit_name AS qty_unit_name
|
||||
der.aps_sale_code ,
|
||||
SUBSTRING_INDEX(der.aps_sale_code, '-', 1) AS sale_code,
|
||||
SUBSTRING_INDEX(der.aps_sale_code, '-', -1) AS seq_no,
|
||||
der.aps_sale_type,der.aps_status,der.sale_type, der.material_id, der.material_code, der.product_area,
|
||||
der.product_qty, der.sendout_qty, der.instor_qty,der.status, der.sale_qty, der.produce_seq,
|
||||
der.cust_id, der.cust_code, der.cust_name, der.qty_unit_id, der.plandeliver_date, der.create_id,
|
||||
der.create_name, der.create_time, der.audit_id, der.audit_time, der.audit_name, der.confirm_id,
|
||||
der.confirm_name, der.confirm_time, der.is_delete, der.remark,
|
||||
mater.material_name,
|
||||
unit.unit_name AS qty_unit_name
|
||||
FROM
|
||||
mps_sale_order der
|
||||
LEFT JOIN md_me_materialbase mater ON der.material_id = mater.material_id
|
||||
LEFT JOIN md_pb_measureunit unit ON der.qty_unit_id = unit.measure_unit_id
|
||||
mps_sale_order der
|
||||
LEFT JOIN md_me_materialbase mater ON der.material_code = mater.material_code
|
||||
LEFT JOIN md_pb_measureunit unit ON der.qty_unit_id = unit.measure_unit_id
|
||||
|
||||
<where>
|
||||
der.is_delete = '0'
|
||||
<if test="query.sale_code != null">
|
||||
and der.sale_code = #{query.sale_code}
|
||||
</if>
|
||||
<if test="query.status != null">
|
||||
and der.status = #{query.status}
|
||||
</if>
|
||||
<if test="query.sale_type != null">
|
||||
and der.sale_type >= #{query.sale_type}
|
||||
</if>
|
||||
<if test="query.cust_code != null">
|
||||
and der.cust_code >= #{query.cust_code}
|
||||
</if>
|
||||
|
||||
</where>
|
||||
|
||||
|
||||
</select>
|
||||
|
||||
<select id="queryAll" resultType="java.util.Map">
|
||||
SELECT
|
||||
der.aps_sale_code ,
|
||||
SUBSTRING_INDEX(der.aps_sale_code, '-', 1) AS sale_code,
|
||||
SUBSTRING_INDEX(der.aps_sale_code, '-', -1) AS seq_no,
|
||||
der.aps_sale_type,der.aps_status,der.sale_type, der.material_id, der.material_code, der.product_area,
|
||||
der.product_qty, der.sendout_qty, der.instor_qty,der.status, der.sale_qty, der.produce_seq,
|
||||
der.cust_id, der.cust_code, der.cust_name, der.qty_unit_id, der.plandeliver_date, der.create_id,
|
||||
der.create_name, der.create_time, der.audit_id, der.audit_time, der.audit_name, der.confirm_id,
|
||||
der.confirm_name, der.confirm_time, der.is_delete, der.remark,
|
||||
mater.material_name,
|
||||
unit.unit_name AS qty_unit_name
|
||||
FROM
|
||||
mps_sale_order der
|
||||
LEFT JOIN md_me_materialbase mater ON der.material_code = mater.material_code
|
||||
LEFT JOIN md_pb_measureunit unit ON der.qty_unit_id = unit.measure_unit_id
|
||||
|
||||
<where>
|
||||
der.is_delete = '0'
|
||||
@@ -37,25 +78,25 @@
|
||||
|
||||
<select id="getPdaMaterial" resultType="java.util.Map">
|
||||
SELECT
|
||||
der.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec,
|
||||
mater.net_weight AS unit_weight,
|
||||
unit.unit_name AS qty_unit_name
|
||||
der.*,
|
||||
mater.material_code,
|
||||
mater.material_name,
|
||||
mater.material_spec,
|
||||
mater.net_weight AS unit_weight,
|
||||
unit.unit_name AS qty_unit_name
|
||||
FROM
|
||||
mps_sale_order der
|
||||
LEFT JOIN md_me_materialbase mater ON der.material_id = mater.material_id
|
||||
LEFT JOIN md_pb_measureunit unit ON der.qty_unit_id = unit.measure_unit_id
|
||||
mps_sale_order der
|
||||
LEFT JOIN md_me_materialbase mater ON der.material_id = mater.material_id
|
||||
LEFT JOIN md_pb_measureunit unit ON der.qty_unit_id = unit.measure_unit_id
|
||||
|
||||
<where>
|
||||
der.is_delete = '0'
|
||||
AND der.status = '10'
|
||||
<if test="begin_time != null and begin_time != ''">
|
||||
and der.create_time >= #{begin_time}
|
||||
and der.create_time <= #{begin_time}
|
||||
</if>
|
||||
<if test="end_time != null and end_time != ''">
|
||||
and der.create_time <= #{end_time}
|
||||
and der.create_time >= #{end_time}
|
||||
</if>
|
||||
<if test="sale_code != null and sale_code != ''">
|
||||
and der.sale_code LIKE '%${sale_code}%'
|
||||
@@ -70,4 +111,9 @@
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -1,19 +1,35 @@
|
||||
package org.nl.wms.mps_manage.ordermanage.service.saleOrder.impl;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.poi.excel.ExcelReader;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
import org.nl.wms.masterdata_manage.service.material.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.masterdata_manage.service.material.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.mps_manage.ordermanage.service.saleOrder.IMpsSaleOrderService;
|
||||
import org.nl.wms.mps_manage.ordermanage.service.saleOrder.dao.MpsSaleOrder;
|
||||
import org.nl.wms.mps_manage.ordermanage.service.saleOrder.dao.mapper.MpsSaleOrderMapper;
|
||||
import org.nl.wms.mps_manage.ordermanage.service.saleOrder.dto.OrderQuery;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -24,7 +40,9 @@ import java.util.Map;
|
||||
* @since 2023-05-25
|
||||
*/
|
||||
@Service
|
||||
public class MpsSaleOrderServiceImpl extends ServiceImpl<MpsSaleOrderMapper, MpsSaleOrder> implements IMpsSaleOrderService {
|
||||
public class MpsSaleOrderServiceImpl extends ServiceImpl<MpsSaleOrderMapper,MpsSaleOrder> implements IMpsSaleOrderService{
|
||||
@Autowired
|
||||
private IMdMeMaterialbaseService materialbaseService;
|
||||
|
||||
@Override
|
||||
public Object pageQuery(OrderQuery query, PageQuery pageQuery) {
|
||||
@@ -39,4 +57,148 @@ public class MpsSaleOrderServiceImpl extends ServiceImpl<MpsSaleOrderMapper, Mps
|
||||
public List<Map> getPdaMaterial(JSONObject json) {
|
||||
return this.baseMapper.getPdaMaterial(json);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void excelImport(MultipartFile file, HttpServletRequest request) {
|
||||
InputStream inputStream = null;
|
||||
if(file.isEmpty()) {
|
||||
throw new BadRequestException("文件为空,请添加数据后重新导入");
|
||||
}
|
||||
try {
|
||||
inputStream = file.getInputStream();
|
||||
ExcelReader excelReader = ExcelUtil.getReader(inputStream, 0);
|
||||
List<List<Object>> read = excelReader.read();
|
||||
// 循环获取的数据
|
||||
List<MpsSaleOrder> data = new ArrayList<>();
|
||||
Map<String,String> errorMap = new HashMap();
|
||||
row:
|
||||
for(int i = 1; i < read.size(); i++) {
|
||||
List<Object> list = read.get(i);
|
||||
if(ObjectUtil.isEmpty(list)) {
|
||||
continue;
|
||||
}
|
||||
String error_message = "";
|
||||
MpsSaleOrder mpsSaleOrder = new MpsSaleOrder();
|
||||
mpsSaleOrder.setSale_id(org.nl.common.utils.IdUtil.getLongId());
|
||||
mpsSaleOrder.setSale_type("01");
|
||||
mpsSaleOrder.setProduct_area("A1");
|
||||
mpsSaleOrder.setStatus("10");
|
||||
|
||||
mpsSaleOrder.setCreate_time(DateUtil.now());
|
||||
mpsSaleOrder.setConfirm_time(DateUtil.now());
|
||||
mpsSaleOrder.setCreate_id(SecurityUtils.getCurrentUserId());
|
||||
mpsSaleOrder.setCreate_name(SecurityUtils.getCurrentUsername());
|
||||
mpsSaleOrder.setAps_sale_type("M");
|
||||
mpsSaleOrder.setAps_status("X");
|
||||
for(int j = 0; j < list.size(); j++) {
|
||||
String col = null == list.get(j) ? "" : String.valueOf(list.get(j));
|
||||
//存在订单编号,忽略不导入
|
||||
OrderQuery orderQuery = new OrderQuery();
|
||||
List<Map> saleCode = baseMapper.queryAll(orderQuery);
|
||||
if(saleCode.stream()
|
||||
.anyMatch(m -> col.equals(m.get("sale_code")))) {
|
||||
continue;
|
||||
}
|
||||
解析cell:
|
||||
{
|
||||
if(j == 0) {
|
||||
if(StringUtils.isBlank(col)) {
|
||||
throw new BadRequestException("销售单号不能为空");
|
||||
}
|
||||
mpsSaleOrder.setSale_code(col);
|
||||
}
|
||||
if(j == 1) {
|
||||
if(StringUtils.isBlank(col)) {
|
||||
throw new BadRequestException("明细序号不能为空");
|
||||
}
|
||||
mpsSaleOrder.setSeq_no(BigDecimal.valueOf(Double.parseDouble(col)));
|
||||
mpsSaleOrder.setAps_sale_code(mpsSaleOrder.getSale_code() + "-" + col);
|
||||
}
|
||||
if(j == 2) {
|
||||
if(StringUtils.isBlank(col)) {
|
||||
throw new BadRequestException("销售数量不能为空");
|
||||
}
|
||||
mpsSaleOrder.setSale_qty(BigDecimal.valueOf(Double.parseDouble(col)));
|
||||
}
|
||||
if(j == 3) {
|
||||
if(StringUtils.isBlank(col)) {
|
||||
throw new BadRequestException("物料编码不能为空");
|
||||
}
|
||||
mpsSaleOrder.setMaterial_code(col);
|
||||
List<MdMeMaterialbase> meMaterialBases = materialbaseService.list(new QueryWrapper<MdMeMaterialbase>().eq("material_code", col));
|
||||
if(CollectionUtils.isEmpty(meMaterialBases)) {
|
||||
errorMap.put("第" + i + "行" + col, "物料编码对应物料信息不存在");
|
||||
error_message = error_message + col + "物料编码对应物料信息不存在,";
|
||||
}
|
||||
else{
|
||||
Optional<MdMeMaterialbase> first = meMaterialBases
|
||||
.stream()
|
||||
.findFirst();
|
||||
first.ifPresent(mdMeMaterialbase -> {
|
||||
//物料id
|
||||
mpsSaleOrder.setMaterial_id(mdMeMaterialbase.getMaterial_id());
|
||||
//计量单位
|
||||
mpsSaleOrder.setQty_unit_id(mdMeMaterialbase.getBase_unit_id());
|
||||
});
|
||||
}
|
||||
}
|
||||
if(j == 4) {
|
||||
if(StringUtils.isNotBlank(col)) {
|
||||
mpsSaleOrder.setCust_id(Long.parseLong(col));
|
||||
}
|
||||
}
|
||||
if(j == 5) {
|
||||
if(StringUtils.isNotBlank(col)) {
|
||||
mpsSaleOrder.setCust_code(col);
|
||||
}
|
||||
}
|
||||
if(j == 6) {
|
||||
if(StringUtils.isNotBlank(col)) {
|
||||
mpsSaleOrder.setCust_name(col);
|
||||
}
|
||||
}
|
||||
if(j == 7) {
|
||||
if(StringUtils.isBlank(col)) {
|
||||
throw new BadRequestException("计量单位不能为空");
|
||||
}
|
||||
mpsSaleOrder.setQty_unit_id(col);
|
||||
}
|
||||
if(j == 8) {
|
||||
if(StringUtils.isBlank(col)) {
|
||||
throw new BadRequestException("订单交期不能为空");
|
||||
}
|
||||
mpsSaleOrder.setPlandeliver_date(DateUtil.format(DateUtil.parse(col), "yyyy/MM/dd"));
|
||||
}
|
||||
if(j == 9) {
|
||||
if(StringUtils.isNotBlank(col)) {
|
||||
mpsSaleOrder.setRemark(col);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(CollectionUtils.isEmpty(errorMap)) {
|
||||
if(null != mpsSaleOrder.getSale_code()) {
|
||||
data.add(mpsSaleOrder);
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw new BadRequestException(JSON.toJSONString(errorMap));
|
||||
}
|
||||
}
|
||||
this.saveBatch(data);
|
||||
}
|
||||
catch(Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new BadRequestException(e.getMessage());
|
||||
}
|
||||
finally {
|
||||
if(inputStream != null) {
|
||||
try {
|
||||
inputStream.close();
|
||||
}
|
||||
catch(Exception ignored) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
SELECT
|
||||
saleorder.*,
|
||||
uuid() as order_line_code,
|
||||
material.material_code,
|
||||
material.material_name,
|
||||
material.material_spec,
|
||||
unit.unit_name
|
||||
|
||||
@@ -89,7 +89,7 @@ public class PdmProduceWorkorderController {
|
||||
@Log("工单取消下发")
|
||||
@ApiOperation("工单取消下发")
|
||||
public ResponseEntity<Object> unSubmits(@RequestBody List<String> param) {
|
||||
iPdmProduceWorkorderService.down(param);
|
||||
iPdmProduceWorkorderService.unDown(param);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -99,8 +99,8 @@ public class PdmProduceWorkorderController {
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
if (ids != null && ids.length > 0) {
|
||||
iPdmProduceWorkorderService.update(new UpdateWrapper<PdmProduceWorkorder>()
|
||||
.set("is_delete", true)
|
||||
.in("workorder_id", Arrays.asList(ids)));
|
||||
.set("is_delete", true)
|
||||
.in("workorder_id", Arrays.asList(ids)));
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@@ -172,8 +172,8 @@ public class PdmProduceWorkorderController {
|
||||
Page<Object> page = null;
|
||||
if (pageQuery.getPage() != null && pageQuery.getSize() !=null){
|
||||
page = PageHelper
|
||||
.startPage(pageQuery.getPage() + 1, pageQuery.getSize())
|
||||
.setOrderBy("workorder_code desc,seq_number asc");
|
||||
.startPage(pageQuery.getPage() + 1, pageQuery.getSize())
|
||||
.setOrderBy("workorder_code desc,seq_number asc");
|
||||
param.setOrderby("true");
|
||||
}
|
||||
List<Map> list = iPdmProduceWorkorderService.reportQuery(param);
|
||||
|
||||
@@ -70,9 +70,9 @@ public class PdmBiDevice implements Serializable {
|
||||
private String workorder_code;
|
||||
|
||||
/**
|
||||
* 设备编码2
|
||||
* aps设备编码
|
||||
*/
|
||||
private String device_code2;
|
||||
private String aps_device_code;
|
||||
|
||||
/**
|
||||
* 设备上料料斗上限数
|
||||
|
||||
@@ -2,11 +2,13 @@ package org.nl.wms.product_manage.service.workorder.dao;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -18,212 +20,216 @@ import lombok.EqualsAndHashCode;
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@TableName("pdm_produce_workorder")
|
||||
@SuperBuilder
|
||||
|
||||
public class PdmProduceWorkorder implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 工单编号
|
||||
*/
|
||||
@TableId(value = "workorder_id")
|
||||
private String workorder_id;
|
||||
/**
|
||||
* 工单编号
|
||||
*/
|
||||
@TableId(value = "workorder_id")
|
||||
private String workorder_id;
|
||||
|
||||
/**
|
||||
* 工单编号
|
||||
*/
|
||||
private String workorder_code;
|
||||
/**
|
||||
* 工单编号
|
||||
*/
|
||||
private String workorder_code;
|
||||
|
||||
/**
|
||||
* 班次类型
|
||||
*/
|
||||
private String shift_type_scode;
|
||||
/**
|
||||
* 班次类型
|
||||
*/
|
||||
private String shift_type_scode;
|
||||
|
||||
/**
|
||||
* 工序编码
|
||||
*/
|
||||
private String workprocedure_id;
|
||||
/**
|
||||
* 工序编码
|
||||
*/
|
||||
private String workprocedure_id;
|
||||
|
||||
|
||||
/**
|
||||
* 生产区域
|
||||
*/
|
||||
private String product_area;
|
||||
/**
|
||||
* 生产区域
|
||||
*/
|
||||
private String product_area;
|
||||
|
||||
/**
|
||||
* 计划数量
|
||||
*/
|
||||
private BigDecimal plan_qty;
|
||||
/**
|
||||
* 计划数量
|
||||
*/
|
||||
private BigDecimal plan_qty;
|
||||
|
||||
/**
|
||||
* 实际数量
|
||||
*/
|
||||
private BigDecimal real_qty;
|
||||
/**
|
||||
* 实际数量
|
||||
*/
|
||||
private BigDecimal real_qty;
|
||||
|
||||
/**
|
||||
* 人员实际数量
|
||||
*/
|
||||
private BigDecimal person_real_qty;
|
||||
/**
|
||||
* 人员实际数量
|
||||
*/
|
||||
private BigDecimal person_real_qty;
|
||||
|
||||
/**
|
||||
* 电气实际数量
|
||||
*/
|
||||
private BigDecimal dq_real_qty;
|
||||
/**
|
||||
* 电气实际数量
|
||||
*/
|
||||
private BigDecimal dq_real_qty;
|
||||
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
/**
|
||||
* 物料标识
|
||||
*/
|
||||
private String material_id;
|
||||
|
||||
/**
|
||||
* 物料单重
|
||||
*/
|
||||
private BigDecimal material_weight;
|
||||
/**
|
||||
* 物料单重
|
||||
*/
|
||||
private BigDecimal material_weight;
|
||||
|
||||
/**
|
||||
* 计划生产开始时间
|
||||
*/
|
||||
private String planproducestart_date;
|
||||
/**
|
||||
* 计划生产开始时间
|
||||
*/
|
||||
private String planproducestart_date;
|
||||
|
||||
/**
|
||||
* 计划生产结束时间
|
||||
*/
|
||||
private String planproduceend_date;
|
||||
/**
|
||||
* 计划生产结束时间
|
||||
*/
|
||||
private String planproduceend_date;
|
||||
|
||||
/**
|
||||
* 实际生产开始时间
|
||||
*/
|
||||
private String realproducestart_date;
|
||||
/**
|
||||
* 实际生产开始时间
|
||||
*/
|
||||
private String realproducestart_date;
|
||||
|
||||
/**
|
||||
* 实际生产结束时间
|
||||
*/
|
||||
private String realproduceend_date;
|
||||
/**
|
||||
* 实际生产结束时间
|
||||
*/
|
||||
private String realproduceend_date;
|
||||
|
||||
/**
|
||||
* 当前生产设备编码
|
||||
*/
|
||||
private String device_code;
|
||||
/**
|
||||
* 当前生产设备编码
|
||||
*/
|
||||
private String device_code;
|
||||
|
||||
/**
|
||||
* 当前生产人员id
|
||||
*/
|
||||
private String current_produce_person_id;
|
||||
/**
|
||||
* 当前生产人员id
|
||||
*/
|
||||
private String current_produce_person_id;
|
||||
|
||||
/**
|
||||
* 操作工是否允许修改报工数量
|
||||
*/
|
||||
private Boolean is_canupdate_update;
|
||||
/**
|
||||
* 操作工是否允许修改报工数量
|
||||
*/
|
||||
private Boolean is_canupdate_update;
|
||||
|
||||
/**
|
||||
* 物料系列
|
||||
*/
|
||||
private String materialprocess_series;
|
||||
/**
|
||||
* 物料系列
|
||||
*/
|
||||
private String materialprocess_series;
|
||||
|
||||
/**
|
||||
* 工单状态
|
||||
*/
|
||||
private String workorder_status;
|
||||
/**
|
||||
* 工单状态
|
||||
*/
|
||||
private String workorder_status;
|
||||
|
||||
/**
|
||||
* 是否搬运
|
||||
*/
|
||||
private Boolean is_needmove;
|
||||
/**
|
||||
* 是否搬运
|
||||
*/
|
||||
private Boolean is_needmove;
|
||||
|
||||
/**
|
||||
* 销售单标识
|
||||
*/
|
||||
private String sale_id;
|
||||
/**
|
||||
* 销售单标识
|
||||
*/
|
||||
private String sale_id;
|
||||
|
||||
/**
|
||||
* 创建类型
|
||||
*/
|
||||
private String create_type;
|
||||
/**
|
||||
* 创建类型
|
||||
*/
|
||||
private String create_type;
|
||||
|
||||
/**
|
||||
* 工单是否异常
|
||||
*/
|
||||
private Boolean is_error;
|
||||
/**
|
||||
* 工单是否异常
|
||||
*/
|
||||
private Boolean is_error;
|
||||
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private String error_info;
|
||||
/**
|
||||
* 异常信息
|
||||
*/
|
||||
private String error_info;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_id;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_id;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_name;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String create_name;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private String create_time;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean is_delete;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private Boolean is_delete;
|
||||
|
||||
/**
|
||||
* 报工数量
|
||||
*/
|
||||
private BigDecimal report_qty;
|
||||
/**
|
||||
* 报工数量
|
||||
*/
|
||||
private BigDecimal report_qty;
|
||||
|
||||
// 工单类型 10手工工单。20排产工单
|
||||
private String order_type_scode;
|
||||
// 工单类型 10手工工单。20排产工单
|
||||
private String order_type_scode;
|
||||
|
||||
//报废总;报修总
|
||||
private BigDecimal nok_qty;
|
||||
private BigDecimal repare_qty;
|
||||
//报废总;报修总
|
||||
private BigDecimal nok_qty;
|
||||
private BigDecimal repare_qty;
|
||||
|
||||
/**
|
||||
* 下发人
|
||||
*/
|
||||
private String down_id;
|
||||
/**
|
||||
* 下发人
|
||||
*/
|
||||
private String down_id;
|
||||
|
||||
/**
|
||||
* 下发人
|
||||
*/
|
||||
private String down_name;
|
||||
/**
|
||||
* 下发人
|
||||
*/
|
||||
private String down_name;
|
||||
|
||||
/**
|
||||
* 下发时间
|
||||
*/
|
||||
private String down_time;
|
||||
/**
|
||||
* 下发时间
|
||||
*/
|
||||
private String down_time;
|
||||
|
||||
|
||||
/**
|
||||
* 完工人
|
||||
*/
|
||||
private String confirm_id;
|
||||
/**
|
||||
* 完工人
|
||||
*/
|
||||
private String confirm_id;
|
||||
|
||||
/**
|
||||
* 完工人
|
||||
*/
|
||||
private String confirm_name;
|
||||
/**
|
||||
* 完工人
|
||||
*/
|
||||
private String confirm_name;
|
||||
|
||||
/**
|
||||
* 完工时间
|
||||
*/
|
||||
private String confirm_time;
|
||||
/**
|
||||
* 完工时间
|
||||
*/
|
||||
private String confirm_time;
|
||||
|
||||
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String package_ext;
|
||||
/**
|
||||
* 是否删除
|
||||
*/
|
||||
private String package_ext;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package org.nl.wms.product_manage.service.workorder.impl;
|
||||
|
||||
import cn.hutool.core.date.DateTime;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.poi.excel.ExcelReader;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@@ -15,12 +14,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import io.jsonwebtoken.lang.Assert;
|
||||
import lombok.SneakyThrows;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.nl.common.TableDataInfo;
|
||||
import org.nl.common.domain.query.PageQuery;
|
||||
@@ -35,8 +33,6 @@ import org.nl.wms.ext.acs.service.WmsToAcsService;
|
||||
import org.nl.wms.masterdata_manage.master.service.classstandard.IMdPbClassstandardService;
|
||||
import org.nl.wms.masterdata_manage.service.material.IMdMeMaterialbaseService;
|
||||
import org.nl.wms.masterdata_manage.service.material.dao.MdMeMaterialbase;
|
||||
import org.nl.wms.mps.service.WorkOrderImportEnum;
|
||||
import org.nl.wms.mps.service.dto.ProduceWorkorderDto;
|
||||
import org.nl.wms.mps.service.dto.ProduceshiftorderDto;
|
||||
import org.nl.wms.product_manage.ReportEnum;
|
||||
import org.nl.wms.product_manage.service.device.IPdmBiDeviceService;
|
||||
@@ -53,7 +49,6 @@ import org.nl.wms.product_manage.service.workprocedure.IPdmBiWorkprocedureServic
|
||||
import org.nl.wms.product_manage.service.workprocedure.dao.PdmBiWorkprocedure;
|
||||
import org.nl.wms.system_manage.service.user.ISysUserService;
|
||||
import org.nl.wms.system_manage.service.user.dao.SysUser;
|
||||
import org.redisson.misc.Hash;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -70,7 +65,6 @@ import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.*;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -84,7 +78,7 @@ import java.util.stream.Collectors;
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorkorderMapper, PdmProduceWorkorder> implements IPdmProduceWorkorderService {
|
||||
public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorkorderMapper,PdmProduceWorkorder> implements IPdmProduceWorkorderService{
|
||||
@Autowired
|
||||
private IMdPbClassstandardService classstandardService;
|
||||
@Autowired
|
||||
@@ -106,7 +100,7 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
public Object queryAll(WorkorderQuery query, PageQuery pageQuery) {
|
||||
if (!StringUtils.isEmpty(query.getProduct_series())) {
|
||||
String collect = classstandardService.getChildIdStr(query.getProduct_series())
|
||||
.stream().collect(Collectors.joining("','"));
|
||||
.stream().collect(Collectors.joining("','"));
|
||||
query.setProduct_series("('" + collect + "')");
|
||||
}
|
||||
if (!StringUtils.isEmpty(query.getOrder_status()) && query.getOrder_status().contains("-1")) {
|
||||
@@ -141,7 +135,6 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
entity.setCreate_type(StatusEnum.PCINTO.getCode());
|
||||
entity.setWorkorder_status(WorkerOrderEnum.CREATE.getCode());
|
||||
this.save(entity);
|
||||
|
||||
this.recordWorkOrder(OptionRecord.OptionEnum.UPDATE, entity.getWorkorder_id());
|
||||
}
|
||||
|
||||
@@ -149,17 +142,31 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
public void updateForm(JSONObject form) {
|
||||
Assert.notNull(form, "参数不能为空");
|
||||
PdmProduceWorkorder one = this.getOne(new QueryWrapper<PdmProduceWorkorder>().eq("workorder_id", form.getString("workorder_id")));
|
||||
if (one == null) {
|
||||
if(one == null) {
|
||||
throw new BadRequestException("被删除或无权限,操作失败!");
|
||||
}
|
||||
PdmProduceWorkorder entity = form.toJavaObject(PdmProduceWorkorder.class);
|
||||
entity.setDown_time(DateUtil.now());
|
||||
entity.setDown_id(SecurityUtils.getCurrentUserId());
|
||||
entity.setDown_name(SecurityUtils.getCurrentNickName());
|
||||
entity.setReal_qty(null);
|
||||
this.updateById(entity);
|
||||
|
||||
this.recordWorkOrder(OptionRecord.OptionEnum.UPDATE, entity.getWorkorder_id());
|
||||
PdmProduceWorkorder newEntity = form.toJavaObject(PdmProduceWorkorder.class);
|
||||
PdmProduceWorkorder pdmProduceWorkorder = PdmProduceWorkorder
|
||||
.builder()
|
||||
.workorder_id(newEntity.getWorkorder_id())
|
||||
.product_area(newEntity.getProduct_area())
|
||||
.workprocedure_id(newEntity.getWorkprocedure_id())
|
||||
.material_id(newEntity.getMaterial_id())
|
||||
.material_weight(newEntity.getMaterial_weight())
|
||||
.plan_qty(newEntity.getPlan_qty())
|
||||
.planproducestart_date(newEntity.getPlanproducestart_date())
|
||||
.planproduceend_date(newEntity.getPlanproduceend_date())
|
||||
.report_qty(newEntity.getReport_qty())
|
||||
.shift_type_scode(newEntity.getShift_type_scode())
|
||||
.sale_id(newEntity.getSale_id())
|
||||
.is_needmove(newEntity.getIs_needmove())
|
||||
.is_canupdate_update(newEntity.getIs_canupdate_update())
|
||||
.down_time(DateUtil.now())
|
||||
.down_id(SecurityUtils.getCurrentUserId())
|
||||
.down_name(SecurityUtils.getCurrentNickName())
|
||||
.build();
|
||||
this.updateById(pdmProduceWorkorder);
|
||||
this.recordWorkOrder(OptionRecord.OptionEnum.UPDATE, pdmProduceWorkorder.getWorkorder_id());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -168,42 +175,74 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void down(List<String> ids) {
|
||||
if (ids == null || ids.size() == 0) {
|
||||
if(ids == null || ids.size() == 0) {
|
||||
return;
|
||||
}
|
||||
List<PdmProduceWorkorder> workorders = this.list(new QueryWrapper<PdmProduceWorkorder>().in("workorder_id", ids).lt("workorder_status",WorkerOrderEnum.AUTO_COMPLETE.getCode()));
|
||||
if (workorders.size()!= ids.size()){
|
||||
throw new BadRequestException("完成的工单不允许再次下发");
|
||||
}
|
||||
List<PdmProduceWorkorder> list = this.list(new QueryWrapper<PdmProduceWorkorder>()
|
||||
.nested(i -> i
|
||||
.isNull("workorder_code").or()
|
||||
.eq("workorder_code", "").or()
|
||||
.eq("workorder_code", "0"))
|
||||
.in("workorder_id", ids));
|
||||
//aps排产完成的工单,生成工单编号再下发
|
||||
if(list.size() > 0) {
|
||||
list.forEach(r -> {
|
||||
this.update(new UpdateWrapper<PdmProduceWorkorder>()
|
||||
.eq("workorder_id", r.getWorkorder_id())
|
||||
.set("workorder_code", CodeUtil.getNewCode("PDM_SHIFTORDER")));
|
||||
});
|
||||
}
|
||||
this.update(new UpdateWrapper<PdmProduceWorkorder>()
|
||||
.set("workorder_status", WorkerOrderEnum.SEND.getCode())
|
||||
.set("down_id", SecurityUtils.getCurrentUserId())
|
||||
.set("down_name", SecurityUtils.getCurrentNickName())
|
||||
.set("down_time", new Date())
|
||||
.in("workorder_id", ids));
|
||||
.set("workorder_status", WorkerOrderEnum.SEND.getCode())
|
||||
.set("down_id", SecurityUtils.getCurrentUserId())
|
||||
.set("down_name", SecurityUtils.getCurrentNickName())
|
||||
.set("down_time", new Date())
|
||||
.in("workorder_id", ids));
|
||||
this.recordWorkOrder(OptionRecord.OptionEnum.UPDATE, ids.toArray(new String[0]));
|
||||
}
|
||||
|
||||
public void recordWorkOrder(OptionRecord.OptionEnum optionEnum, String... ids) {
|
||||
List<PdmProduceWorkorder> workorders = this.list(new QueryWrapper<PdmProduceWorkorder>().in("workorder_id", ids));
|
||||
for(PdmProduceWorkorder one : workorders) {
|
||||
WorkorderRecord record = WorkorderRecord
|
||||
.builder()
|
||||
.workorder_id(one.getWorkorder_id())
|
||||
.device_code(one.getDevice_code())
|
||||
.dq_init_qty(one.getReal_qty())
|
||||
.dq_finish_qty(one.getReal_qty())
|
||||
.operatetime_start(one.getCreate_time())
|
||||
.workprocedure_id(one.getWorkprocedure_id())
|
||||
.operatetime_end(DateUtil.now())
|
||||
.shift_type_scode(one.getShift_type_scode())
|
||||
.product_area(one.getProduct_area())
|
||||
.build();
|
||||
OptionRecord.recordAsync(optionEnum, one.getWorkorder_status(), OptionRecord.Buss.WORKORDER, one.getWorkorder_id(), record);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unDown(List<String> ids) {
|
||||
if (ids == null || ids.size() == 0) {
|
||||
if(ids == null || ids.size() == 0) {
|
||||
return;
|
||||
}
|
||||
List<PdmProduceWorkorder> list = this.list(new QueryWrapper<PdmProduceWorkorder>()
|
||||
.ne("workorder_status", WorkerOrderEnum.SEND.getCode())
|
||||
.in("workorder_id", ids));
|
||||
if (list.size() > 0) {
|
||||
.ne("workorder_status", WorkerOrderEnum.SEND.getCode())
|
||||
.in("workorder_id", ids));
|
||||
if(list.size() > 0) {
|
||||
throw new BadRequestException("只有下发状态的工单才能取消下发");
|
||||
}
|
||||
this.update(new UpdateWrapper<PdmProduceWorkorder>()
|
||||
.set("workorder_status", WorkerOrderEnum.CREATE.getCode())
|
||||
.set("down_id", SecurityUtils.getCurrentUserId())
|
||||
.set("down_name", SecurityUtils.getCurrentNickName())
|
||||
.set("down_time", new Date())
|
||||
.in("workorder_id", ids));
|
||||
|
||||
.set("workorder_status", WorkerOrderEnum.CREATE.getCode())
|
||||
.set("down_id", SecurityUtils.getCurrentUserId())
|
||||
.set("down_name", SecurityUtils.getCurrentNickName())
|
||||
.set("down_time", new Date())
|
||||
.in("workorder_id", ids));
|
||||
this.recordWorkOrder(OptionRecord.OptionEnum.UPDATE, ids.toArray(new String[0]));
|
||||
}
|
||||
|
||||
@@ -211,42 +250,44 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void finish(JSONObject param) {
|
||||
//强制完成时修改工单状态
|
||||
String workorder_id = param.getJSONObject("row").getString("workorder_id");
|
||||
String workorder_id = param
|
||||
.getJSONObject("row")
|
||||
.getString("workorder_id");
|
||||
this.update(new UpdateWrapper<PdmProduceWorkorder>()
|
||||
.set("workorder_status", WorkerOrderEnum.FORCE_COMPLETE.getCode())
|
||||
.set("confirm_id", SecurityUtils.getCurrentUserId())
|
||||
.set("confirm_name", SecurityUtils.getCurrentNickName())
|
||||
.set("confirm_time", new Date())
|
||||
.in("workorder_id", workorder_id));
|
||||
.set("workorder_status", WorkerOrderEnum.FORCE_COMPLETE.getCode())
|
||||
.set("confirm_id", SecurityUtils.getCurrentUserId())
|
||||
.set("confirm_name", SecurityUtils.getCurrentNickName())
|
||||
.set("confirm_time", new Date())
|
||||
.in("workorder_id", workorder_id));
|
||||
JSONArray array = new JSONArray();
|
||||
JSONObject map = new JSONObject();
|
||||
map.put("workorder_id", workorder_id);
|
||||
map.put("type", WorkerOrderEnum.COMPLETE.getCode());
|
||||
array.add(map);
|
||||
Map<String, Object> result = wmsToAcsService.orderStatusUpdate(array);
|
||||
if (!HttpStatus.OK.equals(result.get("status"))) {
|
||||
Map<String,Object> result = wmsToAcsService.orderStatusUpdate(array);
|
||||
if(!HttpStatus.OK.equals(result.get("status"))) {
|
||||
log.error((String) result.get("message"));
|
||||
}
|
||||
this.recordWorkOrder(OptionRecord.OptionEnum.UPDATE, workorder_id);
|
||||
}
|
||||
|
||||
|
||||
public void recordWorkOrder(OptionRecord.OptionEnum optionEnum, String... ids) {
|
||||
// List<PdmProduceWorkorder> workorders = this.list(new QueryWrapper<PdmProduceWorkorder>().in("workorder_id", ids));
|
||||
// for (PdmProduceWorkorder one : workorders) {
|
||||
// WorkorderRecord record = WorkorderRecord.builder()
|
||||
// .workorder_id(one.getWorkorder_id())
|
||||
// .device_code(one.getDevice_code())
|
||||
// .dq_init_qty(one.getReal_qty())
|
||||
// .dq_finish_qty(one.getReal_qty())
|
||||
// .operatetime_start(one.getCreate_time())
|
||||
// .workprocedure_id(one.getWorkprocedure_id())
|
||||
// .operatetime_end(DateUtil.now())
|
||||
// .shift_type_scode(one.getShift_type_scode())
|
||||
// .product_area(one.getProduct_area()).build();
|
||||
// OptionRecord.recordAsync(optionEnum, one.getWorkorder_status(), OptionRecord.Buss.WORKORDER, one.getWorkorder_id(), record);
|
||||
// }
|
||||
}
|
||||
//public void recordWorkOrder(OptionRecord.OptionEnum optionEnum, String... ids) {
|
||||
// List<PdmProduceWorkorder> workorders = this.list(new QueryWrapper<PdmProduceWorkorder>().in("workorder_id", ids));
|
||||
// for (PdmProduceWorkorder one : workorders) {
|
||||
// WorkorderRecord record = WorkorderRecord.builder()
|
||||
// .workorder_id(one.getWorkorder_id())
|
||||
// .device_code(one.getDevice_code())
|
||||
// .dq_init_qty(one.getReal_qty())
|
||||
// .dq_finish_qty(one.getReal_qty())
|
||||
// .operatetime_start(one.getCreate_time())
|
||||
// .workprocedure_id(one.getWorkprocedure_id())
|
||||
// .operatetime_end(DateUtil.now())
|
||||
// .shift_type_scode(one.getShift_type_scode())
|
||||
// .product_area(one.getProduct_area()).build();
|
||||
// OptionRecord.recordAsync(optionEnum, one.getWorkorder_status(), OptionRecord.Buss.WORKORDER, one.getWorkorder_id(), record);
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -382,8 +423,8 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
workorder.setMaterial_id(mdMeMaterialbases.get(0).getMaterial_id());
|
||||
}else {
|
||||
Optional<MdMeMaterialbase> first = mdMeMaterialbases.stream().filter(mdMeMaterialbase -> mdMeMaterialbase.getMaterial_code().contains("S")
|
||||
&& Pattern.matches("^[0-9]*$", mdMeMaterialbase.getMaterial_name().substring(mdMeMaterialbase.getMaterial_name().length() - 1))
|
||||
).findFirst();
|
||||
&& Pattern.matches("^[0-9]*$", mdMeMaterialbase.getMaterial_name().substring(mdMeMaterialbase.getMaterial_name().length() - 1))
|
||||
).findFirst();
|
||||
if (first.isPresent()){
|
||||
workorder.setMaterial_id(first.get().getMaterial_id());
|
||||
}else {
|
||||
@@ -504,8 +545,8 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
workorder.setMaterial_id(mdMeMaterialbases.get(0).getMaterial_id());
|
||||
}else {
|
||||
Optional<MdMeMaterialbase> first = mdMeMaterialbases.stream().filter(mdMeMaterialbase -> mdMeMaterialbase.getMaterial_code().contains("S")
|
||||
&& Pattern.matches("^[0-9]*$", mdMeMaterialbase.getMaterial_name().substring(mdMeMaterialbase.getMaterial_name().length() - 1))
|
||||
).findFirst();
|
||||
&& Pattern.matches("^[0-9]*$", mdMeMaterialbase.getMaterial_name().substring(mdMeMaterialbase.getMaterial_name().length() - 1))
|
||||
).findFirst();
|
||||
if (first.isPresent()){
|
||||
workorder.setMaterial_id(first.get().getMaterial_id());
|
||||
}else {
|
||||
@@ -521,8 +562,8 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
} else {
|
||||
List<String> workprocedures = data.stream().map(PdmProduceWorkorder::getWorkprocedure_id).collect(Collectors.toList());
|
||||
List<PdmBiDevice> list = deviceService.list(new QueryWrapper<PdmBiDevice>()
|
||||
.in("workprocedure_id", workprocedures)
|
||||
);
|
||||
.in("workprocedure_id", workprocedures)
|
||||
);
|
||||
Map<String, List<PdmBiDevice>> listMap = list.stream().collect(Collectors.groupingBy(PdmBiDevice::getWorkprocedure_id));
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
PdmProduceWorkorder item = data.get(i);
|
||||
@@ -575,9 +616,9 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
//1-创建、2-下发、3-生产中、4-暂停、6-完成
|
||||
//判断该工单状态
|
||||
PdmProduceWorkorder result = this.getOne(new QueryWrapper<PdmProduceWorkorder>()
|
||||
.eq("device_code", param.getString("device_code"))
|
||||
.in("workorder_status", "3", "4")
|
||||
.ne("workorder_id", param.getString("workorder_id")));
|
||||
.eq("device_code", param.getString("device_code"))
|
||||
.in("workorder_status", "3", "4")
|
||||
.ne("workorder_id", param.getString("workorder_id")));
|
||||
if (ObjectUtil.isNotEmpty(result)) {
|
||||
throw new BadRequestException("已有工单选择该设备开工,请更换开工设备!");
|
||||
}
|
||||
@@ -585,9 +626,9 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
|
||||
JSONObject order = packageForm(param);
|
||||
//开工时更新设备生产的物料规格
|
||||
// deviceService.update(new UpdateWrapper<PdmBiDevice>()
|
||||
// .set("spec",order.getString("material_spec"))
|
||||
// .eq("device_code",order.getString("device_code")));
|
||||
// deviceService.update(new UpdateWrapper<PdmBiDevice>()
|
||||
// .set("spec",order.getString("material_spec"))
|
||||
// .eq("device_code",order.getString("device_code")));
|
||||
array.add(order);
|
||||
//下发acs
|
||||
PdmProduceWorkorder workOrder = this.getOne(new QueryWrapper<PdmProduceWorkorder>().eq("workorder_id", param.getString("workorder_id")));
|
||||
@@ -653,11 +694,11 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
|
||||
PdmProduceWorkorder workorder = this.getOne(new QueryWrapper<PdmProduceWorkorder>().eq("workorder_id", param.getString("workorder_id")));
|
||||
Assert.notNull(workorder, "当前工单不存在");
|
||||
// if (workorder.getWorkorder_status().equals(WorkerOrderEnum.AUTO_COMPLETE.getCode()) || workorder.getWorkorder_status().equals(WorkerOrderEnum.COMPLETE.getCode()) || workorder.getWorkorder_status().equals(WorkerOrderEnum.FORCE_COMPLETE.getCode())) {
|
||||
// throw new BadRequestException(param.getString("workorder_id") + "当前工单已经完工不允许报工");
|
||||
// }
|
||||
// if (workorder.getWorkorder_status().equals(WorkerOrderEnum.AUTO_COMPLETE.getCode()) || workorder.getWorkorder_status().equals(WorkerOrderEnum.COMPLETE.getCode()) || workorder.getWorkorder_status().equals(WorkerOrderEnum.FORCE_COMPLETE.getCode())) {
|
||||
// throw new BadRequestException(param.getString("workorder_id") + "当前工单已经完工不允许报工");
|
||||
// }
|
||||
PdmProduceWorkorderrecord one = reportRecordService.getOne(new QueryWrapper<PdmProduceWorkorderrecord>()
|
||||
.eq("workorder_id", param.getString("workorder_id")).eq("report_status", ReportEnum.REPORT_STATUS.code("生成")));
|
||||
.eq("workorder_id", param.getString("workorder_id")).eq("report_status", ReportEnum.REPORT_STATUS.code("生成")));
|
||||
Assert.notNull(one, param.getString("workorder_id") + "当前工单没有生成状态的报工记录");
|
||||
workorder.setReport_qty(workorder.getReport_qty().add(param.getBigDecimal("report_qty")));
|
||||
if (workorder.getPlan_qty().doubleValue() <= workorder.getReport_qty().doubleValue()) {
|
||||
@@ -675,11 +716,11 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
workorder.setReal_qty(null);
|
||||
this.updateById(workorder);
|
||||
reportRecordService.update(new UpdateWrapper<PdmProduceWorkorderrecord>()
|
||||
.set("report_qty", param.getBigDecimal("report_qty"))
|
||||
.set("report_status", ReportEnum.REPORT_STATUS.code("报工"))
|
||||
.set("operatetime_end",DateUtil.now())
|
||||
.set("needproduct_qty", Math.max(0, workorder.getPlan_qty().intValue() - workorder.getReport_qty().intValue()))
|
||||
.eq("macoperate_id", one.getMacoperate_id()));
|
||||
.set("report_qty", param.getBigDecimal("report_qty"))
|
||||
.set("report_status", ReportEnum.REPORT_STATUS.code("报工"))
|
||||
.set("operatetime_end",DateUtil.now())
|
||||
.set("needproduct_qty", Math.max(0, workorder.getPlan_qty().intValue() - workorder.getReport_qty().intValue()))
|
||||
.eq("macoperate_id", one.getMacoperate_id()));
|
||||
return one.getMacoperate_id();
|
||||
}
|
||||
|
||||
@@ -698,12 +739,16 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
@Transactional
|
||||
public void reportApprove(JSONArray param) {
|
||||
List<PdmProduceWorkorderrecord> workreportRecords = param.toJavaList(PdmProduceWorkorderrecord.class);
|
||||
if (!CollectionUtils.isEmpty(workreportRecords)) {
|
||||
List<String> macoperate_ids = workreportRecords.stream().map(PdmProduceWorkorderrecord::getMacoperate_id).collect(Collectors.toList());
|
||||
List<PdmProduceWorkorderrecord> record = reportRecordService.list(new QueryWrapper<PdmProduceWorkorderrecord>()
|
||||
.in("macoperate_id", macoperate_ids));
|
||||
Map<String, List<PdmProduceWorkorderrecord>> collect = workreportRecords.stream().collect(Collectors.groupingBy(PdmProduceWorkorderrecord::getWorkorder_id));
|
||||
for (Map.Entry<String, List<PdmProduceWorkorderrecord>> entry : collect.entrySet()) {
|
||||
if(!CollectionUtils.isEmpty(workreportRecords)) {
|
||||
List<String> macoperate_ids = workreportRecords
|
||||
.stream()
|
||||
.map(PdmProduceWorkorderrecord::getMacoperate_id)
|
||||
.collect(Collectors.toList());
|
||||
List<PdmProduceWorkorderrecord> record = reportRecordService.list(new QueryWrapper<PdmProduceWorkorderrecord>().in("macoperate_id", macoperate_ids));
|
||||
Map<String,List<PdmProduceWorkorderrecord>> collect = workreportRecords
|
||||
.stream()
|
||||
.collect(Collectors.groupingBy(PdmProduceWorkorderrecord::getWorkorder_id));
|
||||
for(Map.Entry<String,List<PdmProduceWorkorderrecord>> entry : collect.entrySet()) {
|
||||
List<PdmProduceWorkorderrecord> itemRecord = entry.getValue();
|
||||
itemRecord.forEach(item -> {
|
||||
item.setReport_status(ReportEnum.REPORT_STATUS.code("报工审核"));
|
||||
@@ -800,9 +845,8 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<Map> getOrderList(Map<String, String> param, Pageable page) {
|
||||
public List<Map> getOrderList(Map<String,String> param, Pageable page) {
|
||||
return this.baseMapper.orderList(param);
|
||||
}
|
||||
|
||||
@@ -810,9 +854,9 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
public void updateReport(JSONObject param) {
|
||||
Assert.notNull(param, "参数不能为空");
|
||||
PdmProduceWorkorderrecord record = reportRecordService.getOne(new QueryWrapper<PdmProduceWorkorderrecord>()
|
||||
.eq("macoperate_id", param.getString("macoperate_id")));
|
||||
.eq("macoperate_id", param.getString("macoperate_id")));
|
||||
PdmProduceWorkorder workorder = this.getOne(new QueryWrapper<PdmProduceWorkorder>()
|
||||
.eq("workorder_id", record.getWorkorder_id()));
|
||||
.eq("workorder_id", record.getWorkorder_id()));
|
||||
if (!workorder.getIs_canupdate_update()) {
|
||||
throw new BadRequestException("当前工单设置为不允许修改报工记录");
|
||||
}
|
||||
@@ -825,6 +869,6 @@ public class IPdmProduceWorkorderServiceImpl extends ServiceImpl<PdmProduceWorko
|
||||
}
|
||||
updateWrapper.set("report_qty", param.getBigDecimal("report_qty"));
|
||||
reportRecordService.update(updateWrapper
|
||||
.eq("macoperate_id", param.getString("macoperate_id")));
|
||||
.eq("macoperate_id", param.getString("macoperate_id")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ package org.nl.wms.product_manage.备份pdm.rest;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.nl.common.anno.Log;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.wms.product_manage.备份pdm.service.FactoryCalendarService;
|
||||
@@ -73,8 +73,8 @@ public class FactoryCalendarController {
|
||||
}
|
||||
|
||||
@PostMapping("/updateActive")
|
||||
@Log("查询日期明细")
|
||||
@ApiOperation("查询日期明细")
|
||||
@Log("启用停用日历")
|
||||
@ApiOperation("启用停用日历")
|
||||
//@PreAuthorize("@el.check('productprocessroute:add')")
|
||||
public ResponseEntity<Object> updateActive(@RequestBody JSONObject whereJson) {
|
||||
factoryCalendarService.updateActive(whereJson);
|
||||
@@ -90,8 +90,8 @@ public class FactoryCalendarController {
|
||||
}
|
||||
|
||||
@PostMapping("/updateDtlStatus")
|
||||
@Log("查询日期明细")
|
||||
@ApiOperation("查询日期明细")
|
||||
@Log("修改工作日/休息日")
|
||||
@ApiOperation("修改工作日/休息日")
|
||||
//@PreAuthorize("@el.check('productprocessroute:add')")
|
||||
public ResponseEntity<Object> updateDtlStatus(@RequestBody JSONObject whereJson) {
|
||||
factoryCalendarService.updateDtlStatus(whereJson);
|
||||
@@ -99,8 +99,8 @@ public class FactoryCalendarController {
|
||||
}
|
||||
|
||||
@PostMapping("/updateDtlActive")
|
||||
@Log("查询日期明细")
|
||||
@ApiOperation("查询日期明细")
|
||||
@Log("查询工作日/休息日")
|
||||
@ApiOperation("查询工作日/休息日")
|
||||
//@PreAuthorize("@el.check('productprocessroute:add')")
|
||||
public ResponseEntity<Object> updateDtlActive(@RequestBody JSONObject whereJson) {
|
||||
factoryCalendarService.updateDtlActive(whereJson);
|
||||
|
||||
@@ -34,8 +34,10 @@ public class DeviceDto implements Serializable {
|
||||
/** 工单编号 */
|
||||
private String workorder_code;
|
||||
|
||||
/** 设备编码2 */
|
||||
private String device_code2;
|
||||
/**
|
||||
* aps设备编码
|
||||
*/
|
||||
private String aps_device_code;
|
||||
|
||||
/** 设备来料仓上限数 */
|
||||
private BigDecimal inupperlimit_qty;
|
||||
|
||||
@@ -9,18 +9,21 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.modules.common.exception.BadRequestException;
|
||||
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.modules.wql.WQL;
|
||||
import org.nl.modules.wql.core.bean.WQLObject;
|
||||
import org.nl.modules.wql.util.WqlUtil;
|
||||
import org.nl.wms.product_manage.备份pdm.service.FactoryCalendarService;
|
||||
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.scheduling.annotation.Async;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
@@ -48,6 +51,20 @@ public class FactoryCalendarServiceImpl implements FactoryCalendarService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray queryDtl(JSONObject whereJson) {
|
||||
String year = whereJson.getString("year");
|
||||
String factorycalendar_id = whereJson.getString("factorycalendar_id");
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("flag", "2");
|
||||
if (StrUtil.isNotEmpty(year)) map.put("date", year + "%");
|
||||
if (StrUtil.isNotEmpty(factorycalendar_id)) map.put("id", factorycalendar_id);
|
||||
return WQL.getWO("QPDM_FACTORYCALENDAR").addParamMap(map).process().getResultJSONArray(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public void create(JSONObject whereJson) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
@@ -66,6 +83,7 @@ public class FactoryCalendarServiceImpl implements FactoryCalendarService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(propagation = Propagation.REQUIRES_NEW)
|
||||
public void update(JSONObject whereJson) {
|
||||
String factorycalendar_id = whereJson.getString("factorycalendar_id");
|
||||
|
||||
@@ -85,16 +103,118 @@ public class FactoryCalendarServiceImpl implements FactoryCalendarService {
|
||||
this.insertDtl(whereJson);
|
||||
}
|
||||
|
||||
@Async
|
||||
public void insertDtl(JSONObject row) {
|
||||
|
||||
String a =DateUtil.format(DateUtil.parse( row.getString("factorycale_startdate")), "yyyy/MM/dd");
|
||||
String b = row.getString("endfactory_year")+ "/12/31";
|
||||
while (!a.equals(b)) {
|
||||
JSONObject dtl = new JSONObject();
|
||||
dtl.put("factorycalendardtl_id", IdUtil.getSnowflake(1, 1).nextId() + "");
|
||||
dtl.put("factorycalendar_id", row.getString("factorycalendar_id"));
|
||||
dtl.put("factory_date", a);
|
||||
int dayOfWeek = DateUtil.dayOfWeek(DateUtil.parse(a));
|
||||
switch (dayOfWeek) {
|
||||
case 1:
|
||||
if (row.getString("is_sun").equals("1")) {
|
||||
dtl.put("factorydate_type", "01");
|
||||
dtl.put("work_type", "00");
|
||||
dtl.put("work_type_name", "工作日");
|
||||
dtl.put("priority", "50");
|
||||
} else {
|
||||
dtl.put("factorydate_type", "03");
|
||||
dtl.put("work_type", "01");
|
||||
dtl.put("work_type_name", "休息日");
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (row.getString("is_mon").equals("1")) {
|
||||
dtl.put("factorydate_type", "01");
|
||||
dtl.put("work_type", "00");
|
||||
dtl.put("work_type_name", "工作日");
|
||||
dtl.put("priority", "50");
|
||||
} else {
|
||||
dtl.put("factorydate_type", "03");
|
||||
dtl.put("work_type", "01");
|
||||
dtl.put("work_type_name", "休息日");
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (row.getString("is_tue").equals("1")) {
|
||||
dtl.put("factorydate_type", "01");
|
||||
dtl.put("work_type", "00");
|
||||
dtl.put("work_type_name", "工作日");
|
||||
dtl.put("priority", "50");
|
||||
} else {
|
||||
dtl.put("factorydate_type", "03");
|
||||
dtl.put("work_type", "01");
|
||||
dtl.put("work_type_name", "休息日");
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (row.getString("is_wed").equals("1")) {
|
||||
dtl.put("factorydate_type", "01");
|
||||
dtl.put("work_type", "00");
|
||||
dtl.put("work_type_name", "工作日");
|
||||
dtl.put("priority", "50");
|
||||
} else {
|
||||
dtl.put("factorydate_type", "03");
|
||||
dtl.put("work_type", "01");
|
||||
dtl.put("work_type_name", "休息日");
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (row.getString("is_thu").equals("1")) {
|
||||
dtl.put("factorydate_type", "01");
|
||||
dtl.put("work_type", "00");
|
||||
dtl.put("work_type_name", "工作日");
|
||||
dtl.put("priority", "50");
|
||||
} else {
|
||||
dtl.put("factorydate_type", "03");
|
||||
dtl.put("work_type", "01");
|
||||
dtl.put("work_type_name", "休息日");
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (row.getString("is_fri").equals("1")) {
|
||||
dtl.put("factorydate_type", "01");
|
||||
dtl.put("work_type", "00");
|
||||
dtl.put("work_type_name", "工作日");
|
||||
dtl.put("priority", "50");
|
||||
} else {
|
||||
dtl.put("factorydate_type", "03");
|
||||
dtl.put("work_type", "01");
|
||||
dtl.put("work_type_name", "休息日");
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (row.getString("is_sau").equals("1")) {
|
||||
dtl.put("factorydate_type", "01");
|
||||
dtl.put("work_type", "00");
|
||||
dtl.put("work_type_name", "工作日");
|
||||
dtl.put("priority", "50");
|
||||
} else {
|
||||
dtl.put("factorydate_type", "03");
|
||||
dtl.put("work_type", "01");
|
||||
dtl.put("work_type_name", "休息日");
|
||||
}
|
||||
break;
|
||||
}
|
||||
WQLObject.getWQLObject("PDM_BI_FactoryCalendarDtl").insert(dtl);
|
||||
a = DateUtil.format(DateUtil.offsetDay(DateUtil.parse(a), 1), "yyyy/MM/dd");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Long[] ids) {
|
||||
String currentUserId = SecurityUtils.getCurrentUserId();
|
||||
String nickName = SecurityUtils.getCurrentNickName();
|
||||
|
||||
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_factorycalendardtl");
|
||||
for (Long factorycalendardtl_id : ids) {
|
||||
WQLObject wo = WQLObject.getWQLObject("pdm_bi_factorycalendar");
|
||||
for (Long factorycalendar_id : ids) {
|
||||
JSONObject param = new JSONObject();
|
||||
param.put("factorycalendardtl_id", String.valueOf(factorycalendardtl_id));
|
||||
param.put("factorycalendar_id", String.valueOf(factorycalendar_id));
|
||||
param.put("is_delete", "1");
|
||||
param.put("update_optid", currentUserId);
|
||||
param.put("update_optname", nickName);
|
||||
@@ -120,25 +240,25 @@ public class FactoryCalendarServiceImpl implements FactoryCalendarService {
|
||||
WQLObject.getWQLObject("PDM_BI_FactoryCalendar").update(map, "factorycalendar_id = '" + factorycalendar_id + "'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray queryDtl(JSONObject whereJson) {
|
||||
String year = whereJson.getString("year");
|
||||
String factorycalendar_id = whereJson.getString("factorycalendar_id");
|
||||
JSONArray rows = WQLObject.getWQLObject("PDM_BI_FactoryCalendarDtl").query("factory_date like '" + year + "%' AND factorycalendar_id = '" + factorycalendar_id + "'").getResultJSONArray(0);
|
||||
return rows;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateDtlStatus(JSONObject whereJson) {
|
||||
String holidayType = whereJson.getString("holidayType");
|
||||
String holidayDate = whereJson.getString("holidayDate");
|
||||
|
||||
|
||||
String holidayType =whereJson.getString("holidayType");
|
||||
String holidayDate =DateUtil.format(DateUtil.parse( whereJson.getString("holidayDate")), "yyyy/MM/dd");
|
||||
String factorycalendar_id = whereJson.getString("factorycalendar_id");
|
||||
HashMap<String, String> map = new HashMap<>();
|
||||
map.put("work_type", holidayType);
|
||||
if (holidayType.equals("00")) {
|
||||
map.put("factorydate_type", "01");
|
||||
map.put("priority", "50");
|
||||
map.put("work_type_name", "工作日");
|
||||
} else {
|
||||
map.put("factorydate_type", "03");
|
||||
map.put("priority", "100");
|
||||
map.put("work_type_name", "休息日");
|
||||
}
|
||||
WQLObject.getWQLObject("PDM_BI_FactoryCalendarDtl").update(map, "factorycalendar_id = '" + factorycalendar_id + "' AND factory_date = '" + holidayDate + "'");
|
||||
}
|
||||
@@ -156,83 +276,4 @@ public class FactoryCalendarServiceImpl implements FactoryCalendarService {
|
||||
WQLObject.getWQLObject("PDM_BI_FactoryCalendar").update(whereJson);
|
||||
}
|
||||
|
||||
public void insertDtl(JSONObject row) {
|
||||
String a = row.getString("factorycale_startdate");
|
||||
String endfactory_year = row.getString("endfactory_year");
|
||||
String b = endfactory_year + "-12-31";
|
||||
while (!a.equals(b)) {
|
||||
JSONObject dtl = new JSONObject();
|
||||
dtl.put("factorycalendardtl_id", IdUtil.getSnowflake(1, 1).nextId() + "");
|
||||
dtl.put("factorycalendar_id", row.getString("factorycalendar_id"));
|
||||
dtl.put("factory_date", a);
|
||||
int dayOfWeek = DateUtil.dayOfWeek(DateUtil.parse(a));
|
||||
switch (dayOfWeek) {
|
||||
case 1:
|
||||
if (row.getString("is_sun").equals("1")) {
|
||||
dtl.put("factorydate_type", "01");
|
||||
dtl.put("work_type", "00");
|
||||
} else {
|
||||
dtl.put("factorydate_type", "03");
|
||||
dtl.put("work_type", "01");
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (row.getString("is_mon").equals("1")) {
|
||||
dtl.put("factorydate_type", "01");
|
||||
dtl.put("work_type", "00");
|
||||
} else {
|
||||
dtl.put("factorydate_type", "03");
|
||||
dtl.put("work_type", "01");
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (row.getString("is_tue").equals("1")) {
|
||||
dtl.put("factorydate_type", "01");
|
||||
dtl.put("work_type", "00");
|
||||
} else {
|
||||
dtl.put("factorydate_type", "03");
|
||||
dtl.put("work_type", "01");
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (row.getString("is_wed").equals("1")) {
|
||||
dtl.put("factorydate_type", "01");
|
||||
dtl.put("work_type", "00");
|
||||
} else {
|
||||
dtl.put("factorydate_type", "03");
|
||||
dtl.put("work_type", "01");
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (row.getString("is_thu").equals("1")) {
|
||||
dtl.put("factorydate_type", "01");
|
||||
dtl.put("work_type", "00");
|
||||
} else {
|
||||
dtl.put("factorydate_type", "03");
|
||||
dtl.put("work_type", "01");
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
if (row.getString("is_fri").equals("1")) {
|
||||
dtl.put("factorydate_type", "01");
|
||||
dtl.put("work_type", "00");
|
||||
} else {
|
||||
dtl.put("factorydate_type", "03");
|
||||
dtl.put("work_type", "01");
|
||||
}
|
||||
break;
|
||||
case 7:
|
||||
if (row.getString("is_sau").equals("1")) {
|
||||
dtl.put("factorydate_type", "01");
|
||||
dtl.put("work_type", "00");
|
||||
} else {
|
||||
dtl.put("factorydate_type", "03");
|
||||
dtl.put("work_type", "01");
|
||||
}
|
||||
break;
|
||||
}
|
||||
WQLObject.getWQLObject("PDM_BI_FactoryCalendarDtl").insert(dtl);
|
||||
a = DateUtil.format(DateUtil.offsetDay(DateUtil.parse(a), 1), "yyyy-MM-dd");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
## 表字段对应输入参数
|
||||
#################################################
|
||||
输入.flag TYPEAS s_string
|
||||
输入.id TYPEAS s_string
|
||||
输入.date TYPEAS s_string
|
||||
输入.search TYPEAS s_string
|
||||
输入.processroute_code TYPEAS s_string
|
||||
|
||||
@@ -50,7 +52,7 @@
|
||||
FROM
|
||||
pdm_bi_factorycalendar dar
|
||||
WHERE
|
||||
1=1
|
||||
dar.is_delete = '0'
|
||||
OPTION 输入.search <> ""
|
||||
(dar.factorycalendar_code like 输入.search or
|
||||
dar.factorycalendar_name like 输入.search)
|
||||
@@ -59,6 +61,28 @@
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
IF 输入.flag = "2"
|
||||
PAGEQUERY
|
||||
SELECT
|
||||
T0.FACTORYCALENDARDTL_ID,
|
||||
T0.FACTORYCALENDAR_ID,
|
||||
DATE_FORMAT(T0.FACTORY_DATE, '%Y-%m-%d') AS FACTORY_DATE,
|
||||
T0.FACTORYDATE_TYPE,
|
||||
T0.WORK_TYPE,
|
||||
T0.WORK_TYPE_NAME,
|
||||
T0.RESOURCE,
|
||||
T0.PRIORITY
|
||||
FROM
|
||||
PDM_BI_FACTORYCALENDARDTL T0
|
||||
WHERE 1=1
|
||||
OPTION 输入.date <> ""
|
||||
(T0.FACTORY_DATE LIKE 输入.date)
|
||||
ENDOPTION
|
||||
OPTION 输入.id <> ""
|
||||
T0.FACTORYCALENDAR_ID = 输入.id
|
||||
ENDOPTION
|
||||
ENDSELECT
|
||||
ENDPAGEQUERY
|
||||
ENDIF
|
||||
|
||||
|
||||
|
||||
@@ -23,11 +23,11 @@ spring:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.5}:${DB_PORT:3306}/${DB_NAME:hl_one_mes_test}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_one_mes_xc}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:zjhl_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_one_mes_xc}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:zjhl_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:Root.123456}
|
||||
password: ${DB_PWD:root}
|
||||
password: ${DB_PWD:Root.123456}
|
||||
# password: ${DB_PWD:root}
|
||||
|
||||
# 初始连接数
|
||||
initial-size: 5
|
||||
|
||||
@@ -1,203 +0,0 @@
|
||||
server:
|
||||
port: 8011
|
||||
#配置数据源
|
||||
spring:
|
||||
data:
|
||||
elasticsearch:
|
||||
repositories:
|
||||
enabled: true
|
||||
client:
|
||||
reactive:
|
||||
#endpoints: 172.31.185.110:8200,172.31.154.9:8200 #内网
|
||||
# endpoints: 47.96.133.178:8200 #外网
|
||||
endpoints: http://127.0.0.1:9200 #外网
|
||||
elasticsearch:
|
||||
rest:
|
||||
#uris: 172.31.185.110:8200,172.31.154.9:8200 #内网
|
||||
# uris: 47.96.133.178:8200 #外网
|
||||
uris: http://127.0.0.1:9200 #外网
|
||||
# username: elastic
|
||||
# password: 123456
|
||||
datasource:
|
||||
druid:
|
||||
db-type: com.alibaba.druid.pool.DruidDataSource
|
||||
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.5}:${DB_PORT:3306}/${DB_NAME:hl_one_mes_test}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.5}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
url: jdbc:log4jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
|
||||
username: ${DB_USER:root}
|
||||
# password: ${DB_PWD:123456}
|
||||
password: ${DB_PWD:942464Yy}
|
||||
|
||||
# 初始连接数
|
||||
initial-size: 5
|
||||
# 最小连接数
|
||||
min-idle: 15
|
||||
# 最大连接数
|
||||
max-active: 30
|
||||
# 是否自动回收超时连接
|
||||
remove-abandoned: true
|
||||
# 超时时间(以秒数为单位)
|
||||
remove-abandoned-timeout: 180
|
||||
# 获取连接超时时间
|
||||
max-wait: 3000
|
||||
# 连接有效性检测时间
|
||||
time-between-eviction-runs-millis: 60000
|
||||
# 连接在池中最小生存的时间
|
||||
min-evictable-idle-time-millis: 300000
|
||||
# 连接在池中最大生存的时间
|
||||
max-evictable-idle-time-millis: 900000
|
||||
# 指明连接是否被空闲连接回收器(如果有)进行检验.如果检测失败,则连接将被从池中去除
|
||||
test-while-idle: true
|
||||
# 指明是否在从池中取出连接前进行检验,如果检验失败, 则从池中去除连接并尝试取出另一个
|
||||
test-on-borrow: true
|
||||
# 是否在归还到池中前进行检验
|
||||
test-on-return: false
|
||||
# 检测连接是否有效
|
||||
validation-query: select 1
|
||||
# 配置监控统计
|
||||
webStatFilter:
|
||||
enabled: true
|
||||
stat-view-servlet:
|
||||
enabled: true
|
||||
url-pattern: /druid/*
|
||||
reset-enable: false
|
||||
filters:
|
||||
DruidFilter,stat
|
||||
|
||||
redis:
|
||||
#数据库索引
|
||||
database: ${REDIS_DB:1}
|
||||
#host: ${REDIS_HOST:127.0.0.1}
|
||||
host: ${REDIS_HOST:localhost}
|
||||
port: ${REDIS_PORT:6379}
|
||||
password: ${REDIS_PWD:}
|
||||
#连接超时时间
|
||||
timeout: 5000
|
||||
redisson:
|
||||
config: |
|
||||
threads: 4
|
||||
nettyThreads: 4
|
||||
singleServerConfig:
|
||||
connectionMinimumIdleSize: 8
|
||||
connectionPoolSize: 8
|
||||
address: redis://127.0.0.1:6379
|
||||
idleConnectionTimeout: 10000
|
||||
timeout: 3000
|
||||
# 登录相关配置
|
||||
login:
|
||||
# 登录缓存
|
||||
cache-enable: true
|
||||
# 是否限制单用户登录
|
||||
single-login: false
|
||||
# 验证码
|
||||
login-code:
|
||||
# 验证码类型配置 查看 LoginProperties 类
|
||||
code-type: arithmetic
|
||||
# 登录图形验证码有效时间/分钟
|
||||
expiration: 2
|
||||
# 验证码高度
|
||||
width: 111
|
||||
# 验证码宽度
|
||||
heigth: 36
|
||||
# 内容长度
|
||||
length: 2
|
||||
# 字体名称,为空则使用默认字体
|
||||
font-name:
|
||||
# 字体大小
|
||||
font-size: 25
|
||||
|
||||
#jwt
|
||||
jwt:
|
||||
header: Authorization
|
||||
# 令牌前缀
|
||||
token-start-with: Bearer
|
||||
# 必须使用最少88位的Base64对该令牌进行编码
|
||||
base64-secret: ZmQ0ZGI5NjQ0MDQwY2I4MjMxY2Y3ZmI3MjdhN2ZmMjNhODViOTg1ZGE0NTBjMGM4NDA5NzYxMjdjOWMwYWRmZTBlZjlhNGY3ZTg4Y2U3YTE1ODVkZDU5Y2Y3OGYwZWE1NzUzNWQ2YjFjZDc0NGMxZWU2MmQ3MjY1NzJmNTE0MzI=
|
||||
# 令牌过期时间 此处单位/毫秒 ,默认4小时,可在此网站生成 https://www.convertworld.com/zh-hans/time/milliseconds.html
|
||||
token-validity-in-seconds: 14400000
|
||||
# 在线用户key
|
||||
online-key: online-token-
|
||||
# 验证码
|
||||
code-key: code-key-
|
||||
# token 续期检查时间范围(默认30分钟,单位毫秒),在token即将过期的一段时间内用户操作了,则给用户的token续期
|
||||
detect: 1800000
|
||||
# 续期时间范围,默认1小时,单位毫秒
|
||||
renew: 3600000
|
||||
|
||||
#是否允许生成代码,生产环境设置为false
|
||||
generator:
|
||||
enabled: true
|
||||
|
||||
#是否开启 swagger-ui
|
||||
swagger:
|
||||
enabled: true
|
||||
|
||||
# IP 本地解析
|
||||
ip:
|
||||
local-parsing: true
|
||||
|
||||
# 文件存储路径
|
||||
file:
|
||||
mac:
|
||||
path: ~/file/
|
||||
avatar: ~/avatar/
|
||||
linux:
|
||||
path: /home/eladmin/file/
|
||||
avatar: /home/eladmin/avatar/
|
||||
windows:
|
||||
path: C:\eladmin\file\
|
||||
avatar: C:\eladmin\avatar\
|
||||
# 文件大小 /M
|
||||
maxSize: 100
|
||||
avatarMaxSize: 5
|
||||
|
||||
sa-token:
|
||||
# token 名称 (同时也是cookie名称)
|
||||
token-name: Authorization
|
||||
# token 有效期,单位s 默认30天, -1代表永不过期
|
||||
timeout: 2592000
|
||||
# token 临时有效期 (指定时间内无操作就视为token过期) 单位: 秒
|
||||
activity-timeout: -1
|
||||
# 是否允许同一账号并发登录 (为true时允许一起登录, 为false时新登录挤掉旧登录)
|
||||
is-concurrent: true
|
||||
# 在多人登录同一账号时,是否共用一个token (为true时所有登录共用一个token, 为false时每次登录新建一个token)
|
||||
is-share: false
|
||||
# token风格
|
||||
token-style: random-128
|
||||
# 是否输出操作日志
|
||||
is-log: false
|
||||
jwt-secret-key: opsjajisdnnca0sdkksdfaaasdfwwq
|
||||
# token 前缀
|
||||
token-prefix:
|
||||
cookie:
|
||||
# 配置 Cookie 作用域:根据二级域名实现sso登入如lms.sso.com;acs.sso.com
|
||||
domain:
|
||||
is-read-cookie: false
|
||||
|
||||
#jetcache:
|
||||
# defaultCacheType: LOCAL
|
||||
# statIntervalMinutes: 15
|
||||
# areaInCacheName: false
|
||||
# hiddenPackages: com.yb
|
||||
# local:
|
||||
# default:
|
||||
# type: caffeine
|
||||
# limit: 100
|
||||
# keyConvertor: fastjson
|
||||
# expireAfterWriteInMillis: 60000
|
||||
# remote:
|
||||
# default:
|
||||
# type: redis.lettuce
|
||||
# keyConvertor: fastjson
|
||||
# valueEncoder: kryo
|
||||
# valueDecoder: kryo
|
||||
# poolConfig:
|
||||
# minIdle: 5
|
||||
# maxIdle: 200
|
||||
# maxTotal: 1000
|
||||
# uri:
|
||||
# - redis://127.0.0.1:6379
|
||||
es:
|
||||
index: mes_log
|
||||
schedulerFile: /Users/mima0000/Desktop/scheduler.xml
|
||||
Reference in New Issue
Block a user