mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-13 13:22:07 +08:00
Merge remote-tracking branch 'origin/main'
# Conflicts: # cf-module-prod-manage/cf-module-prod-manage-biz/pom.xml # cf-module-prod-manage/cf-module-prod-manage-biz/src/main/java/com/cf/imes/module/manage/controller/admin/test/TestController.java
This commit is contained in:
+19
-4
@@ -4,6 +4,7 @@ import com.cf.imes.framework.es.core.valid.CreateGroup;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
@@ -15,8 +16,8 @@ public class PlanSaveReqVO {
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12776")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "排单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String planNo;
|
||||
/*@Schema(description = "排单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String planNo;*/
|
||||
|
||||
@Schema(description = "排序优先级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
//@NotNull(groups = CreateGroup.class,message = "排序优先级不能为空")
|
||||
@@ -45,8 +46,11 @@ public class PlanSaveReqVO {
|
||||
/*@Schema(description = "生产单id列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private List<Long> orderIds;*/
|
||||
|
||||
@Schema(description = "板件id列表")
|
||||
private List<Long> plateIds;
|
||||
/*@Schema(description = "板件id列表")
|
||||
private List<Long> plateIds;*/
|
||||
|
||||
@Schema(description = "生产单id与商品id 列表")
|
||||
private List<Item> itemList;
|
||||
|
||||
@Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED, example = "你说的对")
|
||||
private String remark;
|
||||
@@ -58,4 +62,15 @@ public class PlanSaveReqVO {
|
||||
@Schema(description = "生产时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "生产时间不能为空", groups = CreateGroup.class)
|
||||
private LocalDateTime produceTime;
|
||||
|
||||
@Valid
|
||||
@Data
|
||||
public static class Item {
|
||||
@Schema(description = "生产单id")
|
||||
@NotNull
|
||||
private Long orderId;
|
||||
@Schema(description = "商品id")
|
||||
@NotNull
|
||||
private Long goodsId;
|
||||
}
|
||||
}
|
||||
+3
@@ -10,6 +10,7 @@ import com.cf.imes.framework.common.pojo.PageResult;
|
||||
import com.cf.imes.framework.common.util.object.BeanUtils;
|
||||
import com.cf.imes.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.cf.imes.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlanSaveReqVO;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlatePage;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateParam;
|
||||
import com.cf.imes.module.executor.controller.admin.plan.vo.PlateResList;
|
||||
@@ -88,4 +89,6 @@ public interface PlateMapper extends BaseMapperX<PlateDO> {
|
||||
}
|
||||
|
||||
IPage<PlateRespVO> selectProductList(@Param("page") IPage<PlateRespVO> page , @Param("orderId")Long orderId, @Param("roomId")Long roomId , @Param("bodyId")Long bodyId);
|
||||
|
||||
Set<Long> selectBatchOrderIdsAndGoodsIds(@Param("itemList") List<PlanSaveReqVO.Item> itemList);
|
||||
}
|
||||
+9
-1
@@ -2,6 +2,7 @@ package com.cf.imes.module.executor.service.plan;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.incrementer.IdentifierGenerator;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
@@ -84,6 +85,9 @@ public class PlanServiceImpl implements PlanService {
|
||||
@Resource
|
||||
private OrderBodyMapper orderBodyMapper;
|
||||
|
||||
@Resource
|
||||
private IdentifierGenerator identifierGenerator;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long createPlan(PlanSaveReqVO createReqVO) {
|
||||
@@ -92,6 +96,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
PlanDO plan = BeanUtils.toBean(createReqVO, PlanDO.class);
|
||||
plan.setIsPay(Boolean.FALSE);
|
||||
plan.setSort(sort);
|
||||
plan.setPlanNo(identifierGenerator.nextId(null).toString());
|
||||
planMapper.insert(plan);
|
||||
Long planId = plan.getId();
|
||||
/* List<Long> orderIds = createReqVO.getOrderIds();
|
||||
@@ -105,7 +110,10 @@ public class PlanServiceImpl implements PlanService {
|
||||
}
|
||||
planOrderMapper.insertBatch(planOrderDOS);
|
||||
}*/
|
||||
List<Long> plateIds = createReqVO.getPlateIds();
|
||||
//List<Long> plateIds = createReqVO.getPlateIds();
|
||||
List<PlanSaveReqVO.Item> itemList = createReqVO.getItemList();
|
||||
Set<Long> plateIds = plateMapper.selectBatchOrderIdsAndGoodsIds(itemList);
|
||||
|
||||
if (CollectionUtil.isNotEmpty(plateIds)) {
|
||||
ArrayList<PlanItemDO> planItemDOS = new ArrayList<>();
|
||||
for (Long plateId : plateIds) {
|
||||
|
||||
+8
@@ -55,4 +55,12 @@
|
||||
AND (#{bodyId} IS NULL OR b.body_id = #{bodyId})
|
||||
GROUP BY a.id, c.material, c.color;
|
||||
</select>
|
||||
|
||||
<select id="selectBatchOrderIdsAndGoodsIds" resultType="java.lang.Long">
|
||||
select id from order_plate
|
||||
where ( order_id, goods_id ) in
|
||||
<foreach collection="itemList" item="item" open="(" close=")" separator=",">
|
||||
(#{item.orderId},#{item.goodsId})
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
+112
@@ -70,8 +70,120 @@ public class TestController {
|
||||
}
|
||||
|
||||
|
||||
public class JacobTestController {
|
||||
/* *
|
||||
* 语音转文字并播放
|
||||
*
|
||||
* @param text
|
||||
*/
|
||||
private static void convertTextToSpeech(String text) {
|
||||
|
||||
|
||||
try {
|
||||
|
||||
//jacob.dll没成功安装,执行这一步会出错
|
||||
//构建音频格式 调用注册表应用
|
||||
Dispatch spAudioFormat = new ActiveXComponent("Sapi.SpAudioFormat").getObject();
|
||||
//音频文件输出流
|
||||
Dispatch spFileStream = new ActiveXComponent("Sapi.SpFileStream").getObject();
|
||||
//构建音频对象
|
||||
Dispatch spVoice = new ActiveXComponent("Sapi.SpVoice").getObject();
|
||||
|
||||
//设置spAudioFormat音频流格式类型22
|
||||
Dispatch.put(spAudioFormat, "Type", new Variant(22));
|
||||
//设置spFileStream文件输出流的音频格式
|
||||
Dispatch.putRef(spFileStream, "Format", spAudioFormat);
|
||||
|
||||
//设置spFileStream文件输出流参数地址等
|
||||
Dispatch.call(spFileStream, "Open", new Variant("E:AAAAA\48641486.wav"), new Variant(3), new Variant(true));
|
||||
//设置spVoice声音对象的音频输出流为输出文件对象
|
||||
Dispatch.putRef(spVoice, "AudioOutputStream", spFileStream);
|
||||
//设置spVoice声音对象的音量大小100
|
||||
Dispatch.put(spVoice, "Volume", new Variant(100));
|
||||
//设置spVoice声音对象的速度 0为正常速度,范围【..-2 -1 0 1 2..】
|
||||
Dispatch.put(spVoice, "Rate", new Variant(0));
|
||||
//设置spVoice声音对象中的文本内容
|
||||
Dispatch.call(spVoice, "Speak", new Variant(text));
|
||||
//关闭spFileStream输出文件
|
||||
Dispatch.call(spFileStream, "Close");
|
||||
|
||||
//释放资源
|
||||
spVoice.safeRelease();
|
||||
spAudioFormat.safeRelease();
|
||||
spFileStream.safeRelease();
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println(e.getMessage());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/* private static XxlJobProperties aabb(){
|
||||
|
||||
XxlJobParameter xxlJobParameter = new XxlJobParameter();
|
||||
|
||||
xxlJobParameter.setEnabled(false);
|
||||
xxlJobParameter.setAccessToken("1122");
|
||||
xxlJobParameter.setAddresses("五阿里乌");
|
||||
xxlJobParameter.setAppName("aaappn");
|
||||
XxlJobProperties bean = BeanUtils.toBean(xxlJobParameter, XxlJobProperties.class);
|
||||
return bean;
|
||||
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void deleteFiles(List<String> filePaths) {
|
||||
// 检查文件路径集合是否为空
|
||||
if (filePaths == null || filePaths.isEmpty()) {
|
||||
System.out.println("文件路径集合为空");
|
||||
return;
|
||||
}
|
||||
|
||||
for (String filePath : filePaths) {
|
||||
// 检查文件路径是否为空
|
||||
if (filePath == null || filePath.isEmpty()) {
|
||||
System.out.println("文件路径为空");
|
||||
continue;
|
||||
}
|
||||
|
||||
File file = new File(filePath);
|
||||
|
||||
// 检查文件是否存在
|
||||
if (!file.exists()) {
|
||||
System.out.println("文件不存在:" + filePath);
|
||||
continue;
|
||||
}
|
||||
|
||||
// 检查是否是文件
|
||||
if (!file.isFile()) {
|
||||
System.out.println("路径指向的不是文件:" + filePath);
|
||||
continue;
|
||||
}
|
||||
|
||||
// 尝试删除文件
|
||||
if (file.delete()) {
|
||||
System.out.println("文件删除成功:" + filePath);
|
||||
} else {
|
||||
System.out.println("文件删除失败:" + filePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static Integer aacc(){
|
||||
|
||||
RedisTemplate<Object, Object> re = new RedisTemplate<>();
|
||||
|
||||
int randomInt = new Random(System.currentTimeMillis()).nextInt(900) + 100;// 生成100到999之间的随机数
|
||||
|
||||
|
||||
|
||||
return randomInt;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@TestOnly
|
||||
|
||||
Reference in New Issue
Block a user