Compare commits
2 Commits
Author | SHA1 | Date |
---|---|---|
|
d938d3f30c | 10 months ago |
|
3cfddf5cfc | 10 months ago |
@ -1,11 +1,15 @@
|
|||||||
/weaver-develop.iml
|
/weaver-develop.iml
|
||||||
/out/
|
/out/
|
||||||
.idea/
|
.idea/
|
||||||
/target/
|
|
||||||
|
HELP.md
|
||||||
|
target/
|
||||||
|
|
||||||
|
.idea
|
||||||
|
|
||||||
/test
|
/test
|
||||||
/src/rebel.xml
|
/src/rebel.xml
|
||||||
/src/META-INF
|
/src/META-INF
|
||||||
/WEB-INF/config
|
/WEB-INF/config
|
||||||
/log
|
|
||||||
/src/META-INF/
|
/log
|
||||||
/src/test/
|
|
@ -0,0 +1,8 @@
|
|||||||
|
<component name="ArtifactManager">
|
||||||
|
<artifact type="jar" name="weaver-develop:jar">
|
||||||
|
<output-path>$PROJECT_DIR$/out/artifacts/weaver_develop_jar</output-path>
|
||||||
|
<root id="archive" name="weaver-develop.jar">
|
||||||
|
<element id="module-output" name="weaver-develop" />
|
||||||
|
</root>
|
||||||
|
</artifact>
|
||||||
|
</component>
|
@ -0,0 +1,8 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="CompilerConfiguration">
|
||||||
|
<annotationProcessing>
|
||||||
|
<profile default="true" name="Default" enabled="true" />
|
||||||
|
</annotationProcessing>
|
||||||
|
</component>
|
||||||
|
</project>
|
@ -0,0 +1,9 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="classbean">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="file://$PROJECT_DIR$/../../../../weaver/ecology/classbean" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</component>
|
@ -0,0 +1,13 @@
|
|||||||
|
<component name="libraryTable">
|
||||||
|
<library name="lib">
|
||||||
|
<CLASSES>
|
||||||
|
<root url="file://$PROJECT_DIR$/../../../../weaver/ecology/WEB-INF/lib" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES>
|
||||||
|
<root url="file://$PROJECT_DIR$/../../../../weaver/ecology/WEB-INF/lib" />
|
||||||
|
</SOURCES>
|
||||||
|
<jarDirectory url="file://$PROJECT_DIR$/../../../../weaver/ecology/WEB-INF/lib" recursive="false" />
|
||||||
|
<jarDirectory url="file://$PROJECT_DIR$/../../../../weaver/ecology/WEB-INF/lib" recursive="false" type="SOURCES" />
|
||||||
|
</library>
|
||||||
|
</component>
|
@ -0,0 +1,3 @@
|
|||||||
|
Manifest-Version: 1.0
|
||||||
|
Main-Class: test.MainTest
|
||||||
|
|
@ -0,0 +1,81 @@
|
|||||||
|
package com.engine.payroll.cmd.payroll;
|
||||||
|
|
||||||
|
import com.engine.common.biz.AbstractCommonCommand;
|
||||||
|
import com.engine.common.entity.BizLogContext;
|
||||||
|
import com.engine.core.interceptor.CommandContext;
|
||||||
|
import com.engine.payroll.biz.SendMsg;
|
||||||
|
import com.engine.payroll.process.ImportProcess;
|
||||||
|
import com.engine.payroll.util.PayrollUtil;
|
||||||
|
import weaver.file.FileUploadToPath;
|
||||||
|
import weaver.hrm.HrmUserVarify;
|
||||||
|
import weaver.hrm.User;
|
||||||
|
import weaver.systeminfo.SystemEnv;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.util.*;
|
||||||
|
|
||||||
|
public class DispatchCmd extends AbstractCommonCommand<Map<String, Object>> {
|
||||||
|
private HttpServletRequest request;
|
||||||
|
|
||||||
|
public DispatchCmd(Map<String, Object> params, User user, HttpServletRequest request) {
|
||||||
|
this.user = user;
|
||||||
|
this.params = params;
|
||||||
|
this.request = request;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BizLogContext getLogContext() {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map<String, Object> execute(CommandContext commandContext) {
|
||||||
|
Map<String,Object> retmap = new HashMap<String,Object>();
|
||||||
|
try {
|
||||||
|
//必要的权限判断
|
||||||
|
if(!HrmUserVarify.checkUserRightSystemadmin("Payroll:Manager", user)){
|
||||||
|
retmap.put("status", "-1");
|
||||||
|
retmap.put("message", SystemEnv.getHtmlLabelName(2012, user.getLanguage()));
|
||||||
|
return retmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
//generate targetId
|
||||||
|
String targetId = PayrollUtil.getInstance().getUnquieID();
|
||||||
|
|
||||||
|
//read excel
|
||||||
|
ImportProcess importProcess = new ImportProcess(user, targetId);
|
||||||
|
|
||||||
|
FileUploadToPath fu = new FileUploadToPath(request);
|
||||||
|
List errorInfo = importProcess.creatImportMap(fu);
|
||||||
|
|
||||||
|
//如果读取数据和验证模板没有发生错误
|
||||||
|
Set<String> userList = new HashSet<>();//构建消息接受人员列表
|
||||||
|
Map<String, String> keys = new HashMap<>();
|
||||||
|
|
||||||
|
//人保二开 Excel存在未找到情况下其它人员依旧推送工资单消息
|
||||||
|
importProcess.init(request);
|
||||||
|
userList = importProcess.processMap();
|
||||||
|
keys = importProcess.getKeys();
|
||||||
|
importProcess.over(request);
|
||||||
|
|
||||||
|
if (errorInfo.isEmpty()) {
|
||||||
|
retmap.put("errorInfo", new ArrayList<>());
|
||||||
|
}else{
|
||||||
|
importProcess.deleteFile();
|
||||||
|
retmap.put("errorInfo", errorInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
//doDispatchMsg
|
||||||
|
SendMsg.getInstance().dispatch(request, user, targetId, userList, keys, fu);
|
||||||
|
retmap.put("targetId", targetId);
|
||||||
|
retmap.put("userCount", userList.size());
|
||||||
|
retmap.put("status", "1");
|
||||||
|
} catch (Exception e) {
|
||||||
|
writeLog(e);
|
||||||
|
retmap.put("status", "-1");
|
||||||
|
retmap.put("message", SystemEnv.getHtmlLabelName(382661, user.getLanguage()));
|
||||||
|
}
|
||||||
|
return retmap;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,14 @@
|
|||||||
|
package test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author weaver_cl
|
||||||
|
* @Description:
|
||||||
|
* @Date 2022/10/9
|
||||||
|
* @Version V1.0
|
||||||
|
**/
|
||||||
|
public class MainTest {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue