Merge remote-tracking branch 'remotes/origin/dev' into test

yun-zuoyi
汪云昊 6 years ago
commit eb2a68144c

@ -40,6 +40,11 @@
<artifactId>i3plus-icloud-form</artifactId>
</dependency>
<dependency>
<groupId>i3plus.icloud</groupId>
<artifactId>i3plus-icloud-softswitch</artifactId>
</dependency>
<!-- 对象 -->
<dependency>
<groupId>i3plus.pojo</groupId>

@ -19,7 +19,10 @@ import cn.estsh.impp.framework.base.controller.CoreBaseController;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.util.*;
import cn.estsh.impp.framework.boot.util.ImppRedis;
import cn.estsh.impp.framework.boot.util.LocaleUtils;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
@ -31,10 +34,7 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @Description :
@ -252,13 +252,13 @@ public class WhiteController extends CoreBaseController {
.notNull("fileOriginalName", sysFile.getFileOriginalName());
// 文件类型验证
SysDictionary dictionary = dictionaryService.getSysDictionaryByParentCodeAndCode(BaseConstWords.DICTIONARY_FILE_TYPE,
StringTool.getStringFileSuffix(sysFile.getFileOriginalName(), false));
SysDictionary dictionary = dictionaryService.getSysDictionaryByParentCodeAndValue(BaseConstWords.DICTIONARY_FILE_TYPE,
StringTool.getStringFileSuffix(sysFile.getFileOriginalName(), true));
if(dictionary == null){
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_FORMAT.getCode())
.setErrorDetail("文件格式不支持")
.setErrorDetail("文件格式不支持 %s",sysFile.getFileOriginalName())
.setErrorSolution("请到字典管理中添加文件类型")
.build();
}
@ -392,16 +392,27 @@ public class WhiteController extends CoreBaseController {
}
}
@GetMapping("/sys-organize/enum")
@ApiOperation(value = "获取全部组织", notes = "获取全部组织")
public ResultBean getEnum(){
/**
*
* @return
*/
@PostMapping(value = "/locale-resource/no-resource")
@ApiOperation(value = "查询未翻译的资源",notes = "查询未翻译的资源")
public ResultBean<SysLabelTemplate> findSysConfigAll(){
try {
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode()).setResultList(Arrays.asList(CommonEnumUtil.IS_VAILD.values()));
Set<String> keys = redisRes.getKeysSet(CommonConstWords.REDIS_PREFIX_CACHE_NO_RES+"*");
List<String> list = new ArrayList<>();
for (String key : keys) {
list.add(redisRes.getObject(key).toString());
}
return ResultBean.success("操作成功")
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode())
.setResultList(list);
}catch(ImppBusiException busExcep){
return ResultBean.fail(busExcep);
}catch(Exception e){
return ImppExceptionBuilder.newInstance().buildExceptionResult(e);
}
}
}

@ -19,13 +19,20 @@ import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.fastdfs.FastDFSClient;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
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;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream;
@ -218,7 +225,7 @@ public class SysFileController extends CoreBaseController{
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_FORMAT.getCode())
.setErrorDetail("文件格式不支持")
.setErrorDetail("文件格式不支持 %s",file.getOriginalFilename())
.setErrorSolution("请到字典管理中添加文件类型")
.build();
}
@ -256,7 +263,7 @@ public class SysFileController extends CoreBaseController{
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_FORMAT.getCode())
.setErrorDetail("文件格式不支持")
.setErrorDetail("文件格式不支持 %s",file.getOriginalFilename())
.setErrorSolution("请到字典管理中添加文件类型")
.build();
}
@ -365,7 +372,7 @@ public class SysFileController extends CoreBaseController{
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.VARIFY_EXCEPTION_FORMAT.getCode())
.setErrorDetail("文件格式不支持")
.setErrorDetail("文件格式不支持 %s",sysFile.getFileOriginalName())
.setErrorSolution("请到字典管理中添加文件类型")
.build();
}

@ -7,6 +7,7 @@ import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import cn.estsh.i3plus.pojo.model.platform.LabelTemplatePagerModel;
import cn.estsh.i3plus.pojo.platform.bean.SessionUser;
import cn.estsh.i3plus.pojo.platform.bean.SysLabelTemplate;
import cn.estsh.impp.framework.base.controller.CoreBaseController;
@ -21,8 +22,14 @@ import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
@ -58,7 +65,9 @@ public class SysLabelTemplateController extends CoreBaseController {
.notNull("templateCode", sysLabelTemplate.getTemplateCode())
.notNull("templateName", sysLabelTemplate.getTemplateName())
.notNull("paramsPack", sysLabelTemplate.getParamsPack())
.notNull("templateContent", sysLabelTemplate.getTemplateContent());
.notNull("templateContent", sysLabelTemplate.getTemplateContent())
.notNull("templateSoftType", sysLabelTemplate.getTemplateSoftType())
.notNull("templateGroupId", sysLabelTemplate.getTemplateGroupId());
//修改初始化
ConvertBean.modelInitialize(sysLabelTemplate, user);
@ -120,7 +129,9 @@ public class SysLabelTemplateController extends CoreBaseController {
.notNull("templateCode", sysLabelTemplate.getTemplateCode())
.notNull("templateName", sysLabelTemplate.getTemplateName())
.notNull("paramsPack", sysLabelTemplate.getParamsPack())
.notNull("templateContent", sysLabelTemplate.getTemplateContent());
.notNull("templateContent", sysLabelTemplate.getTemplateContent())
.notNull("templateSoftType", sysLabelTemplate.getTemplateSoftType())
.notNull("templateGroupId", sysLabelTemplate.getTemplateGroupId());
//添加初始化
ConvertBean.modelUpdate(sysLabelTemplate, user);
@ -205,7 +216,7 @@ public class SysLabelTemplateController extends CoreBaseController {
*/
@GetMapping("/query")
@ApiOperation(value = "打印模板复杂查询,分页,排序",notes = "打印模板复杂查询,分页,排序")
public ResultBean querySysLabelTemplateByPager(SysLabelTemplate sysLabelTemplate,Pager pager) {
public ResultBean<SysLabelTemplate> querySysLabelTemplateByPager(SysLabelTemplate sysLabelTemplate,Pager pager) {
try {
ListPager sysConfigListPager = sysLabelTemplateService.querySysLabelTemplateByPager(sysLabelTemplate,pager);
return ResultBean.success("操作成功").setListPager(sysConfigListPager).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
@ -217,6 +228,17 @@ public class SysLabelTemplateController extends CoreBaseController {
}
/**
*
* @param labelTemplatePagerModel ,
* @return
*/
@PostMapping("/cloud-query")
@ApiOperation(value = "微服务打印模板复杂查询,分页,排序",notes = "微服务打印模板复杂查询,分页,排序")
public ResultBean<SysLabelTemplate> querySysLabelTemplateByPager(@RequestBody LabelTemplatePagerModel labelTemplatePagerModel) {
return querySysLabelTemplateByPager(labelTemplatePagerModel.getLabelTemplate(), labelTemplatePagerModel.getPager());
}
/**
*
* @param id id
* @return

@ -4,7 +4,9 @@ import cn.estsh.i3plus.core.api.iservice.busi.ISysTaskService;
import cn.estsh.i3plus.icloud.andon.sdk.IAndonCommonCloud;
import cn.estsh.i3plus.icloud.mes.pcn.sdk.IMesPcnCommonCloud;
import cn.estsh.i3plus.icloud.mes.sdk.IMesCommonCloud;
import cn.estsh.i3plus.icloud.softswitch.sdk.IBsCommonCloud;
import cn.estsh.i3plus.icloud.wms.sdk.IWmsCommonCloud;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.tool.StringTool;
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
import cn.estsh.i3plus.pojo.base.bean.BaseResultBean;
@ -19,7 +21,6 @@ import cn.estsh.impp.framework.base.service.ICommonService;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.Api;
@ -27,8 +28,13 @@ import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
@ -63,6 +69,9 @@ public class SysTaskController extends CoreBaseController {
@Autowired
private IAndonCommonCloud andonCommonCloud;
@Autowired
private IBsCommonCloud bsCommonCloud;
/**
*
* @param softType
@ -86,6 +95,9 @@ public class SysTaskController extends CoreBaseController {
// ANDON
} else if (softType == CommonEnumUtil.SOFT_TYPE.ANDON.getValue()) {
commonService = andonCommonCloud;
// SoftSwitch
} else if (softType == CommonEnumUtil.SOFT_TYPE.SOFTSWITCH.getValue()) {
commonService = bsCommonCloud;
}
return commonService;
}

@ -6,6 +6,7 @@ import cn.estsh.i3plus.core.api.iservice.busi.ISysTaskService;
import cn.estsh.i3plus.icloud.andon.sdk.IAndonScheduleJobCloud;
import cn.estsh.i3plus.icloud.mes.pcn.sdk.IMesPcnScheduleJobCloud;
import cn.estsh.i3plus.icloud.mes.sdk.IMesScheduleJobCloud;
import cn.estsh.i3plus.icloud.softswitch.sdk.IBsScheduleJobCloud;
import cn.estsh.i3plus.icloud.wms.sdk.IWmsScheduleJobCloud;
import cn.estsh.i3plus.platform.common.exception.ImppExceptionEnum;
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
@ -73,6 +74,9 @@ public class SysTaskPlanController extends CoreBaseController {
@Autowired
private IAndonScheduleJobCloud andonScheduleJobCloud;
@Autowired
private IBsScheduleJobCloud bsScheduleJobCloud;
/**
*
*
@ -95,8 +99,11 @@ public class SysTaskPlanController extends CoreBaseController {
} else if (source == CommonEnumUtil.SOFT_TYPE.MES_PCN.getValue()) {
quartzJobService = mesPcnScheduleJobCloud;
// ANDON
} else if(source == CommonEnumUtil.SOFT_TYPE.ANDON.getValue()){
} else if (source == CommonEnumUtil.SOFT_TYPE.ANDON.getValue()) {
quartzJobService = andonScheduleJobCloud;
// SoftSwitch
} else if (source == CommonEnumUtil.SOFT_TYPE.SOFTSWITCH.getValue()) {
quartzJobService = bsScheduleJobCloud;
}
return quartzJobService;
}
@ -427,7 +434,7 @@ public class SysTaskPlanController extends CoreBaseController {
* @return
*/
@GetMapping(value = "/refresh/{id}")
@ApiOperation(value = "立即执行", notes = "立即执行")
@ApiOperation(value = "全部刷新", notes = "全部刷新")
public ResultBean refreshTaskPlan(boolean isSkipDisablePlan) {
try {
List<SysTaskPlan> sysTaskPlanList = sysTaskPlanService.listSysTaskPlan();

@ -4,6 +4,7 @@ import cn.estsh.i3plus.core.api.iservice.busi.ISysConfigService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysMessageService;
import cn.estsh.i3plus.core.api.iservice.busi.ISysUserService;
import cn.estsh.i3plus.core.apiservice.util.MailUtil;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.platform.common.tool.JsonUtilTool;
import cn.estsh.i3plus.platform.common.tool.TimeTool;
import cn.estsh.i3plus.platform.common.util.PlatformConstWords;
@ -21,7 +22,6 @@ import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.stereotype.Component;
import java.io.IOException;
/**
@ -61,7 +61,7 @@ public class MessageMailQueueReceiver {
if (msg.getMessageSendTime() == null) {
msg.setMessageSendTime(TimeTool.getNowTime(true));
}
ConvertBean.serviceModelInitialize(msg,msg.getMessageSenderNameRdd());
msg = sysMessageService.insertSysMessage(msg);
// 设置邮件主题内容及收件人
@ -75,7 +75,7 @@ public class MessageMailQueueReceiver {
// 判断是否为系统紧急提示 微服注册状态提示
mailUtil.setTo(sysConfigService.getSysConfigByCode(PlatformConstWords.CONTACT_MAIL).getConfigValue());
// 次数过于频繁
mailUtil.send();
mailUtil.send();
} else if (msg.getMessageReceiverType().intValue() == ImppEnumUtil.MESSAGE_RECEIVER_TYPE.EXTERNAL.getValue()) {
//判断是否为外部邮件
@ -118,9 +118,9 @@ public class MessageMailQueueReceiver {
LOGGER.error("【MQ-QUEUE_IMPP_MESSAGE_MAIL】处理出错{}", e.getMessage(), e);
//丢弃这条消息
try {
if(msg.getId() != null) {
sysMessageService.deleteSysMessageById(msg.getId());
}
// if(msg.getId() != null) {
// sysMessageService.deleteSysMessageById(msg.getId());
// }
// 未成功处理,重新发送
//channel.basicNack(message.getMessageProperties().getDeliveryTag(),false,true);
//todo 此处对邮件持久化,通过参数设置,是否还需要重复重新发送

@ -188,9 +188,9 @@ public class SysLabelTemplateService implements ISysLabelTemplateService {
pager = PagerHelper.getPager(pager, sysLabelTemplateRDao.listCount());
return new ListPager(sysLabelTemplateRDao.listPager(pager), pager);
} else {
String hqlPack = CoreHqlPack.packHqlSysLabelTemplate(sysLabelTemplate);
pager = PagerHelper.getPager(pager, sysLabelTemplateRDao.findByHqlWhereCount(hqlPack));
return new ListPager(sysLabelTemplateRDao.findByHqlWherePage(hqlPack + sysLabelTemplate.orderBy(), pager), pager);
DdlPackBean ddlPackBean = CoreHqlPack.packHqlSysLabelTemplate(sysLabelTemplate);
pager = PagerHelper.getPager(pager, sysLabelTemplateRDao.findByHqlWhereCount(ddlPackBean));
return new ListPager(sysLabelTemplateRDao.findByHqlWherePage(ddlPackBean, pager), pager);
}
}

@ -28,7 +28,7 @@ public class ResourceImportUtil {
public static void main(String[] args) {
File file = new File("C:\\Users\\yunha\\Desktop\\资源文件.xlsx");
File sql = new File("C:\\Users\\yunha\\Desktop\\imppRource.sql");
File sql = new File("C:\\Users\\yunha\\Desktop\\imppResource.sql");
int i = 1;
try {
FileWriter fileWritter = new FileWriter(sql,false);
@ -92,7 +92,7 @@ public class ResourceImportUtil {
sysLocaleResource.setResourceValue(row.getCell(3).getStringCellValue());
System.out.println(sql(sysLocaleResource));
if(isContainChinese(row.getCell(2).getStringCellValue())){
if(isContainChinese(row.getCell(3).getStringCellValue())){
bufferWritter.write(sql(sysLocaleResource));
}
@ -124,7 +124,7 @@ public class ResourceImportUtil {
sysLocaleResource.setResourceValue(row.getCell(3).getStringCellValue());
System.out.println(sql(sysLocaleResource));
if(isContainChinese(row.getCell(2).getStringCellValue())){
if(isContainChinese(row.getCell(3).getStringCellValue())){
bufferWritter.write(sql(sysLocaleResource));
}
@ -143,28 +143,34 @@ public class ResourceImportUtil {
Sheet enumSheet = wb.getSheet("ENUM");
i =1;
for (; i < enumSheet.getLastRowNum(); i++) {
row = wmsSheet.getRow(i);
row = enumSheet.getRow(i);
System.out.println(snowflakeIdMaker.nextId()+" ENUM 行:"+i);
// 模块
row.getCell(0).setCellType(CellType.STRING);
// 枚举名称
row.getCell(1).setCellType(CellType.STRING);
// 枚举项名称
row.getCell(2).setCellType(CellType.STRING);
// 国际化(汉)
row.getCell(3).setCellType(CellType.STRING);
// 国际化(英)
// row.getCell(4).setCellType(CellType.STRING);
sysLocaleResource.setId(snowflakeIdMaker.nextId());
sysLocaleResource.setLanguageCode("CN/zh");
sysLocaleResource.setLanguageNameRdd("简体中文");
sysLocaleResource.setResourceType( getType(row.getCell(1).getStringCellValue()));
sysLocaleResource.setResourceKey(row.getCell(2).getStringCellValue());
sysLocaleResource.setResourceValue(row.getCell(2).getStringCellValue());
sysLocaleResource.setResourceType(CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.ENUM.getValue());
sysLocaleResource.setResourceKey(row.getCell(1).getStringCellValue()+":"+row.getCell(2).getStringCellValue());
sysLocaleResource.setResourceValue(row.getCell(3).getStringCellValue());
System.out.println(sql(sysLocaleResource));
if(isContainChinese(row.getCell(2).getStringCellValue())){
bufferWritter.write(sql(sysLocaleResource));
}
bufferWritter.write(sql(sysLocaleResource));
sysLocaleResource.setId(snowflakeIdMaker.nextId());
sysLocaleResource.setLanguageCode("US/en");
sysLocaleResource.setLanguageNameRdd("English");
sysLocaleResource.setResourceType( getType(row.getCell(1).getStringCellValue()));
sysLocaleResource.setResourceKey(row.getCell(2).getStringCellValue());
sysLocaleResource.setResourceType(CommonEnumUtil.SYS_LOCALE_RESOURCE_TYPE.ENUM.getValue());
sysLocaleResource.setResourceKey(row.getCell(1).getStringCellValue()+":"+row.getCell(2).getStringCellValue());
sysLocaleResource.setResourceValue(row.getCell(3).getStringCellValue());
System.out.println(sql(sysLocaleResource));
@ -198,7 +204,7 @@ public class ResourceImportUtil {
for (; i < configSheet.getLastRowNum(); i++) {
row = configSheet.getRow(i);
System.out.println(snowflakeIdMaker.nextId()+" 参数 行:"+i);
System.out.println(snowflakeIdMaker.nextId() + " 参数 行:" + i);
row.getCell(0).setCellType(CellType.STRING);
row.getCell(1).setCellType(CellType.STRING);
row.getCell(2).setCellType(CellType.STRING);
@ -240,7 +246,7 @@ public class ResourceImportUtil {
"values " +
"("+sysLocaleResource.getId()+",1,2,\"system\",\"" + TimeTool.getNowTime(true)+"\",\"system\",\"" + TimeTool.getNowTime(true)+
"\","+sysLocaleResource.getResourceType()+",\""+sysLocaleResource.getLanguageCode()+"\",\""+sysLocaleResource.getLanguageNameRdd()+"\",\""
+sysLocaleResource.getResourceKey().replaceAll("\"","\\\\\\\"")+"\",\""+sysLocaleResource.getResourceValue().replaceAll("\"","\\\\\\\"")+"\",1);\n";
+sysLocaleResource.getResourceKey().replaceAll("\"","\\\\\\\"").trim()+"\",\""+sysLocaleResource.getResourceValue().replaceAll("\"","\\\\\\\"").trim()+"\",1);\n";
}

@ -87,6 +87,12 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>i3plus.icloud</groupId>
<artifactId>i3plus-icloud-softswitch</artifactId>
<version>${project.version}</version>
</dependency>
<!-- 基础对象调用 -->
<dependency>
<groupId>i3plus.pojo</groupId>

Loading…
Cancel
Save