计量中心项目
This commit is contained in:
115
jlzx-single/jlzx-single-jlcyry/jlzx-single-jlcyry-biz/pom.xml
Normal file
115
jlzx-single/jlzx-single-jlcyry/jlzx-single-jlcyry-biz/pom.xml
Normal file
@@ -0,0 +1,115 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.yxt</groupId>
|
||||
<artifactId>yxt-parent</artifactId>
|
||||
<version>0.0.1</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>jlzx-single-jlcyry-biz</artifactId>
|
||||
<groupId>com.yxt.jlzx</groupId>
|
||||
<version>0.0.1</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.yxt.jlzx</groupId>
|
||||
<artifactId>jlzx-single-jlcyry-api</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yxt</groupId>
|
||||
<artifactId>yxt-common-base</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.yaml</groupId>
|
||||
<artifactId>snakeyaml</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.xiaoymin</groupId>
|
||||
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi-ooxml</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.deepoove</groupId>
|
||||
<artifactId>poi-tl</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.yxt.jlzx</groupId>
|
||||
<artifactId>jlzx-single-system-api</artifactId>
|
||||
<version>0.0.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.freemarker</groupId>
|
||||
<artifactId>freemarker</artifactId>
|
||||
<version>2.3.29</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.jacob</groupId>
|
||||
<artifactId>jacob</artifactId>
|
||||
<version>1.18</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/java</directory>
|
||||
<includes>
|
||||
<include>**/*Mapper.xml</include>
|
||||
</includes>
|
||||
</resource>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<includes>
|
||||
<include>**/*.*</include>
|
||||
</includes>
|
||||
<filtering>false</filtering>
|
||||
</resource>
|
||||
</resources>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,56 @@
|
||||
/*********************************************************
|
||||
*********************************************************
|
||||
******************** *******************
|
||||
************* ************
|
||||
******* _oo0oo_ *******
|
||||
*** o8888888o ***
|
||||
* 88" . "88 *
|
||||
* (| -_- |) *
|
||||
* 0\ = /0 *
|
||||
* ___/`---'\___ *
|
||||
* .' \\| |// '. *
|
||||
* / \\||| : |||// \ *
|
||||
* / _||||| -:- |||||- \ *
|
||||
* | | \\\ - /// | | *
|
||||
* | \_| ''\---/'' |_/ | *
|
||||
* \ .-\__ '-' ___/-. / *
|
||||
* ___'. .' /--.--\ `. .'___ *
|
||||
* ."" '< `.___\_<|>_/___.' >' "". *
|
||||
* | | : `- \`.;`\ _ /`;.`/ - ` : | | *
|
||||
* \ \ `_. \_ __\ /__ _/ .-` / / *
|
||||
* =====`-.____`.___ \_____/___.-`___.-'===== *
|
||||
* `=---=' *
|
||||
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ *
|
||||
*********__佛祖保佑__永无BUG__验收通过__钞票多多__*********
|
||||
*********************************************************/
|
||||
package com.yxt.jlzx.jlcyry;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
|
||||
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||
|
||||
/**
|
||||
* Project: jlcyry <br/>
|
||||
* File: JlcyryApplication.java <br/>
|
||||
* Class: com.yxt.jlzx.jlcyry.JlcyryApplication <br/>
|
||||
* Description: <描述类的功能>. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2020/8/24 下午4:59 <br/>
|
||||
*
|
||||
* @author popo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
@EnableDiscoveryClient
|
||||
@SpringBootApplication(scanBasePackages = {
|
||||
"com.yxt.common.base.config",
|
||||
"com.yxt.jlzx.jlcyry"
|
||||
})
|
||||
@EnableFeignClients(basePackages = {"com.yxt.jlzx.system"})
|
||||
public class JlcyryApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(JlcyryApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,206 @@
|
||||
package com.yxt.jlzx.jlcyry.biz;
|
||||
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.io.Writer;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.jacob.activeX.ActiveXComponent;
|
||||
import com.jacob.com.Dispatch;
|
||||
import com.yxt.common.base.utils.DateUtils;
|
||||
|
||||
import freemarker.template.Configuration;
|
||||
import freemarker.template.Template;
|
||||
import freemarker.template.Version;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
/**
|
||||
* @Description
|
||||
*/
|
||||
public class WordUtils {
|
||||
|
||||
/**
|
||||
* 根据ftl模板生成word
|
||||
* @param map 数据
|
||||
* @param typeName 模板名称
|
||||
* @param sourcePath 模板路径
|
||||
* @param targetPath 保存目标路径
|
||||
* @param fileName 文件名
|
||||
*/
|
||||
|
||||
|
||||
public static void creatWord(Map<String,Object> map, String typeName, String sourcePath, String targetPath, String fileName){
|
||||
|
||||
String curDate = DateUtils.dateConvertStr(new Date(), "yyyy年MM月dd日");
|
||||
try {
|
||||
//Configuration 用于读取ftl文件
|
||||
Configuration configuration = new Configuration(new Version("2.3.0"));
|
||||
configuration.setDefaultEncoding("utf-8");
|
||||
//指定路径的第一种方式(根据某个类的相对路径指定)
|
||||
// configuration.setClassForTemplateLoading(this.getClass(), "");
|
||||
//指定路径的第二种方式
|
||||
configuration.setDirectoryForTemplateLoading(new File(sourcePath));
|
||||
//输出文档路径及名称
|
||||
File targetFile = new File(targetPath);
|
||||
if(!targetFile.exists()){
|
||||
targetFile.mkdirs();
|
||||
}
|
||||
targetPath = targetPath +"\\"+ fileName;
|
||||
File outFile = new File(targetPath);
|
||||
//以utf-8的编码读取ftl文件
|
||||
Template template = configuration.getTemplate(typeName+".ftl", "utf-8");
|
||||
Writer out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outFile), "utf-8"), 10240);
|
||||
template.process(map, out);
|
||||
out.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片文件转换
|
||||
* @param imgPath
|
||||
* @return
|
||||
*/
|
||||
public static String getImageStr(String imgPath) {
|
||||
String imgFile = imgPath;
|
||||
InputStream in = null;
|
||||
byte[] data = null;
|
||||
try {
|
||||
in = new FileInputStream(imgFile);
|
||||
data = new byte[in.available()];
|
||||
in.read(data);
|
||||
in.close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
return encoder.encode(data);
|
||||
}
|
||||
|
||||
/**
|
||||
* word转换为pdf
|
||||
* @param wordFile word的路径
|
||||
* @param pdfPath pdf的路径
|
||||
* @param pdfName pdf名称
|
||||
*/
|
||||
public static void doc2pdf(String wordFile, String pdfPath, String pdfName){
|
||||
ActiveXComponent app = null;
|
||||
System.out.println("开始转换...");
|
||||
try {
|
||||
// 打开word
|
||||
app = new ActiveXComponent("Word.Application");
|
||||
// 获得word中所有打开的文档
|
||||
Dispatch documents = app.getProperty("Documents").toDispatch();
|
||||
// 打开文档
|
||||
Dispatch document = Dispatch.call(documents, "Open", wordFile, false, true).toDispatch();
|
||||
// 如果文件存在的话,不会覆盖,会直接报错,所以我们需要判断文件是否存在
|
||||
File targetFile = new File(pdfPath);
|
||||
if(!targetFile.exists()){
|
||||
targetFile.mkdirs();
|
||||
}
|
||||
String pdfFile = pdfPath+"\\"+pdfName;
|
||||
File target = new File(pdfFile);
|
||||
if (target.exists()) {
|
||||
target.delete();
|
||||
}
|
||||
Dispatch.call(document, "SaveAs", pdfFile, 17);
|
||||
// 关闭文档
|
||||
Dispatch.call(document, "Close", false);
|
||||
}catch(Exception e) {
|
||||
System.out.println("转换失败"+e.getMessage());
|
||||
}finally {
|
||||
// 关闭office
|
||||
app.invoke("Quit", 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void main(String[] args) {
|
||||
Map<String,Object> dataMap = new HashMap<String, Object>();
|
||||
String curDate = DateUtils.dateConvertStr(new Date(), "yyyy年MM月dd日");
|
||||
dataMap.put("partA", "车辆登记甲方");
|
||||
dataMap.put("partB", "车辆登记乙方");
|
||||
dataMap.put("date", curDate);
|
||||
dataMap.put("seller", "车辆出售方");
|
||||
// 图片
|
||||
dataMap.put("imgStr1", getImageStr("D:\\fileTest\\name.png"));
|
||||
dataMap.put("imgStr2", getImageStr("D:\\fileTest\\zhang.png"));
|
||||
// 列表
|
||||
Car car1 = new Car("奔驰", "1001", "v10");
|
||||
Car car2 = new Car("宝马", "1002", "v10");
|
||||
Car car3 = new Car("奥迪", "1003", "v10");
|
||||
List<Car> list = new ArrayList<>();
|
||||
list.add(car1);
|
||||
list.add(car2);
|
||||
list.add(car3);
|
||||
dataMap.put("carList", list);
|
||||
|
||||
// 自评表数据
|
||||
dataMap.put("evaluation1", "优秀");
|
||||
dataMap.put("evaluation2", "良");
|
||||
dataMap.put("evaluation3", "合格");
|
||||
dataMap.put("score1", 1);
|
||||
dataMap.put("score2", 2);
|
||||
dataMap.put("score3", 3);
|
||||
dataMap.put("result", "合格");
|
||||
|
||||
// String typeName = "车辆登记合同";
|
||||
String typeName = "自评表"; // 模板名
|
||||
String sourcePath = "D:\\fileTest\\"; // 模板路径
|
||||
// String fileName = "车辆登记合同New.doc";
|
||||
String fileName = "自评表New.doc"; // 生成的word文件名
|
||||
String targetPath = sourcePath; // 生成文件路径
|
||||
creatWord(dataMap, typeName, sourcePath, targetPath, fileName); // 调用生成word方法
|
||||
String wordPath = targetPath +"\\"+ fileName; // 新生成的word路径;
|
||||
String pdfName = typeName+".pdf"; // 生成pdf的文件名
|
||||
doc2pdf(wordPath, targetPath, pdfName); // 调用将word转换为pdf的方法
|
||||
|
||||
}
|
||||
|
||||
public static class Car{
|
||||
private String name;
|
||||
private String num;
|
||||
private String engine;
|
||||
|
||||
public Car(String name, String num, String engine) {
|
||||
this.name = name;
|
||||
this.num = num;
|
||||
this.engine = engine;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(String num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public String getEngine() {
|
||||
return engine;
|
||||
}
|
||||
|
||||
public void setEngine(String engine) {
|
||||
this.engine = engine;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,235 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.certificate;
|
||||
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.Certificate;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.CertificateApi;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.CertificateDto;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.CertificateVo;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditional;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditionalVo;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffadditional.StaffAdditionalService;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonDto;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonQuery;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/3 9:49
|
||||
* @description 人员从业资格情况
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/certificate")
|
||||
@Api(tags = "人员从业资格情况")
|
||||
public class CertificateApiImpl implements CertificateApi {
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
private CertificateService certificateService;
|
||||
@Autowired
|
||||
private PhotoCommonApi photoCommonApi;
|
||||
@Autowired
|
||||
private DictCommonApi dictCommonApi;
|
||||
@Autowired
|
||||
private StaffAdditionalService staffAdditionalService;
|
||||
@Override
|
||||
public ResultBean<PagerVo<Certificate>> pagerList(PagerQuery pagerQuery) {
|
||||
ResultBean<PagerVo<Certificate>> rb = ResultBean.fireFail();
|
||||
PagerVo<Certificate> page = certificateService.page(pagerQuery);
|
||||
return rb.success().setData(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 证书保存
|
||||
*
|
||||
* @param certificateDto 证书dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(@Valid CertificateDto certificateDto) {
|
||||
Certificate certificate = certificateDto.toEntity();
|
||||
if(StringUtils.isNoneBlank(certificateDto.getCertUrl())) {
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
photoCommon.setFilePath(certificateDto.getCertUrl());
|
||||
photoCommon.setType("certificatePhoto");
|
||||
photoCommon.setLinkSid(certificate.getSid());
|
||||
photoCommonApi.save(photoCommon);
|
||||
}
|
||||
|
||||
boolean isSave = certificateService.save(certificate);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(certificate.getStaffSid());
|
||||
int count=certificateService.selectCountByStaffSid(certificate.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setCertificateNum(count);
|
||||
staffAdditional.setCertificateState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional=new StaffAdditional();
|
||||
staffAdditional.setCertificateNum(count);
|
||||
staffAdditional.setCertificateState(1);
|
||||
staffAdditional.setStaffSid(certificate.getStaffSid());
|
||||
staffAdditionalService.save(staffAdditional);
|
||||
}
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 证书修改(@PathVariable是spring3.0的一个新功能:接收请求路径中占位符的值.
|
||||
* 通过 @PathVariable 可以将URL中占位符参数{xxx}绑定到处理器类的方法形参中@PathVariable(“xxx“) )
|
||||
*
|
||||
* @param certificateDto 证书dto对象
|
||||
* @param sid 证书sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean update(@Valid CertificateDto certificateDto, String sid) {
|
||||
//先查询证书是否存在
|
||||
Certificate certificate = certificateService.fetchBySid(sid);
|
||||
if (certificate == null) {
|
||||
return ResultBean.fireFail().setMsg("人员从业资格情况不存在");
|
||||
}
|
||||
certificate.setState(1);//修改后状态改为未审核
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
if(certificateDto.getCertUrl().indexOf(path)>-1) {
|
||||
certificateDto.setCertUrl(certificateDto.getCertUrl().replace(path, ""));
|
||||
}
|
||||
int i = certificateService.updateBySid(certificateDto.toMap(certificate), sid);
|
||||
if (i <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(certificate.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setCertificateState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("certificatePhoto");
|
||||
//List<PhotoCommonVo> listVo1=photoCommonApi.queryBylinkSidAndType(q);
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
photoCommon.setFilePath(certificateDto.getCertUrl());
|
||||
photoCommon.setType("certificatePhoto");
|
||||
photoCommon.setLinkSid(sid);
|
||||
photoCommonApi.save(photoCommon);
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 证书删除
|
||||
*
|
||||
* @param sid 证书sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid) {
|
||||
//查询证书是否存在
|
||||
Certificate certificate = certificateService.fetchBySid(sid);
|
||||
if (certificate == null) {
|
||||
return ResultBean.fireFail().setMsg("人员从业资格情况不存在");
|
||||
}
|
||||
int i = certificateService.deleteBySid(sid);
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
int count=certificateService.selectCountByStaffSid(certificate.getStaffSid());
|
||||
int num=certificateService.selectStateByStaffSid(certificate.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(certificate.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setCertificateNum(count);
|
||||
if(num==0) {
|
||||
staffAdditional.setCertificateState(2);//已审核
|
||||
}else {
|
||||
staffAdditional.setCertificateState(1);//未审核
|
||||
}
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("certificatePhoto");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<CertificateVo>> selectByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
List<CertificateVo> page = certificateService.selectByStaffSid(staffSid, path);
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean infoUpdate(Integer state, String sid) {
|
||||
Certificate certificate=certificateService.fetchBySid(sid);
|
||||
if (state!=null) {
|
||||
//通过
|
||||
int i = certificateService.updateState(state, sid);
|
||||
if(certificate!=null) {
|
||||
int num=certificateService.selectStateByStaffSid(certificate.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(certificate.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
if(num==0) {
|
||||
staffAdditional.setCertificateState(2);//已审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional.setCertificateState(1);//未审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
}else {
|
||||
if(state==2) {
|
||||
return ResultBean.fireSuccess().setMsg("人员从业资格情况审核通过");
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("人员从业资格情况审核未通过");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("人员从业资格情况审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<CertificateVo> getVo(String sid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
ResultBean<CertificateVo> resultBean=ResultBean.fireFail();
|
||||
Certificate certificate=certificateService.fetchBySid(sid);
|
||||
CertificateVo vo=new CertificateVo();
|
||||
vo.fromEntity(certificate);
|
||||
vo.setCertUrl(path+vo.getCertUrl());
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<Map<String, Object>> dictSelect() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
ResultBean<Map<String, Object>> dictCommonInitVoResultBean = dictCommonApi.dictCommonCertificate();
|
||||
map.put("dictCommonList", dictCommonInitVoResultBean.getData());
|
||||
return new ResultBean().success().setData(map);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.certificate;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.Certificate;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.CertificateVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/24 8:43
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface CertificateMapper extends BaseMapper<Certificate> {
|
||||
|
||||
public List<CertificateVo> selectByStaffSid(@Param("staffSid") String staffSid,@Param("path") String path);
|
||||
|
||||
int updateState(@Param("state") Integer state, @Param("sid") String sid);
|
||||
|
||||
public int selectStateByStaffSid(@Param("staffSid") String staffSid);
|
||||
|
||||
public int selectCountByStaffSid(String staffSid);
|
||||
|
||||
public List<Certificate> listByStaffSid(String staffSid);
|
||||
|
||||
public void deleteByStaffSid(@Param("staffSid") String staffSid);
|
||||
|
||||
public void updateBystaffSid(@Param("staffInfoSid") String staffInfoSid, @Param("state") int state);
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.certificate.CertificateMapper">
|
||||
|
||||
|
||||
<select id="selectByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.certificate.CertificateVo">
|
||||
SELECT t.issueOrg,
|
||||
t.certNo,
|
||||
t.approvalDate,
|
||||
t.dateStart,
|
||||
t.dateEnd,
|
||||
t.staffSid,
|
||||
(SELECT dictValue
|
||||
FROM jlzx_system.dict_common
|
||||
WHERE dictKey = t.certType AND dictType = 'zslb') certType,
|
||||
(SELECT dictValue
|
||||
FROM jlzx_system.dict_common
|
||||
WHERE dictKey = t.certLevel AND dictType = 'zcjlszg') certLevel,
|
||||
t.others,
|
||||
concat(#{path}, t.`certUrl`) AS certUrl,
|
||||
(SELECT COUNT(id) FROM certitem WHERE certSid = t.sid) subject,
|
||||
(SELECT dictValue
|
||||
FROM jlzx_system.dict_common
|
||||
WHERE dictKey = t.certType AND dictType = 'cszy') jlzymc,sxzymc,
|
||||
t.sid,
|
||||
t.state
|
||||
FROM certificate t
|
||||
WHERE t.staffSid = #{staffSid}
|
||||
ORDER BY certificateDate DESC
|
||||
</select>
|
||||
<update id="updateState">
|
||||
UPDATE certificate
|
||||
SET state =#{state}
|
||||
WHERE sid = #{sid}
|
||||
</update>
|
||||
|
||||
<update id="updateBystaffSid">
|
||||
UPDATE certificate
|
||||
SET state =#{state}
|
||||
WHERE staffSid = #{staffInfoSid}
|
||||
</update>
|
||||
<select id="listByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.certificate.Certificate">
|
||||
SELECT *
|
||||
FROM certificate
|
||||
WHERE staffSid = #{staffSid}
|
||||
</select>
|
||||
<select id="selectStateByStaffSid" resultType="java.lang.Integer">
|
||||
SELECT count(id)
|
||||
FROM certificate
|
||||
WHERE state = 1
|
||||
AND staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
<select id="selectCountByStaffSid" resultType="java.lang.Integer">
|
||||
SELECT count(id)
|
||||
FROM certificate
|
||||
WHERE staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByStaffSid" >
|
||||
delete FROM certificate
|
||||
WHERE staffSid = #{staffSid}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.certificate;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.Certificate;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.CertificateVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/3 9:51
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class CertificateService extends MybatisBaseService<CertificateMapper, Certificate> {
|
||||
|
||||
public List<CertificateVo> selectByStaffSid(String staffSid,String path) {
|
||||
return baseMapper.selectByStaffSid(staffSid,path);
|
||||
}
|
||||
|
||||
public int updateState(Integer state, String sid) {
|
||||
return baseMapper.updateState(state, sid);
|
||||
}
|
||||
|
||||
public int selectStateByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectStateByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public int selectCountByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectCountByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public List<Certificate> listByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.listByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public void deleteByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
baseMapper.deleteByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public void updateState(String staffInfoSid, int state) {
|
||||
// TODO Auto-generated method stub
|
||||
baseMapper.updateBystaffSid(staffInfoSid,state);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.certitem;
|
||||
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.jlzx.jlcyry.api.certItem.CertItemApi;
|
||||
import com.yxt.jlzx.jlcyry.api.certItem.CertItemDto;
|
||||
import com.yxt.jlzx.jlcyry.api.certItem.CertItemVo;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.Certificate;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.CertificateVo;
|
||||
import com.yxt.jlzx.jlcyry.api.certItem.CertItem;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 9:27
|
||||
* @description 专业项目
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/certItem")
|
||||
@Api(tags = "专业项目")
|
||||
public class CertItemApiImpl implements CertItemApi {
|
||||
|
||||
@Autowired
|
||||
private CertItemService certItemService;
|
||||
|
||||
@Override
|
||||
public ResultBean<PagerVo<CertItem>> pagerList(PagerQuery pagerQuery) {
|
||||
ResultBean<PagerVo<CertItem>> rb = ResultBean.fireFail();
|
||||
PagerVo<CertItem> page = certItemService.page(pagerQuery);
|
||||
return rb.success().setData(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 专业项目保存
|
||||
*
|
||||
* @param certItemDto 专业项目dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(@Valid CertItemDto certItemDto) {
|
||||
CertItem certItem = certItemDto.toEntity();
|
||||
boolean isSave = certItemService.save(certItem);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 专业项目修改(@PathVariable是spring3.0的一个新功能:接收请求路径中占位符的值.
|
||||
* 通过 @PathVariable 可以将URL中占位符参数{xxx}绑定到处理器类的方法形参中@PathVariable(“xxx“) )
|
||||
*
|
||||
* @param certItemDto 专业项目dto对象
|
||||
* @param sid 专业项目sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean update(@Valid CertItemDto certItemDto, String sid) {
|
||||
//根据sid查询专业项目是否存在
|
||||
CertItem certItem = certItemService.fetchBySid(sid);
|
||||
if (certItem == null) {
|
||||
return ResultBean.fireFail().setMsg("该专业项目不存在");
|
||||
}
|
||||
int i = certItemService.updateBySid(certItemDto.toMap(certItem), sid);
|
||||
if (i <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 专业项目删除
|
||||
*
|
||||
* @param sid 专业项目sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid) {
|
||||
//根据sid查询专业项目是否存在
|
||||
CertItem certItem = certItemService.fetchBySid(sid);
|
||||
if (certItem == null) {
|
||||
return ResultBean.fireFail().setMsg("该专业项目不存在");
|
||||
}
|
||||
int i = certItemService.deleteBySid(sid);
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean infoUpdate(Integer state, String sid){
|
||||
if (state!=null) {
|
||||
//通过
|
||||
int i = certItemService.updateState(state, sid);
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
}else {
|
||||
|
||||
if(state==2) {
|
||||
return ResultBean.fireSuccess().setMsg("审核通过");
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("审核未通过");
|
||||
}
|
||||
|
||||
}
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("证书项目信息审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<CertItemVo> getVo(String sid) {
|
||||
ResultBean<CertItemVo> resultBean=ResultBean.fireFail();
|
||||
CertItem CertItem=certItemService.fetchBySid(sid);
|
||||
CertItemVo vo=new CertItemVo();
|
||||
vo.fromEntity(CertItem);
|
||||
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<CertItemVo>> selectByCertSid(String certSid) {
|
||||
// TODO Auto-generated method stub
|
||||
List<CertItemVo> page = certItemService.selectByCertSid(certSid);
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.certitem;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.certItem.CertItem;
|
||||
import com.yxt.jlzx.jlcyry.api.certItem.CertItemVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 9:27
|
||||
* @description 专业项目
|
||||
*/
|
||||
@Mapper
|
||||
public interface CertItemMapper extends BaseMapper<CertItem> {
|
||||
|
||||
int updateState(@Param("state") Integer state, @Param("sid") String sid);
|
||||
|
||||
List<CertItemVo> selectByCertSid(String certSid);
|
||||
List<CertItem> listByCertSid(String certSid);
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.certitem.CertItemMapper">
|
||||
<select id="selectByCertSid" resultType="com.yxt.jlzx.jlcyry.api.certItem.CertItemVo">
|
||||
select subject,
|
||||
item,
|
||||
subItem,
|
||||
state,
|
||||
basis,
|
||||
certSid,
|
||||
sid
|
||||
from certitem
|
||||
where certSid = #{certSid}
|
||||
</select>
|
||||
<update id="updateState">
|
||||
UPDATE certitem
|
||||
SET state =#{state}
|
||||
WHERE sid = #{sid}
|
||||
</update>
|
||||
|
||||
<select id="listByCertSid" resultType="com.yxt.jlzx.jlcyry.api.certItem.CertItem">
|
||||
select *
|
||||
from certitem
|
||||
where certSid = #{certSid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.certitem;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.certItem.CertItem;
|
||||
import com.yxt.jlzx.jlcyry.api.certItem.CertItemVo;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.Certificate;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 9:27
|
||||
* @description 专业项目
|
||||
*/
|
||||
@Service
|
||||
public class CertItemService extends MybatisBaseService<CertItemMapper, CertItem> {
|
||||
|
||||
|
||||
|
||||
public int updateState(Integer state, String sid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.updateState(state, sid);
|
||||
}
|
||||
|
||||
|
||||
public List<CertItemVo> selectByCertSid(String certSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectByCertSid(certSid);
|
||||
}
|
||||
|
||||
public List<CertItem> listByCertSid(String certSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.listByCertSid(certSid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.clientalterrecord;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.jlzx.jlcyry.api.clientalterrecord.ClientAlterRecord;
|
||||
import com.yxt.jlzx.jlcyry.api.clientalterrecord.ClientAlterRecordApi;
|
||||
import com.yxt.jlzx.jlcyry.api.clientalterrecord.ClientAlterRecordDto;
|
||||
import com.yxt.jlzx.jlcyry.api.clientalterrecord.ClientAlterRecordQuery;
|
||||
import com.yxt.jlzx.jlcyry.api.clientalterrecord.ClientAlterRecordVo;
|
||||
import com.yxt.jlzx.jlcyry.api.staffinfo.StaffClientVo;
|
||||
import com.yxt.jlzx.system.api.user.User;
|
||||
import com.yxt.jlzx.system.api.user.UserApi;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
/**
|
||||
* @author 韩伟佳
|
||||
* @date 2020/9/4 9:27
|
||||
* @description 委托人变更
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("v1/clientalterrecords")
|
||||
@Api(tags = "委托人变更")
|
||||
public class ClientAlterRecordApiImpl implements ClientAlterRecordApi {
|
||||
|
||||
@Autowired
|
||||
private ClientAlterRecordService clientAlterRecordService;
|
||||
@Autowired
|
||||
private UserApi userApi;
|
||||
|
||||
@Override
|
||||
public ResultBean<PagerVo<ClientAlterRecordVo>> pagerList(PagerQuery<ClientAlterRecordQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<ClientAlterRecordVo>> rb = ResultBean.fireFail();
|
||||
|
||||
|
||||
IPage<ClientAlterRecordVo> page = clientAlterRecordService.pageList(pagerQuery);
|
||||
//把Ipage转换为PageVo
|
||||
PagerVo<ClientAlterRecordVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param clientalterrecordDto
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(@Valid ClientAlterRecordDto clientalterrecordDto) {
|
||||
ClientAlterRecord clientalterrecord = clientalterrecordDto.toEntity();
|
||||
clientalterrecord.setStartDate(new Date());
|
||||
boolean isSave = clientAlterRecordService.save(clientalterrecord);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<ClientAlterRecordVo> getVo(String sid) {
|
||||
ResultBean<ClientAlterRecordVo> resultBean=ResultBean.fireFail();
|
||||
ClientAlterRecord ClientAlterRecord=clientAlterRecordService.fetchBySid(sid);
|
||||
ClientAlterRecordVo vo=new ClientAlterRecordVo();
|
||||
vo.fromEntity(ClientAlterRecord);
|
||||
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<PagerVo<StaffClientVo>> staffClientList(PagerQuery<ClientAlterRecordQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<StaffClientVo>> rb = ResultBean.fireFail();
|
||||
|
||||
|
||||
IPage<StaffClientVo> page = clientAlterRecordService.staffClientList(pagerQuery);
|
||||
PagerVo<StaffClientVo> pv_result = PagerUtil.pageToVo(page, null);
|
||||
if(StringUtils.isNoneBlank(pagerQuery.getParams().getOrgSid())) {
|
||||
ResultBean<User> r = userApi.isadminByOrgsid(pagerQuery.getParams().getOrgSid().toString());
|
||||
if(r.getSuccess()) {
|
||||
User u=r.getData();
|
||||
List<StaffClientVo> records = pv_result.getRecords();
|
||||
for (int i = 0; i < records.size(); i++) {
|
||||
if(records.get(i).getStaffSid().equals(u.getStaffSid())){
|
||||
records.remove(i);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//把Ipage转换为PageVo
|
||||
|
||||
return rb.success().setData(pv_result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean doClientAlter(@Valid ClientAlterRecordDto clientalterrecordDto) {
|
||||
// TODO Auto-generated method stub
|
||||
ResultBean r=userApi.doClientAlter(clientalterrecordDto.getStaffSid(),clientalterrecordDto.getOrgSid());
|
||||
if(r.getSuccess()) {
|
||||
String staffinfoSid=r.getData().toString();//变更前人员sid
|
||||
clientAlterRecordService.updateEndDateByStaffSid(staffinfoSid);
|
||||
save(clientalterrecordDto);
|
||||
r.setData("");
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.clientalterrecord;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.jlzx.jlcyry.api.clientalterrecord.ClientAlterRecord;
|
||||
import com.yxt.jlzx.jlcyry.api.clientalterrecord.ClientAlterRecordQuery;
|
||||
import com.yxt.jlzx.jlcyry.api.clientalterrecord.ClientAlterRecordVo;
|
||||
import com.yxt.jlzx.jlcyry.api.staffinfo.StaffClientVo;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 9:27
|
||||
* @description 专业项目
|
||||
*/
|
||||
@Mapper
|
||||
public interface ClientAlterRecordMapper extends BaseMapper<ClientAlterRecord> {
|
||||
|
||||
void updateEndDateByStaffSid(String staffinfoSid);
|
||||
|
||||
//分页列表
|
||||
IPage<ClientAlterRecordVo> pageList(IPage<ClientAlterRecordQuery> page,@Param(Constants.WRAPPER) Wrapper<ClientAlterRecordVo> qw);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.clientalterrecord.ClientAlterRecordMapper">
|
||||
<update id="updateEndDateByStaffSid">
|
||||
update client_alter_record set endDate=now() where staffSid=#{staffinfoSid} and endDate is null
|
||||
</update>
|
||||
|
||||
<select id="pageList" resultType="com.yxt.jlzx.jlcyry.api.clientalterrecord.ClientAlterRecordVo">
|
||||
select * from client_alter_record
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.clientalterrecord;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.jlzx.jlcyry.api.certItem.CertItem;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.Certificate;
|
||||
import com.yxt.jlzx.jlcyry.api.clientalterrecord.ClientAlterRecord;
|
||||
import com.yxt.jlzx.jlcyry.api.clientalterrecord.ClientAlterRecordQuery;
|
||||
import com.yxt.jlzx.jlcyry.api.clientalterrecord.ClientAlterRecordVo;
|
||||
import com.yxt.jlzx.jlcyry.api.staffinfo.StaffClientVo;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffinfo.StaffInfoService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 9:27
|
||||
* @description 专业项目
|
||||
*/
|
||||
@Service
|
||||
public class ClientAlterRecordService extends MybatisBaseService<ClientAlterRecordMapper, ClientAlterRecord> {
|
||||
@Autowired
|
||||
private StaffInfoService staffInfoService;
|
||||
|
||||
public void updateEndDateByStaffSid(String staffinfoSid) {
|
||||
// TODO Auto-generated method stub
|
||||
baseMapper.updateEndDateByStaffSid(staffinfoSid);
|
||||
}
|
||||
|
||||
public IPage<ClientAlterRecordVo> pageList(PagerQuery<ClientAlterRecordQuery> pagerQuery) {
|
||||
IPage<ClientAlterRecordQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||
// mybits所用的查询条件封装类
|
||||
QueryWrapper<ClientAlterRecordVo> qw = buildQueryWrapper(pagerQuery.getParams());
|
||||
|
||||
return baseMapper.pageList(page, qw);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析和组装查询条件,封装在qw中
|
||||
*
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
private QueryWrapper<ClientAlterRecordVo> buildQueryWrapper(ClientAlterRecordQuery pagerQuery) {
|
||||
QueryWrapper<ClientAlterRecordVo> qw = new QueryWrapper<>();
|
||||
if (pagerQuery != null) {
|
||||
if (StringUtils.isNotBlank(pagerQuery.getName())) {
|
||||
qw.like("name", pagerQuery.getName());
|
||||
}
|
||||
if (null != pagerQuery.getStartDate() && StringUtils.isNotBlank(pagerQuery
|
||||
.getStartDate().toString())) {
|
||||
qw.ge("startDate", pagerQuery.getStartDate());
|
||||
}
|
||||
if (null != pagerQuery.getEndDate() && StringUtils.isNotBlank(pagerQuery
|
||||
.getEndDate().toString())) {
|
||||
qw.le("endDate", pagerQuery.getEndDate());
|
||||
}
|
||||
if (StringUtils.isNotBlank(pagerQuery.getOrgSid())) {
|
||||
qw.eq("orgSid", pagerQuery.getOrgSid());
|
||||
}
|
||||
qw.orderByDesc("createTime");
|
||||
}
|
||||
|
||||
return qw;
|
||||
|
||||
}
|
||||
|
||||
public IPage<StaffClientVo> staffClientList(PagerQuery<ClientAlterRecordQuery> pagerQuery) {
|
||||
// TODO Auto-generated method stub
|
||||
return staffInfoService.staffClientList(pagerQuery);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.datadictionary;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.datadictionary.DictCommon;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/28 15:55
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface DictCommonMapper extends BaseMapper<DictCommon> {
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有学历list
|
||||
*
|
||||
* @return dictType为xl的数据
|
||||
*/
|
||||
public List<Map<String, Object>> educationList();
|
||||
/**
|
||||
* 查询所有学位list
|
||||
*
|
||||
* @return dictType为xw的数据
|
||||
*/
|
||||
public List<Map<String, Object>> degreeList();
|
||||
public List<Map<String, Object>> xzList();
|
||||
|
||||
public List<Map<String, Object>> xlbsList();
|
||||
|
||||
public List<Map<String, Object>> list(String type);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.datadictionary.DictCommonMapper">
|
||||
|
||||
|
||||
<select id="educationList" resultType="java.util.Map">
|
||||
SELECT dc.dictKey, dc.dictValue, dc.dictType
|
||||
FROM jlzx_system.dict_common dc
|
||||
WHERE dictType = 'xl'
|
||||
</select>
|
||||
|
||||
<select id="degreeList" resultType="java.util.Map">
|
||||
SELECT dc.dictKey, dc.dictValue, dc.dictType
|
||||
FROM jlzx_system.dict_common dc
|
||||
WHERE dictType = 'xw'
|
||||
</select>
|
||||
<select id="xzList" resultType="java.util.Map">
|
||||
SELECT dc.dictKey,
|
||||
dc.dictValue,
|
||||
dc.dictType
|
||||
FROM jlzx_system.dict_common dc
|
||||
WHERE dictType = 'xz'
|
||||
</select>
|
||||
|
||||
|
||||
<select id="xlbsList" resultType="java.util.Map">
|
||||
SELECT dc.dictKey,
|
||||
dc.dictValue,
|
||||
dc.dictType
|
||||
FROM jlzx_system.dict_common dc
|
||||
WHERE dictType = 'xlbs'
|
||||
</select>
|
||||
|
||||
<select id="list" resultType="java.util.Map">
|
||||
SELECT dc.dictKey,
|
||||
dc.dictValue,
|
||||
dc.dictType
|
||||
FROM jlzx_system.dict_common dc
|
||||
WHERE dictType = #{type}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.datadictionary;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.datadictionary.DictCommon;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/28 15:56
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class DictCommonService extends MybatisBaseService<DictCommonMapper, DictCommon> {
|
||||
|
||||
/**
|
||||
* 查询所有学历list
|
||||
*
|
||||
* @return dictType为xl的数据
|
||||
*/
|
||||
public List<Map<String, Object>> educationList() {
|
||||
return baseMapper.educationList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询所有学位list
|
||||
*
|
||||
* @return dictType为xw的数据
|
||||
*/
|
||||
public List<Map<String, Object>> degreeList() {
|
||||
return baseMapper.degreeList();
|
||||
}
|
||||
/**
|
||||
* 查询所有学制list
|
||||
*
|
||||
* @return dictType为xz的数据
|
||||
*/
|
||||
public List<Map<String, Object>> xzList() {
|
||||
return baseMapper.xzList();
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> xlbsList() {
|
||||
return baseMapper.xlbsList();
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> list(String type) {
|
||||
return baseMapper.list(type);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,287 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.education;
|
||||
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.jlzx.jlcyry.api.education.Education;
|
||||
import com.yxt.jlzx.jlcyry.api.education.EducationApi;
|
||||
import com.yxt.jlzx.jlcyry.api.education.EducationDto;
|
||||
import com.yxt.jlzx.jlcyry.api.education.EducationVo;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditional;
|
||||
import com.yxt.jlzx.jlcyry.biz.datadictionary.DictCommonService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffadditional.StaffAdditionalService;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonDto;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonQuery;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/31 8:45
|
||||
* @description 教育经历
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/education")
|
||||
@Api(tags = "教育经历")
|
||||
public class EducationApiImpl implements EducationApi {
|
||||
|
||||
@Autowired
|
||||
private EducationService educationService;
|
||||
@Autowired
|
||||
private DictCommonService dictCommonService;
|
||||
@Autowired
|
||||
private PhotoCommonApi photoCommonApi;
|
||||
@Autowired
|
||||
private DictCommonApi dictCommonApi;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
private StaffAdditionalService staffAdditionalService;
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<Education>> pagerList(PagerQuery pagerQuery) {
|
||||
ResultBean<PagerVo<Education>> rb = ResultBean.fireFail();
|
||||
PagerVo<Education> page = educationService.page(pagerQuery);
|
||||
return rb.success().setData(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 教育经历保存
|
||||
*
|
||||
* @param educationDto 教育经历Dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(@Valid EducationDto educationDto) {
|
||||
Education education = educationDto.toEntity();
|
||||
|
||||
if(StringUtils.isNoneBlank(educationDto.getDiploma())) {
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
photoCommon.setFilePath(educationDto.getDiploma());
|
||||
photoCommon.setType("diplomaPhoto");
|
||||
photoCommon.setLinkSid(education.getSid());
|
||||
ResultBean resultBean=photoCommonApi.save(photoCommon);
|
||||
}
|
||||
if(StringUtils.isNoneBlank(educationDto.getDegreeCert())) {
|
||||
PhotoCommonDto photoCommon1=new PhotoCommonDto();
|
||||
photoCommon1.setFilePath(educationDto.getDegreeCert());
|
||||
photoCommon1.setType("degreeCertPhoto");
|
||||
photoCommon1.setLinkSid(education.getSid());
|
||||
ResultBean resultBean1 = photoCommonApi.save(photoCommon1);
|
||||
}
|
||||
|
||||
boolean isSave = educationService.save(education);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
|
||||
int count=educationService.selectCountByStaffSid(education.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(education.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setEducationNum(count);
|
||||
staffAdditional.setEducationState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional=new StaffAdditional();
|
||||
staffAdditional.setEducationNum(count);
|
||||
staffAdditional.setEducationState(1);
|
||||
staffAdditional.setStaffSid(education.getStaffSid());
|
||||
staffAdditionalService.save(staffAdditional);
|
||||
}
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 教育经历修改(@PathVariable是spring3.0的一个新功能:接收请求路径中占位符的值.
|
||||
* 通过 @PathVariable 可以将URL中占位符参数{xxx}绑定到处理器类的方法形参中@PathVariable(“xxx“) )
|
||||
*
|
||||
* @param educationDto 教育经历Dto对象
|
||||
* @param sid 教育经历sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean update(@Valid EducationDto educationDto, String sid) {
|
||||
//根据sid查询教育经历是否存在
|
||||
Education education = educationService.fetchBySid(sid);
|
||||
if (education == null) {
|
||||
return ResultBean.fireFail().setMsg("该教育经历不存在");
|
||||
}
|
||||
education.setState(1);
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
if(educationDto.getDegreeCert().indexOf(path)>-1) {
|
||||
educationDto.setDegreeCert(educationDto.getDegreeCert().replace(path, ""));
|
||||
}
|
||||
if(educationDto.getDiploma().indexOf(path)>-1) {
|
||||
educationDto.setDiploma(educationDto.getDiploma().replace(path, ""));
|
||||
}
|
||||
int i = educationService.updateBySid(educationDto.toMap(education), sid);
|
||||
if (i <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(education.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setEducationState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("diplomaPhoto");
|
||||
//List<PhotoCommonVo> listVo1=photoCommonApi.queryBylinkSidAndType(q);
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
photoCommon.setFilePath(educationDto.getDiploma());
|
||||
photoCommon.setType("diplomaPhoto");
|
||||
photoCommon.setLinkSid(education.getSid());
|
||||
photoCommonApi.save(photoCommon);
|
||||
|
||||
q1.setType("degreeCertPhoto");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
photoCommon.setFilePath(educationDto.getDegreeCert());
|
||||
photoCommon.setType("degreeCertPhoto");
|
||||
photoCommon.setLinkSid(education.getSid());
|
||||
photoCommonApi.save(photoCommon);
|
||||
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除教育经历
|
||||
*
|
||||
* @param sid 教育经历sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid) {
|
||||
//根据sid查询教育经历是否存在
|
||||
Education education = educationService.fetchBySid(sid);
|
||||
if (education == null) {
|
||||
return ResultBean.fireFail().setMsg("该教育经历不存在");
|
||||
}
|
||||
int i = educationService.deleteBySid(sid);
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
|
||||
int count=educationService.selectCountByStaffSid(education.getStaffSid());
|
||||
int num=educationService.selectStateByStaffSid(education.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(education.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setEducationNum(count);
|
||||
if(num==0) {
|
||||
staffAdditional.setEducationState(2);//已审核
|
||||
}else {
|
||||
staffAdditional.setEducationState(1);//未审核
|
||||
}
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("diplomaPhoto");
|
||||
//List<PhotoCommonVo> listVo1=photoCommonApi.queryBylinkSidAndType(q);
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
q1.setType("degreeCertPhoto");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过人员sid查询教育经历
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return 该人员的教育经历list
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<List<EducationVo>> selectByStaffSid(String staffSid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
List<EducationVo> page = educationService.selectByStaffSid(staffSid,path);
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 注册审核通过更新人员信息
|
||||
*
|
||||
* @param staffRegisterDto 注册人员信息dto对象
|
||||
* @param sid 注册人员sid
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public ResultBean educationInfoUpdate(Integer state, String sid){
|
||||
Education education=educationService.fetchBySid(sid);
|
||||
if (state!=null) {
|
||||
//通过
|
||||
int i = educationService.updateState(state, sid);
|
||||
if(education!=null) {
|
||||
int num=educationService.selectStateByStaffSid(education.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(education.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
if(num==0) {
|
||||
staffAdditional.setEducationState(2);//已审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional.setEducationState(1);//未审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
}else {
|
||||
|
||||
if(state==2) {
|
||||
return ResultBean.fireSuccess().setMsg("审核通过");
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("审核未通过");
|
||||
}
|
||||
|
||||
}
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("教育经历信息审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<Map<String, Object>> dictSelect() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
ResultBean<Map<String, Object>> dictCommonInitVoResultBean = dictCommonApi.dictCommonEducation();
|
||||
map.put("dictCommonList", dictCommonInitVoResultBean.getData());
|
||||
return new ResultBean().success().setData(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<EducationVo> getVo(String sid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
ResultBean<EducationVo> resultBean=ResultBean.fireFail();
|
||||
//Education education=educationService.selectBySid(sid,path);
|
||||
Education education=educationService.fetchBySid(sid);
|
||||
EducationVo vo=new EducationVo();
|
||||
vo.fromEntity(education);
|
||||
vo.setDiploma(path+education.getDiploma());
|
||||
vo.setDegreeCert(path+education.getDegreeCert());
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.education;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.Certificate;
|
||||
import com.yxt.jlzx.jlcyry.api.education.Education;
|
||||
import com.yxt.jlzx.jlcyry.api.education.EducationVo;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/1 9:21
|
||||
* @description 教育经历
|
||||
*/
|
||||
@Mapper
|
||||
public interface EducationMapper extends BaseMapper<Education> {
|
||||
|
||||
/**
|
||||
* 根据人员sid查询该人员的教育经历
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return 该人员的教育经历list
|
||||
*/
|
||||
public List<EducationVo> selectByStaffSid(@Param("staffSid") String staffSid,@Param("path") String path);
|
||||
|
||||
public Education selectBySid(@Param("sid") String sid,@Param("path") String path);
|
||||
|
||||
int updateState(@Param("state") Integer state, @Param("educationSid") String educationSid);
|
||||
|
||||
public int selectStateByStaffSid(@Param("staffSid") String staffSid);
|
||||
|
||||
public int selectCountByStaffSid(@Param("staffSid") String staffSid);
|
||||
|
||||
public List<Education> listByStaffSid(String staffSid);
|
||||
|
||||
public void updateBystaffSid(@Param("staffInfoSid") String staffInfoSid, @Param("state") int state);
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.education.EducationMapper">
|
||||
|
||||
<select id="selectByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.education.EducationVo">
|
||||
select edu.`schoolName`,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=edu.speciality and dictType='bkzy') speciality,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=edu.studyMode and dictType='xxxs') studyMode,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=edu.studyType and dictType='xxlx') studyType,
|
||||
edu.`gradDate`,
|
||||
edu.`eduStartDate`,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=edu.studyYears and dictType='xz') studyYears,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=edu.cultlevel and dictType='xl') cultlevel,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=edu.degree and dictType='xw') degree,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=edu.signChar and dictType='xlbs') signChar,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=edu.bkzyml and dictType='bkzyml') bkzyml,
|
||||
edu.diplomaCertNo,
|
||||
concat(#{path},edu.`diploma`) as diploma,
|
||||
edu.`diploma`,
|
||||
edu.issueDate,
|
||||
edu. degreeCertNo,
|
||||
concat(#{path},edu.`degreeCert`) as degreeCert,
|
||||
edu.sid,edu.state
|
||||
from education edu
|
||||
where edu.staffSid = #{staffSid} ORDER BY eduStartDate
|
||||
</select>
|
||||
|
||||
|
||||
<update id="updateState">
|
||||
UPDATE education
|
||||
SET state =#{state}
|
||||
WHERE sid = #{educationSid}
|
||||
</update>
|
||||
|
||||
<update id="updateBystaffSid">
|
||||
UPDATE education
|
||||
SET state =#{state}
|
||||
WHERE staffSid = #{staffInfoSid}
|
||||
</update>
|
||||
<select id="selectStateByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id) from education where state=1 and staffSid = #{staffSid}
|
||||
</select>
|
||||
<select id="selectCountByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id) from education where staffSid = #{staffSid}
|
||||
</select>
|
||||
<select id="listByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.education.Education">
|
||||
SELECT *
|
||||
FROM education
|
||||
WHERE staffSid = #{staffSid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,54 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.education;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.Certificate;
|
||||
import com.yxt.jlzx.jlcyry.api.education.Education;
|
||||
import com.yxt.jlzx.jlcyry.api.education.EducationVo;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/1 9:21
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class EducationService extends MybatisBaseService<EducationMapper, Education> {
|
||||
|
||||
/**
|
||||
* 通过人员sid查询该人员的教育经历
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return list
|
||||
*/
|
||||
public List<EducationVo> selectByStaffSid(String staffSid,String path) {
|
||||
return baseMapper.selectByStaffSid(staffSid,path);
|
||||
}
|
||||
public Education selectBySid(String sid,String path) {
|
||||
return baseMapper.selectBySid(sid,path);
|
||||
}
|
||||
|
||||
public int updateState(Integer state, String educationSid) {
|
||||
return baseMapper.updateState(state, educationSid);
|
||||
}
|
||||
public int selectStateByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectStateByStaffSid(staffSid);
|
||||
}
|
||||
public int selectCountByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectCountByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public List<Education> listByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.listByStaffSid(staffSid);
|
||||
}
|
||||
public void updateState(String staffInfoSid, int state) {
|
||||
// TODO Auto-generated method stub
|
||||
baseMapper.updateBystaffSid(staffInfoSid,state);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,188 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.enterpriseinfo;
|
||||
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.jlzx.jlcyry.api.enterpriseinfo.EnterpriseInfo;
|
||||
import com.yxt.jlzx.jlcyry.api.enterpriseinfo.EnterpriseInfoApi;
|
||||
import com.yxt.jlzx.jlcyry.api.enterpriseinfo.EnterpriseInfoDto;
|
||||
import com.yxt.jlzx.jlcyry.api.enterpriseinfo.EnterpriseInfoOneVo;
|
||||
import com.yxt.jlzx.system.api.organization.Organization;
|
||||
import com.yxt.jlzx.system.api.region.Region;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.apache.poi.ss.usermodel.Cell;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
@RequestMapping("v1/enterpriseinfos")
|
||||
@Api(tags = "企业信息")
|
||||
public class EnterpriseInfoApiImpl implements EnterpriseInfoApi {
|
||||
|
||||
@Autowired
|
||||
private EnterpriseInfoService enterpriseInfoService;
|
||||
|
||||
@Override
|
||||
public ResultBean<List<EnterpriseInfoOneVo>> selectOrgNameList(String orgName) {
|
||||
List<EnterpriseInfoOneVo> enterpriseInfoOneVos = enterpriseInfoService.selectOrgNameList(orgName);
|
||||
if (enterpriseInfoOneVos.size() == 0) {
|
||||
return new ResultBean<List<EnterpriseInfoOneVo>>().fail().setMsg("暂无企业名称");
|
||||
}
|
||||
return new ResultBean<List<EnterpriseInfoOneVo>>().success().setData(enterpriseInfoOneVos);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<EnterpriseInfoOneVo> selectOrg(String orgSid) {
|
||||
EnterpriseInfoOneVo enterpriseInfoOneVo = enterpriseInfoService.selectOrg(orgSid);
|
||||
if (enterpriseInfoOneVo == null) {
|
||||
EnterpriseInfoOneVo enterpriseInfoOneVo1 = new EnterpriseInfoOneVo();
|
||||
return new ResultBean<EnterpriseInfoOneVo>().fail().setData(enterpriseInfoOneVo1);
|
||||
}
|
||||
return new ResultBean<EnterpriseInfoOneVo>().success().setData(enterpriseInfoOneVo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean save(EnterpriseInfoDto enterpriseInfoDto) {
|
||||
EnterpriseInfo enterpriseInfo = new EnterpriseInfo();
|
||||
enterpriseInfoDto.fillEntity(enterpriseInfo);
|
||||
boolean isSave = enterpriseInfoService.save(enterpriseInfo);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean getExcelInfo(String fileName, MultipartFile file) throws IOException {
|
||||
if (!fileName.matches("^.+\\.(?i)(xls)$") && !fileName.matches("^.+\\.(?i)(xlsx)$")) {
|
||||
return ResultBean.fireFail().setMsg("上传文件不正确");
|
||||
}
|
||||
int[] resultCell = new int[]{0, 1, 2, 3, 4, 5, 6, 7};
|
||||
List<EnterpriseInfo> resultList = new ArrayList<>();
|
||||
boolean isExcel2003 = true;
|
||||
if (fileName.matches("^.+\\.(?i)(xlsx)$")) {
|
||||
isExcel2003 = false;
|
||||
}
|
||||
InputStream is = file.getInputStream();
|
||||
Workbook wb = null;
|
||||
if (isExcel2003) {
|
||||
wb = new HSSFWorkbook(is);
|
||||
} else {
|
||||
wb = new XSSFWorkbook(is);
|
||||
}
|
||||
Sheet sheet = wb.getSheetAt(0);
|
||||
resultList = getSheetVal(sheet, resultCell);
|
||||
try {
|
||||
enterpriseInfoService.saveList(resultList);
|
||||
return ResultBean.fireSuccess().setMsg("数据导入成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return ResultBean.fireFail().setMsg("数据导入失败");
|
||||
}
|
||||
}
|
||||
|
||||
public List getSheetVal(Sheet sheet, int[] resultCell) {
|
||||
SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd");
|
||||
List<EnterpriseInfo> enterpriseInfoList = new ArrayList<>();
|
||||
int[] resultIndex = new int[resultCell.length];
|
||||
EnterpriseInfo enterpriseInfo;
|
||||
for (int r = 1; r <= sheet.getLastRowNum(); r++) {
|
||||
Row row = sheet.getRow(r);
|
||||
if (row == null) {
|
||||
continue;
|
||||
}
|
||||
enterpriseInfo = new EnterpriseInfo();
|
||||
int cccc = row.getPhysicalNumberOfCells();
|
||||
for (int i = 0; i < resultCell.length; i++) {
|
||||
String temp = null;
|
||||
Cell cell = row.getCell(i);
|
||||
if (row.getCell(i) != null) {
|
||||
temp = getCellVal(row.getCell(i)).toString().trim();
|
||||
} else {
|
||||
temp = null;
|
||||
}
|
||||
for (int j = 0; j < resultCell.length; j++) {
|
||||
if (i == resultCell[j]) {
|
||||
switch (i) {
|
||||
case 0:
|
||||
//单位sid
|
||||
enterpriseInfo.setOrgSid(temp);
|
||||
break;
|
||||
case 1:
|
||||
//单位名称
|
||||
enterpriseInfo.setEnterpriseName(temp);
|
||||
break;
|
||||
case 2:
|
||||
//类型
|
||||
enterpriseInfo.setEnterpriseType(temp);
|
||||
break;
|
||||
case 3:
|
||||
//注册资本
|
||||
enterpriseInfo.setRegisteredCapital(temp);
|
||||
break;
|
||||
case 4:
|
||||
//成立日期
|
||||
enterpriseInfo.setEstablishmentDate(temp);
|
||||
break;
|
||||
case 5:
|
||||
//从业人数
|
||||
Double f = Double.valueOf(temp);
|
||||
Integer a = (int) Math.ceil(f);
|
||||
enterpriseInfo.setEmployeesNum(a);
|
||||
break;
|
||||
case 6:
|
||||
//营业期限
|
||||
enterpriseInfo.setOperationsDuration(temp);
|
||||
break;
|
||||
case 7:
|
||||
//主营范围
|
||||
enterpriseInfo.setMainCampRange(temp);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
enterpriseInfoList.add(enterpriseInfo);
|
||||
}
|
||||
|
||||
return enterpriseInfoList;
|
||||
}
|
||||
|
||||
public Object getCellVal(Cell cell) {
|
||||
Object obj = null;
|
||||
switch (cell.getCellTypeEnum()) {
|
||||
case BOOLEAN:
|
||||
obj = cell.getBooleanCellValue();
|
||||
break;
|
||||
case ERROR:
|
||||
obj = cell.getErrorCellValue();
|
||||
break;
|
||||
case NUMERIC:
|
||||
obj = cell.getNumericCellValue();
|
||||
break;
|
||||
case STRING:
|
||||
obj = cell.getStringCellValue();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.enterpriseinfo;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.enterpriseinfo.EnterpriseInfo;
|
||||
import com.yxt.jlzx.jlcyry.api.enterpriseinfo.EnterpriseInfoOneVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface EnterpriseInfoMapper extends BaseMapper<EnterpriseInfo> {
|
||||
|
||||
List<EnterpriseInfoOneVo> selectOrgNameList(String orgName);
|
||||
|
||||
public EnterpriseInfoOneVo selectOrg(String orgSid);
|
||||
|
||||
public int saveList(List<EnterpriseInfo> punishmentList);
|
||||
|
||||
public void updateState(@Param("staffInfoSid") String staffInfoSid, @Param("state") int state);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.enterpriseinfo.EnterpriseInfoMapper">
|
||||
<select id="selectOrgNameList" resultType="com.yxt.jlzx.jlcyry.api.enterpriseinfo.EnterpriseInfoOneVo">
|
||||
SELECT ei.orgSid, ei.enterpriseName orgName
|
||||
FROM jlzx_base.enterprise_info ei
|
||||
LEFT JOIN jlzx_system.organization o
|
||||
ON ei.orgSid = o.sid
|
||||
LEFT JOIN jlzx_cxjl.promise p
|
||||
ON p.orgSid = o.sid
|
||||
WHERE p.state = 2
|
||||
AND ei.enterpriseName LIKE #{orgName}
|
||||
</select>
|
||||
|
||||
<select id="selectOrg" resultType="com.yxt.jlzx.jlcyry.api.enterpriseinfo.EnterpriseInfoOneVo">
|
||||
SELECT ei.orgSid, ei.enterpriseName orgName, o.sid orgSid
|
||||
FROM enterprise_info ei
|
||||
LEFT JOIN jlzx_system.organization o ON o.sid = ei.orgSid
|
||||
WHERE o.sid = #{orgSid}
|
||||
</select>
|
||||
|
||||
<insert id="saveList" parameterType="java.util.List">
|
||||
INSERT INTO enterprise_info(sid, enterpriseName, enterpriseType, orgSid, establishmentDate, mainCampRange,
|
||||
registeredCapital,
|
||||
employeesNum, operationsDuration)
|
||||
VALUES
|
||||
<foreach collection="list" item="item" index="index" separator=",">
|
||||
(UUID(), #{item.enterpriseName,jdbcType=VARCHAR}, #{item.enterpriseType,jdbcType=VARCHAR},
|
||||
#{item.orgSid,jdbcType=VARCHAR}, #{item.establishmentDate,jdbcType=VARCHAR},
|
||||
#{item.mainCampRange,jdbcType=VARCHAR}
|
||||
, #{item.registeredCapital,jdbcType=VARCHAR}, #{item.employeesNum,jdbcType=VARCHAR},
|
||||
#{item.operationsDuration,jdbcType=VARCHAR})
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.enterpriseinfo;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.enterpriseinfo.EnterpriseInfo;
|
||||
import com.yxt.jlzx.jlcyry.api.enterpriseinfo.EnterpriseInfoOneVo;
|
||||
import com.yxt.jlzx.system.api.organization.Organization;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class EnterpriseInfoService extends MybatisBaseService<EnterpriseInfoMapper, EnterpriseInfo> {
|
||||
|
||||
List<EnterpriseInfoOneVo> selectOrgNameList(String orgName){
|
||||
return baseMapper.selectOrgNameList(orgName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据单位sid查询企业信息
|
||||
*
|
||||
* @param orgSid 单位sid
|
||||
* @return
|
||||
*/
|
||||
public EnterpriseInfoOneVo selectOrg(String orgSid) {
|
||||
return baseMapper.selectOrg(orgSid);
|
||||
|
||||
}
|
||||
|
||||
public int saveList(List<EnterpriseInfo> punishmentList) {
|
||||
return baseMapper.saveList(punishmentList);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,234 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.expertpostinfo;
|
||||
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.jlzx.jlcyry.api.expertPostInfo.ExpertPostInfo;
|
||||
import com.yxt.jlzx.jlcyry.api.expertPostInfo.ExpertPostInfoApi;
|
||||
import com.yxt.jlzx.jlcyry.api.expertPostInfo.ExpertPostInfoDto;
|
||||
import com.yxt.jlzx.jlcyry.api.expertPostInfo.ExpertPostInfoVo;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditional;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffadditional.StaffAdditionalService;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonApi;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonListVo;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonDto;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonQuery;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/31 8:45
|
||||
* @description 专家任职情况
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/expertPostInfo")
|
||||
@Api(tags = "专家任职情况")
|
||||
public class ExpertPostInfoApiImpl implements ExpertPostInfoApi {
|
||||
|
||||
@Autowired
|
||||
private ExpertPostInfoService expertPostInfoService;
|
||||
@Autowired
|
||||
private PhotoCommonApi photoCommonApi;
|
||||
@Autowired
|
||||
private DictCommonApi dictCommonApi;
|
||||
@Autowired
|
||||
private StaffAdditionalService staffAdditionalService;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
|
||||
@Override
|
||||
public ResultBean save(@Valid ExpertPostInfoDto expertPostInfoDto) {
|
||||
ExpertPostInfo expertPostInfo = expertPostInfoDto.toEntity();
|
||||
if(StringUtils.isNoneBlank(expertPostInfoDto.getCertUrl())) {
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
photoCommon.setFilePath(expertPostInfoDto.getCertUrl());
|
||||
photoCommon.setType("expertPostInfoPhoto");
|
||||
photoCommon.setLinkSid(expertPostInfo.getSid());
|
||||
ResultBean resultBean=photoCommonApi.save(photoCommon);
|
||||
}
|
||||
boolean isSave = expertPostInfoService.save(expertPostInfo);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
|
||||
int count=expertPostInfoService.selectCountByStaffSid(expertPostInfo.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(expertPostInfo.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setExpertPostInfoNum(count);
|
||||
staffAdditional.setExpertPostInfoState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional=new StaffAdditional();
|
||||
staffAdditional.setExpertPostInfoNum(count);
|
||||
staffAdditional.setExpertPostInfoState(1);
|
||||
staffAdditional.setStaffSid(expertPostInfo.getStaffSid());
|
||||
staffAdditionalService.save(staffAdditional);
|
||||
}
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean update(@Valid ExpertPostInfoDto expertPostInfoDto, String sid) {
|
||||
//根据sid查询教育经历是否存在
|
||||
ExpertPostInfo expertPostInfo = expertPostInfoService.fetchBySid(sid);
|
||||
if (expertPostInfo == null) {
|
||||
return ResultBean.fireFail().setMsg("该专家任职情况不存在");
|
||||
}
|
||||
expertPostInfo.setState(1);
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
if(expertPostInfoDto.getCertUrl().indexOf(path)>-1) {
|
||||
expertPostInfoDto.setCertUrl(expertPostInfoDto.getCertUrl().replace(path, ""));
|
||||
}
|
||||
int i = expertPostInfoService.updateBySid(expertPostInfoDto.toMap(expertPostInfo), sid);
|
||||
if (i <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(expertPostInfo.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setExpertPostInfoState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("expertPostInfoPhoto");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
photoCommon.setFilePath(expertPostInfo.getCertUrl());
|
||||
photoCommon.setType("expertPostInfoPhoto");
|
||||
photoCommon.setLinkSid(sid);
|
||||
photoCommonApi.save(photoCommon);
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除教育经历
|
||||
*
|
||||
* @param sid 教育经历sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid) {
|
||||
//根据sid查询教育经历是否存在
|
||||
ExpertPostInfo expertPostInfo = expertPostInfoService.fetchBySid(sid);
|
||||
if (expertPostInfo == null) {
|
||||
return ResultBean.fireFail().setMsg("该专家任职情况不存在");
|
||||
}
|
||||
int i = expertPostInfoService.deleteBySid(sid);
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
|
||||
int count=expertPostInfoService.selectCountByStaffSid(expertPostInfo.getStaffSid());
|
||||
int num=expertPostInfoService.selectStateByStaffSid(expertPostInfo.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(expertPostInfo.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setExpertPostInfoNum(count);
|
||||
if(num==0) {
|
||||
staffAdditional.setExpertPostInfoState(2);//已审核
|
||||
}else {
|
||||
staffAdditional.setExpertPostInfoState(1);//未审核
|
||||
}
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("expertPostInfoPhoto");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过人员sid查询教育经历
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return 该人员的教育经历list
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<List<ExpertPostInfoVo>> selectByStaffSid(String staffSid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
List<ExpertPostInfoVo> page = expertPostInfoService.selectByStaffSid(path,staffSid);
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 注册审核通过更新人员信息
|
||||
*
|
||||
* @param staffRegisterDto 注册人员信息dto对象
|
||||
* @param sid 注册人员sid
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public ResultBean infoUpdate(Integer state, String sid){
|
||||
ExpertPostInfo expertPostInfo=expertPostInfoService.fetchBySid(sid);
|
||||
if (state!=null) {
|
||||
//通过
|
||||
int i = expertPostInfoService.updateState(state, sid);
|
||||
|
||||
if(expertPostInfo!=null) {
|
||||
int num=expertPostInfoService.selectStateByStaffSid(expertPostInfo.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(expertPostInfo.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
if(num==0) {
|
||||
staffAdditional.setExpertPostInfoState(2);//已审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional.setExpertPostInfoState(1);//未审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
}else {
|
||||
|
||||
if(state==2) {
|
||||
return ResultBean.fireSuccess().setMsg("审核通过");
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("审核未通过");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("专家任职情况信息审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<ExpertPostInfoVo> getVo(String sid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
ResultBean<ExpertPostInfoVo> resultBean=ResultBean.fireFail();
|
||||
//Education education=educationService.selectBySid(sid,path);
|
||||
ExpertPostInfo expertPostInfo=expertPostInfoService.fetchBySid(sid);
|
||||
ExpertPostInfoVo vo=new ExpertPostInfoVo();
|
||||
vo.fromEntity(expertPostInfo);
|
||||
vo.setCertUrl(path+vo.getCertUrl());
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<Map<String, Object>> dictSelect() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
ResultBean<Map<String, Object>> dictCommonInitVoResultBean = dictCommonApi.dictCommonExpertPostInfo();
|
||||
map.put("dictCommonList", dictCommonInitVoResultBean.getData());
|
||||
return new ResultBean().success().setData(map);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.expertpostinfo;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.education.Education;
|
||||
import com.yxt.jlzx.jlcyry.api.expertPostInfo.ExpertPostInfo;
|
||||
import com.yxt.jlzx.jlcyry.api.expertPostInfo.ExpertPostInfoVo;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/1 9:21
|
||||
* @description 教育经历
|
||||
*/
|
||||
@Mapper
|
||||
public interface ExpertPostInfoMapper extends BaseMapper<ExpertPostInfo> {
|
||||
|
||||
/**
|
||||
* 根据人员sid查询该人员的教育经历
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return 该人员的教育经历list
|
||||
*/
|
||||
public List<ExpertPostInfoVo> selectByStaffSid( @Param("staffSid")String staffSid,@Param("path") String path);
|
||||
|
||||
int updateState(@Param("state") Integer state, @Param("sid") String sid);
|
||||
|
||||
public int selectStateByStaffSid(String staffSid);
|
||||
public int selectCountByStaffSid(String staffSid);
|
||||
public List<ExpertPostInfo> listByStaffSid(String staffSid);
|
||||
|
||||
public void updateBystaffSid(@Param("staffInfoSid") String staffInfoSid, @Param("state") int state);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.expertpostinfo.ExpertPostInfoMapper">
|
||||
|
||||
<select id="selectByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.expertPostInfo.ExpertPostInfoVo">
|
||||
select
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=edu.`ownerOrg` and dictType='rzjg') ownerOrg,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=edu.`post` and dictType='zjzw') post,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=edu.`subject` and dictType='zylb') subject,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=edu.`fzjg` and dictType='fzjg') fzjg,
|
||||
edu.`certNo`,
|
||||
edu.`issueOrg`,
|
||||
edu.`dateStart`,
|
||||
edu.`dateEnd`,
|
||||
edu.`staffSid`,
|
||||
edu.sid ,edu.state, concat(#{path},edu.certUrl) as certUrl
|
||||
from expert_post_info edu
|
||||
where edu.staffSid = #{staffSid} ORDER BY dateStart
|
||||
</select>
|
||||
<update id="updateState">
|
||||
UPDATE expert_post_info
|
||||
SET state =#{state}
|
||||
WHERE sid = #{sid}
|
||||
</update>
|
||||
|
||||
<update id="updateBystaffSid">
|
||||
UPDATE expert_post_info
|
||||
SET state =#{state}
|
||||
WHERE staffSid = #{staffInfoSid}
|
||||
</update>
|
||||
|
||||
<select id="selectStateByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id) from expert_post_info where state=1 and staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
<select id="selectCountByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id) from expert_post_info where staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
<select id="listByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.expertPostInfo.ExpertPostInfo">
|
||||
SELECT *
|
||||
FROM expert_post_info
|
||||
WHERE staffSid = #{staffSid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.expertpostinfo;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.education.Education;
|
||||
import com.yxt.jlzx.jlcyry.api.expertPostInfo.ExpertPostInfo;
|
||||
import com.yxt.jlzx.jlcyry.api.expertPostInfo.ExpertPostInfoVo;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/1 9:21
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class ExpertPostInfoService extends MybatisBaseService<ExpertPostInfoMapper, ExpertPostInfo> {
|
||||
|
||||
/**
|
||||
* 通过人员sid查询该人员的教育经历
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return list
|
||||
*/
|
||||
public List<ExpertPostInfoVo> selectByStaffSid(String path,String staffSid) {
|
||||
return baseMapper.selectByStaffSid(staffSid,path);
|
||||
}
|
||||
|
||||
public int updateState(Integer state, String sid) {
|
||||
return baseMapper.updateState(state, sid);
|
||||
}
|
||||
|
||||
public int selectStateByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectStateByStaffSid(staffSid);
|
||||
}
|
||||
public int selectCountByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectCountByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public List<ExpertPostInfo> listByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.listByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public void updateState(String staffInfoSid, int state) {
|
||||
// TODO Auto-generated method stub
|
||||
baseMapper.updateBystaffSid(staffInfoSid,state);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.exportoexcel;
|
||||
|
||||
import org.apache.poi.hssf.usermodel.*;
|
||||
import org.apache.poi.ss.usermodel.HorizontalAlignment;
|
||||
import org.apache.poi.ss.usermodel.VerticalAlignment;
|
||||
import org.apache.poi.ss.util.CellRangeAddress;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.*;
|
||||
import java.lang.reflect.Field;
|
||||
import java.net.URLEncoder;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class exportToExcel {
|
||||
// @Resource
|
||||
// OnLineConfig onLineConfig;
|
||||
|
||||
/**
|
||||
*
|
||||
* @param sheetTitle 页签名
|
||||
* @param title 表头
|
||||
* @param list 导出数据
|
||||
* @return
|
||||
*/
|
||||
public String export(String sheetTitle, String[] title, List<Object> list, HttpServletResponse response) {
|
||||
|
||||
HSSFWorkbook wb = new HSSFWorkbook();//创建excel表
|
||||
|
||||
HSSFSheet sheet = wb.createSheet(sheetTitle);
|
||||
sheet.setDefaultColumnWidth(40);//设置默认行宽
|
||||
sheet.createFreezePane(0,2,0,2); //不动行
|
||||
CellRangeAddress c = CellRangeAddress.valueOf("A2:J2"); //设置筛选框
|
||||
sheet.setAutoFilter(c);
|
||||
//表头样式(加粗,水平居中,垂直居中)
|
||||
HSSFCellStyle cellStyle = wb.createCellStyle();
|
||||
cellStyle.setAlignment(HorizontalAlignment.CENTER);//水平居中
|
||||
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
|
||||
//设置边框样式
|
||||
// cellStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
|
||||
// cellStyle.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
|
||||
// cellStyle.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
|
||||
// cellStyle.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
|
||||
|
||||
HSSFFont fontStyle = wb.createFont();
|
||||
// fontStyle.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
|
||||
fontStyle.setFontHeightInPoints((short) 12);//设置字体大小
|
||||
cellStyle.setFont(fontStyle);
|
||||
|
||||
//标题样式(加粗,垂直居中)
|
||||
HSSFCellStyle cellStyle2 = wb.createCellStyle();
|
||||
cellStyle2.setAlignment(HorizontalAlignment.CENTER);//水平居中
|
||||
cellStyle2.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
|
||||
cellStyle2.setFont(fontStyle);
|
||||
|
||||
//设置边框样式
|
||||
// cellStyle2.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
|
||||
// cellStyle2.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
|
||||
// cellStyle2.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
|
||||
// cellStyle2.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
|
||||
|
||||
//字段样式(垂直居中)
|
||||
HSSFCellStyle cellStyle3 = wb.createCellStyle();
|
||||
cellStyle3.setAlignment(HorizontalAlignment.CENTER);//水平居中
|
||||
cellStyle3.setVerticalAlignment(VerticalAlignment.CENTER);//垂直居中
|
||||
cellStyle3.setFont(fontStyle); //字体大小
|
||||
cellStyle3.setWrapText(false); //自动换行
|
||||
|
||||
//设置边框样式
|
||||
// cellStyle3.setBorderBottom(HSSFCellStyle.BORDER_THIN); //下边框
|
||||
// cellStyle3.setBorderLeft(HSSFCellStyle.BORDER_THIN);//左边框
|
||||
// cellStyle3.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边框
|
||||
// cellStyle3.setBorderRight(HSSFCellStyle.BORDER_THIN);//右边框
|
||||
|
||||
//创建表头
|
||||
HSSFRow row = sheet.createRow(0);
|
||||
row.setHeightInPoints(30);//行高
|
||||
HSSFCell cell = row.createCell(0);
|
||||
cell.setCellValue(sheetTitle); //2021.09.17 去掉表头
|
||||
cell.setCellStyle(cellStyle);
|
||||
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, (title.length - 1)));
|
||||
//创建标题
|
||||
HSSFRow rowTitle = sheet.createRow(1);
|
||||
rowTitle.setHeightInPoints(30);
|
||||
HSSFCell hc;
|
||||
for (int i = 0; i < title.length; i++) {
|
||||
hc = rowTitle.createCell(i);
|
||||
hc.setCellValue(title[i]);
|
||||
hc.setCellStyle(cellStyle2);
|
||||
}
|
||||
byte result[] = null;
|
||||
ByteArrayOutputStream out = null;
|
||||
FileOutputStream output = null;
|
||||
String createdate = null;
|
||||
try {
|
||||
HSSFPatriarch patriarch = sheet.createDrawingPatriarch();
|
||||
//创建表格数据
|
||||
Field[] fields;
|
||||
int i = 2;
|
||||
for (Object obj : list) {
|
||||
fields = obj.getClass().getDeclaredFields();
|
||||
HSSFRow rowBody = sheet.createRow(i);
|
||||
rowBody.setHeightInPoints(50); //100
|
||||
int j = 0;
|
||||
for (Field f : fields) {
|
||||
f.setAccessible(true);
|
||||
Object va = f.get(obj);
|
||||
if (null == va) {
|
||||
va = "";
|
||||
}
|
||||
hc = rowBody.createCell(j);
|
||||
hc.setCellValue(va.toString());
|
||||
hc.setCellStyle(cellStyle3);
|
||||
j++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
Date date = new Date();
|
||||
// 设置要获取到什么样的时间
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmSS");
|
||||
// 获取String类型的时间
|
||||
createdate = sdf.format(date);
|
||||
//创建一个文件夹 2021.09.17,保存路径先固定,后期在修改 ;//onLineConfig.getShengTingFile()
|
||||
// String downloadDircopy = "C:\\Users\\Administrator\\Desktop\\" + File.separator + createdate + "_" + sheetTitle + File.separator;
|
||||
// File downloadFilePath1 = new File(downloadDircopy);
|
||||
// if (downloadFilePath1.exists() == false){
|
||||
// // 如果该目录不存在,则创建之
|
||||
// downloadFilePath1.mkdirs();
|
||||
// }
|
||||
// output = new FileOutputStream(downloadDircopy + sheetTitle+".xls");
|
||||
// wb.write(output);
|
||||
// output.flush();
|
||||
try{
|
||||
buildExcelDocument(sheetTitle+".xls", wb, response);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
// Logger.getLogger(ExportExcel.class.getName()).log(Level.SEVERE, null, ex);
|
||||
} finally {
|
||||
try {
|
||||
if (null != output) {
|
||||
output.close();
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
// Logger.getLogger(ExportExcel.class.getName()).log(Level.SEVERE, null, ex);
|
||||
} finally {
|
||||
try {
|
||||
wb.close();
|
||||
} catch (IOException ex) {
|
||||
// Logger.getLogger(ExportExcel.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
// return "images" + File.separator + createdate;
|
||||
return "导出成功";
|
||||
}
|
||||
|
||||
//浏览器下载excel 2021.10.31
|
||||
private void buildExcelDocument(String filename, HSSFWorkbook workbook, HttpServletResponse response) throws IOException {
|
||||
// response.setContentType("application/vnd.ms-excel");
|
||||
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, "utf-8"));
|
||||
OutputStream outputStream = response.getOutputStream();
|
||||
workbook.write(outputStream);
|
||||
outputStream.flush();
|
||||
outputStream.close();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.organizationlabel;
|
||||
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.jlzx.jlcyry.api.organizationlabel.OrganizationLabel;
|
||||
import com.yxt.jlzx.jlcyry.api.organizationlabel.OrganizationLabelApi;
|
||||
import com.yxt.jlzx.jlcyry.api.organizationlabel.OrganizationLabelDto;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2021/9/15 10:59
|
||||
* @description
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping(value = "v1/organizationlabels")
|
||||
@Api(tags = "机构标签")
|
||||
public class OrganizationLabelApiImpl implements OrganizationLabelApi {
|
||||
|
||||
@Autowired
|
||||
private OrganizationLabelService organizationLabelService;
|
||||
|
||||
@Override
|
||||
public ResultBean save(OrganizationLabelDto organizationLabelDto) {
|
||||
OrganizationLabel organizationLabel = new OrganizationLabel();
|
||||
organizationLabelDto.fillEntity(organizationLabel);
|
||||
boolean isSave = organizationLabelService.save(organizationLabel);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean delete(String orgSid, String labelKey) {
|
||||
OrganizationLabel organizationLabel = organizationLabelService.selectByOrgSidKey(orgSid, labelKey);
|
||||
if (organizationLabel == null) {
|
||||
return ResultBean.fireFail().setMsg("此机构不存在标签");
|
||||
}
|
||||
int i = organizationLabelService.deleteByOrgSidKey(orgSid, labelKey);
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.organizationlabel;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.organizationlabel.OrganizationLabel;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2021/9/15 11:27
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrganizationLabelMapper extends BaseMapper<OrganizationLabel> {
|
||||
/**
|
||||
* @param orgSid 单位sid
|
||||
* @param labelKey 机构的标签key
|
||||
* @description: 根据单位的sid和机构的标签key查询信息
|
||||
* @return:
|
||||
* @Author: dimengzhe
|
||||
* @Date: 2021/10/8 17:13
|
||||
*/
|
||||
OrganizationLabel selectByOrgSidKey(@Param("orgSid") String orgSid, @Param("labelKey") String labelKey);
|
||||
|
||||
/**
|
||||
* @param orgSid 单位sid
|
||||
* @param labelKey 机构标签key
|
||||
* @description: 根据单位的sid和机构的标签key删除信息
|
||||
* @return:
|
||||
* @Author: dimengzhe
|
||||
* @Date: 2021/10/8 17:20
|
||||
*/
|
||||
int deleteByOrgSidKey(@Param("orgSid") String orgSid, @Param("labelKey") String labelKey);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.organizationlabel.OrganizationLabelMapper">
|
||||
<!--根据单位sid和机构标签key查询信息-->
|
||||
<select id="selectByOrgSidKey" resultType="com.yxt.jlzx.jlcyry.api.organizationlabel.OrganizationLabel">
|
||||
SELECT *
|
||||
FROM organization_label
|
||||
WHERE orgSid = #{orgSid}
|
||||
AND labelKey = #{labelKey}
|
||||
</select>
|
||||
<!--根据单位sid和机构标签key删除信息-->
|
||||
<delete id="deleteByOrgSidKey">
|
||||
DELETE
|
||||
FROM organization_label
|
||||
WHERE orgSid = #{orgSid}
|
||||
AND labelKey = #{labelKey}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.organizationlabel;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.organizationlabel.OrganizationLabel;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2021/9/15 11:26
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class OrganizationLabelService extends MybatisBaseService<OrganizationLabelMapper, OrganizationLabel> {
|
||||
|
||||
/**
|
||||
* @param orgSid 单位sid
|
||||
* @param labelKey 机构标签key
|
||||
* @description: 根据单位sid和机构标签key查询信息
|
||||
* @return:
|
||||
* @Author: dimengzhe
|
||||
* @Date: 2021/10/8 17:16
|
||||
*/
|
||||
public OrganizationLabel selectByOrgSidKey(String orgSid, String labelKey) {
|
||||
return baseMapper.selectByOrgSidKey(orgSid, labelKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param orgSid 单位sid
|
||||
* @param labelKey 机构标签key
|
||||
* @description: 根据单位sid和机构标签key删除机构标签
|
||||
* @return:
|
||||
* @Author: dimengzhe
|
||||
* @Date: 2021/10/8 17:19
|
||||
*/
|
||||
public int deleteByOrgSidKey(String orgSid, String labelKey) {
|
||||
return baseMapper.deleteByOrgSidKey(orgSid, labelKey);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,150 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.orgcert;
|
||||
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.jlzx.jlcyry.api.orgcert.*;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonDto;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonQuery;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 9:27
|
||||
* @description 专业项目
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("v1/orgCerts")
|
||||
@Api(tags = "技术机构证书")
|
||||
public class OrgCertApiImpl implements OrgCertApi {
|
||||
@Autowired
|
||||
private DictCommonApi dictCommonApi;
|
||||
@Autowired
|
||||
private OrgCertService orgCertService;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
private PhotoCommonApi photoCommonApi;
|
||||
/**
|
||||
* 专业项目保存
|
||||
*
|
||||
* @param orgCertDto 专业项目dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(@Valid OrgCertDto orgCertDto) {
|
||||
OrgCert orgCert = orgCertDto.toEntity();
|
||||
// String path=fileUploadComponent.getUrlPrefix();
|
||||
// orgCert.setCertUrl(path+orgCert.getCertUrl());
|
||||
if(StringUtils.isNoneBlank(orgCert.getCertUrl())) {
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
photoCommon.setFilePath(orgCert.getCertUrl());
|
||||
photoCommon.setType("orgcertPhoto");
|
||||
photoCommon.setLinkSid(orgCert.getSid());
|
||||
photoCommonApi.save(photoCommon);
|
||||
}
|
||||
boolean isSave = orgCertService.save(orgCert);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean update(@Valid OrgCertDto orgCertDto, String sid) {
|
||||
//根据sid查询专业项目是否存在
|
||||
OrgCert orgCert = orgCertService.fetchBySid(sid);
|
||||
if (orgCert == null) {
|
||||
return ResultBean.fireFail().setMsg("该技术机构证书不存在");
|
||||
}
|
||||
int i = orgCertService.updateBySid(orgCertDto.toMap(orgCert), sid);
|
||||
if (i <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("orgcertPhoto");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
photoCommon.setFilePath(orgCert.getCertUrl());
|
||||
photoCommon.setType("orgcertPhoto");
|
||||
photoCommon.setLinkSid(sid);
|
||||
photoCommonApi.save(photoCommon);
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 专业项目删除
|
||||
*
|
||||
* @param sid 专业项目sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid) {
|
||||
//根据sid查询专业项目是否存在
|
||||
OrgCert orgCert = orgCertService.fetchBySid(sid);
|
||||
if (orgCert == null) {
|
||||
return ResultBean.fireFail().setMsg("该技术机构证书不存在");
|
||||
}
|
||||
int i = orgCertService.deleteBySid(sid);
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("orgcertPhoto");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<List<OrgCertVo>> list(OrgCertQuery query) {
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<PagerVo<OrgCertVo>> pageList(PagerQuery<OrgCertQuery> pagerQuery) {
|
||||
PagerVo<OrgCertVo> pagerVo= orgCertService.page(pagerQuery);
|
||||
ResultBean<PagerVo<OrgCertVo>> objectResultBean = ResultBean.fireSuccess();
|
||||
return objectResultBean.setData(pagerVo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<OrgCertVo> getVo(String sid) {
|
||||
ResultBean<OrgCertVo> resultBean=ResultBean.fireFail();
|
||||
OrgCert orgCert=orgCertService.fetchBySid(sid);
|
||||
OrgCertVo vo=new OrgCertVo();
|
||||
vo.fromEntity(orgCert);
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
vo.setCertUrl(path+vo.getCertUrl());
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<List<Map<String, Object>>> selectByStaffSid(String orgSid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
List<Map<String, Object>> page = orgCertService.selectByStaffSid(orgSid,path);
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.orgcert;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.orgcert.OrgCert;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 9:27
|
||||
* @description 专业项目
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrgCertMapper extends BaseMapper<OrgCert> {
|
||||
|
||||
int updateState(@Param("state") Integer state, @Param("sid") String sid);
|
||||
|
||||
List<Map<String, Object>> selectByStaffSid(@Param("orgSid") String orgSid,@Param("path") String path);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.orgcert.OrgCertMapper">
|
||||
|
||||
<select id="selectByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.orgcert.OrgCertVo">
|
||||
select c.name,c.certNo,c.issueOrg,c.issueDate,c.dateEnd,c.orgSid,c.sid,c.state, concat(#{path},c.certUrl) as certUrl
|
||||
from org_cert c
|
||||
where c.orgSid = #{orgSid} ORDER BY issueDate DESC
|
||||
</select>
|
||||
<update id="updateState">
|
||||
UPDATE org_cert
|
||||
SET state =#{state}
|
||||
WHERE sid = #{sid}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.orgcert;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.orgcert.OrgCert;
|
||||
import com.yxt.jlzx.jlcyry.api.orgcert.OrgCertQuery;
|
||||
import com.yxt.jlzx.jlcyry.api.orgcert.OrgCertVo;
|
||||
import com.yxt.jlzx.system.api.organization.TechnicalInstitutionsVo;
|
||||
import com.yxt.jlzx.system.api.systemlog.SystemLogQuery;
|
||||
import com.yxt.jlzx.system.api.systemlog.SystemLogVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 9:27
|
||||
* @description 专业项目
|
||||
*/
|
||||
@Service
|
||||
public class OrgCertService extends MybatisBaseService<OrgCertMapper, OrgCert> {
|
||||
|
||||
|
||||
|
||||
public int updateState(Integer state, String sid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.updateState(state, sid);
|
||||
}
|
||||
|
||||
|
||||
public List<Map<String, Object>> selectByStaffSid(String orgSid,String path) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectByStaffSid(orgSid,path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,245 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.professionalachievement;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalachievement.ProfessionalAchievement;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalachievement.ProfessionalAchievementApi;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalachievement.ProfessionalAchievementDto;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalachievement.ProfessionalAchievementVo;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalwork.ProfessionalWork;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditional;
|
||||
import com.yxt.jlzx.jlcyry.biz.professionalwork.ProfessionalWorkService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffadditional.StaffAdditionalService;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonDto;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonOneVo;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonQuery;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonVo;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/31 8:45
|
||||
* @description
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/professionalAchievement")
|
||||
@Api(tags = "专业技术工作业绩")
|
||||
public class ProfessionalAchievementApiImpl implements ProfessionalAchievementApi {
|
||||
@Autowired
|
||||
private DictCommonApi dictCommonApi;
|
||||
@Autowired
|
||||
private ProfessionalAchievementService professionalAchievementService;
|
||||
@Autowired
|
||||
private StaffAdditionalService staffAdditionalService;
|
||||
@Autowired
|
||||
private PhotoCommonApi photoCommonApi;
|
||||
@Autowired
|
||||
private ProfessionalWorkService professionalWorkService;
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<List<ProfessionalAchievementVo>> selectByStaffSid(String staffSid) {
|
||||
List<ProfessionalAchievementVo> page = professionalAchievementService.selectByStaffSid(staffSid);
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<ProfessionalAchievementVo>> selectByWorkSid(String workSid) {
|
||||
List<ProfessionalAchievementVo> page = professionalAchievementService.selectByWorkSid(workSid);
|
||||
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public ResultBean save(@Valid ProfessionalAchievementDto professionalAchievementDto) {
|
||||
// ProfessionalAchievement professionalAchievement = professionalAchievementDto.toEntity();
|
||||
// boolean isSave = professionalAchievementService.save(professionalAchievement);
|
||||
// if (!isSave) {
|
||||
// return ResultBean.fireFail().setMsg("保存失败");
|
||||
// }
|
||||
// int count=professionalAchievementService.selectCountByStaffSid(professionalAchievement.getStaffSid());
|
||||
// List<String> list=professionalAchievementDto.getCertUrlList();
|
||||
// PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
// if(list!=null&&list.size()>0) {
|
||||
// for (int i = 0; i < list.size(); i++) {
|
||||
// photoCommon.setFilePath(list.get(i));
|
||||
// photoCommon.setType("professionalAchievementPhoto");
|
||||
// photoCommon.setLinkSid(professionalAchievement.getSid());
|
||||
// photoCommonApi.save(photoCommon);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(professionalAchievement.getStaffSid());
|
||||
// if(staffAdditional!=null) {
|
||||
// staffAdditional.setProfessionalAchievementNum(count);
|
||||
// staffAdditional.setProfessionalAchievementState(1);
|
||||
// staffAdditionalService.updateById(staffAdditional);
|
||||
// }else {
|
||||
// staffAdditional=new StaffAdditional();
|
||||
// staffAdditional.setProfessionalAchievementNum(count);
|
||||
// staffAdditional.setProfessionalAchievementState(1);
|
||||
// staffAdditional.setStaffSid(professionalAchievement.getStaffSid());
|
||||
// staffAdditionalService.save(staffAdditional);
|
||||
// }
|
||||
//
|
||||
// return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
return ResultBean.fireSuccess().setMsg("暂未使用");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean update(@Valid ProfessionalAchievementDto professionalAchievementDto, String sid) {
|
||||
ProfessionalAchievement professionalAchievement = professionalAchievementService.fetchBySid(sid);
|
||||
if (professionalAchievement == null) {
|
||||
return ResultBean.fireFail().setMsg("该专业技术工作业绩不存在");
|
||||
}
|
||||
professionalAchievement.setState(1);//修改后状态改为未审核
|
||||
int num = professionalAchievementService.updateBySid(professionalAchievementDto.toMap(professionalAchievement), sid);
|
||||
if (num <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(professionalAchievement.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setProfessionalAchievementState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("professionalAchievementPhoto");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
List<PhotoCommonOneVo> list=professionalAchievementDto.getCertUrlList();
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
if(list!=null&&list.size()>0) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
photoCommon.setFilePath(list.get(i).getFilePath());
|
||||
photoCommon.setType("professionalAchievementPhoto");
|
||||
photoCommon.setLinkSid(professionalAchievement.getSid());
|
||||
photoCommonApi.save(photoCommon);
|
||||
}
|
||||
}
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean delete(String sid) {
|
||||
//根据sid查询教育经历是否存在
|
||||
// ProfessionalAchievement professionalAchievement =professionalAchievementService.fetchBySid(sid);
|
||||
// if (professionalAchievement == null) {
|
||||
// return ResultBean.fireFail().setMsg("该专业技术工作业绩不存在");
|
||||
// }
|
||||
// int i = professionalAchievementService.deleteBySid(sid);
|
||||
// if (i == 0) {
|
||||
// return ResultBean.fireFail().setMsg("删除失败");
|
||||
// }
|
||||
//
|
||||
// int count=professionalAchievementService.selectCountByStaffSid(professionalAchievement.getStaffSid());
|
||||
// int num=professionalAchievementService.selectStateByStaffSid(professionalAchievement.getStaffSid());
|
||||
// StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(professionalAchievement.getStaffSid());
|
||||
// if(staffAdditional!=null) {
|
||||
// staffAdditional.setProfessionalAchievementNum(count);
|
||||
// if(num==0) {
|
||||
// staffAdditional.setProfessionalAchievementState(2);//已审核
|
||||
// }else {
|
||||
// staffAdditional.setProfessionalAchievementState(1);//未审核
|
||||
// }
|
||||
// staffAdditionalService.updateById(staffAdditional);
|
||||
// }
|
||||
//
|
||||
// PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
// q1.setLinkSid(sid);
|
||||
// q1.setType("professionalAchievementPhoto");
|
||||
// photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
// return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("暂未使用");
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册审核通过更新人员信息
|
||||
*
|
||||
* @param staffRegisterDto 注册人员信息dto对象
|
||||
* @param sid 注册人员sid
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public ResultBean InfoUpdate(Integer state, String sid){
|
||||
ProfessionalAchievement professionalAchievement=professionalAchievementService.fetchBySid(sid);
|
||||
if (state!=null) {
|
||||
//通过
|
||||
int i = professionalAchievementService.updateState(state, sid);
|
||||
|
||||
if(professionalAchievement!=null) {
|
||||
int num=professionalAchievementService.selectStateByStaffSid(professionalAchievement.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(professionalAchievement.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
if(num==0) {
|
||||
staffAdditional.setProfessionalAchievementState(2);//已审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional.setProfessionalAchievementState(1);//未审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
}else {
|
||||
if(state==2) {
|
||||
return ResultBean.fireSuccess().setMsg("审核通过");
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("审核未通过");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("专业技术工作业绩信息审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<ProfessionalAchievementVo> getVo(String sid) {
|
||||
ResultBean<ProfessionalAchievementVo> resultBean=ResultBean.fireFail();
|
||||
ProfessionalAchievement professionalAchievement=professionalAchievementService.fetchBySid(sid);
|
||||
String professionalworkSid = professionalAchievement.getProfessionalworkSid();
|
||||
ProfessionalAchievementVo vo=new ProfessionalAchievementVo();
|
||||
vo.fromEntity(professionalAchievement);
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("professionalAchievementPhoto");
|
||||
List<PhotoCommonVo> list=photoCommonApi.queryBylinkSidAndType(q1).getData();
|
||||
vo.setCertUrlList(list);
|
||||
ProfessionalWork professionalwork = professionalWorkService.fetchBySid(professionalworkSid);
|
||||
if(professionalwork!=null) {
|
||||
vo.setDateStart(professionalwork.getDateStart());
|
||||
vo.setDateEnd(professionalwork.getDateEnd());
|
||||
}
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<Map<String, Object>> dictSelect() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
ResultBean<Map<String, Object>> dictCommonInitVoResultBean = dictCommonApi.dictCommonProfessionalAchievement();
|
||||
map.put("dictCommonList", dictCommonInitVoResultBean.getData());
|
||||
return new ResultBean().success().setData(map);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.professionalachievement;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalachievement.ProfessionalAchievement;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalachievement.ProfessionalAchievementVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/1 9:21
|
||||
* @description 专业技术资格
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProfessionalAchievementMapper extends BaseMapper<ProfessionalAchievement> {
|
||||
|
||||
|
||||
/**
|
||||
* 根据人员sid查询该人员的教育经历
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return 该人员的教育经历list
|
||||
*/
|
||||
public List<ProfessionalAchievementVo> selectByStaffSid(String staffSid);
|
||||
|
||||
int updateState(@Param("state") Integer state, @Param("sid") String sid);
|
||||
|
||||
public int selectStateByStaffSid(String staffSid);
|
||||
public int selectCountByStaffSid(String staffSid);
|
||||
|
||||
public int deleteByprofessionalworkSid(String sid);
|
||||
|
||||
public ProfessionalAchievement selectByprofessionalworkSid(String sid);
|
||||
|
||||
public List<ProfessionalAchievement> listByStaffSid(String staffSid);
|
||||
|
||||
public List<ProfessionalAchievementVo> selectByWorkSid(String workSid);
|
||||
|
||||
public void updateBystaffSid(@Param("staffInfoSid") String staffInfoSid, @Param("state") int state);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.professionalachievement.ProfessionalAchievementMapper">
|
||||
|
||||
<select id="selectByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.professionalachievement.ProfessionalAchievementVo">
|
||||
select work.`dateStart`,work.name,
|
||||
work.`dateEnd`,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=work.`workTitle` and dictType='gzxm') workTitle,
|
||||
pro.`remarks`,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=pro.`completionStatus` and dictType='wcqk')completionStatus,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=pro.`achievementLevel` and dictType='cgdj') achievementLevel,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=pro.`partakeType` and dictType='cyqk') partakeType,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=pro.`achievementType` and dictType='zllx') achievementType,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=pro.`achievementSort` and dictType='pm') achievementSort,
|
||||
pro.`certUrl`,pro.sid ,pro.state
|
||||
from professional_achievement pro left join professionalwork work on pro.professionalWorkSid= work.sid
|
||||
where pro.staffSid = #{staffSid} ORDER BY dateStart
|
||||
</select>
|
||||
|
||||
<select id="selectByWorkSid" resultType="com.yxt.jlzx.jlcyry.api.professionalachievement.ProfessionalAchievementVo">
|
||||
select
|
||||
pro.`remarks`,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=pro.`achievementLevel` and dictType='cgdj') achievementLevel,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=pro.`partakeType` and dictType='cyqk') partakeType, achievementType,
|
||||
achievementSort,
|
||||
pro.`certUrl`,pro.sid ,pro.state,pro.professionalworkSid
|
||||
from professional_achievement pro
|
||||
where pro.professionalworkSid = #{workSid}
|
||||
</select>
|
||||
|
||||
<update id="updateState">
|
||||
UPDATE professional_achievement
|
||||
SET state =#{state}
|
||||
WHERE sid = #{sid}
|
||||
</update>
|
||||
|
||||
<update id="updateBystaffSid">
|
||||
UPDATE professional_achievement
|
||||
SET state =#{state}
|
||||
WHERE staffSid = #{staffInfoSid}
|
||||
</update>
|
||||
|
||||
<select id="selectStateByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id) from professional_achievement where state=1 and staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
<select id="selectCountByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id) from professional_achievement where staffSid = #{staffSid}
|
||||
</select>
|
||||
<delete id="deleteByprofessionalworkSid">
|
||||
delete from professional_achievement where professionalworkSid=#{sid}
|
||||
</delete>
|
||||
|
||||
<select id="selectByprofessionalworkSid" resultType="com.yxt.jlzx.jlcyry.api.professionalachievement.ProfessionalAchievement">
|
||||
select * from professional_achievement where professionalworkSid=#{sid}
|
||||
</select>
|
||||
|
||||
<select id="listByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.professionalachievement.ProfessionalAchievement">
|
||||
SELECT *
|
||||
FROM professional_achievement
|
||||
WHERE staffSid = #{staffSid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,70 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.professionalachievement;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.education.Education;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalachievement.ProfessionalAchievement;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalachievement.ProfessionalAchievementVo;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalqualification.ProfessionalQualification;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/1 9:21
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class ProfessionalAchievementService extends MybatisBaseService<ProfessionalAchievementMapper, ProfessionalAchievement> {
|
||||
/**
|
||||
* 通过人员sid查询该人员的教育经历
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return list
|
||||
*/
|
||||
public List<ProfessionalAchievementVo> selectByStaffSid(String staffSid) {
|
||||
return baseMapper.selectByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public int updateState(Integer state, String sid) {
|
||||
return baseMapper.updateState(state, sid);
|
||||
}
|
||||
|
||||
public int selectStateByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectStateByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public int selectCountByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectCountByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public int deleteByprofessionalworkSid(String sid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.deleteByprofessionalworkSid(sid);
|
||||
}
|
||||
|
||||
public ProfessionalAchievement selectByprofessionalworkSid(String sid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectByprofessionalworkSid(sid);
|
||||
}
|
||||
|
||||
public List<ProfessionalAchievement> listByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.listByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public List<ProfessionalAchievementVo> selectByWorkSid(String workSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectByWorkSid(workSid);
|
||||
}
|
||||
|
||||
|
||||
public void updateState(String staffInfoSid, int state) {
|
||||
// TODO Auto-generated method stub
|
||||
baseMapper.updateBystaffSid(staffInfoSid,state);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,266 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.professionalqualification;
|
||||
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalqualification.ProfessionalQualification;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalqualification.ProfessionalQualificationApi;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalqualification.ProfessionalQualificationDto;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalqualification.ProfessionalQualificationVo;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditional;
|
||||
import com.yxt.jlzx.jlcyry.biz.datadictionary.DictCommonService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffadditional.StaffAdditionalService;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonDto;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonOneVo;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonQuery;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonVo;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonApi;
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/31 8:45
|
||||
* @description
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/professionalQualification")
|
||||
@Api(tags = "专业技术资格")
|
||||
public class ProfessionalQualificationApiImpl implements ProfessionalQualificationApi {
|
||||
|
||||
@Autowired
|
||||
private ProfessionalQualificationService professionalQualificationService;
|
||||
@Autowired
|
||||
private PhotoCommonApi photoCommonApi;
|
||||
@Autowired
|
||||
private DictCommonApi dictCommonApi;
|
||||
@Autowired
|
||||
private DictCommonService dictCommonService;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
private StaffAdditionalService staffAdditionalService;
|
||||
|
||||
/**
|
||||
* 通过人员sid查询教育经历
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return 该人员的教育经历list
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<List<ProfessionalQualificationVo>> selectByStaffSid(String staffSid) {
|
||||
String path = fileUploadComponent.getUrlPrefix();
|
||||
List<ProfessionalQualificationVo> page = professionalQualificationService.selectByStaffSid(staffSid, path);
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean save(@Valid ProfessionalQualificationDto professionalQualificationDto) {
|
||||
ProfessionalQualification professionalqualification = professionalQualificationDto.toEntity();
|
||||
// if (StringUtils.isNoneBlank(professionalQualificationDto.getCertUrl())) {
|
||||
// PhotoCommonDto photoCommon = new PhotoCommonDto();
|
||||
// photoCommon.setFilePath(professionalQualificationDto.getCertUrl());
|
||||
// photoCommon.setType("professionalQualificationCertPhoto");
|
||||
// photoCommon.setLinkSid(professionalqualification.getSid());
|
||||
// ResultBean resultBean = photoCommonApi.save(photoCommon);
|
||||
// }
|
||||
boolean isSave = professionalQualificationService.save(professionalqualification);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
|
||||
StaffAdditional staffAdditional = staffAdditionalService
|
||||
.selectByStaffSid(professionalqualification.getStaffSid());
|
||||
int count = professionalQualificationService.selectCountByStaffSid(professionalqualification.getStaffSid());
|
||||
if (staffAdditional != null) {
|
||||
staffAdditional.setProfessionalQualificationNum(count);
|
||||
staffAdditional.setProfessionalQualificationState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
} else {
|
||||
staffAdditional = new StaffAdditional();
|
||||
staffAdditional.setProfessionalQualificationNum(count);
|
||||
staffAdditional.setProfessionalQualificationState(1);
|
||||
staffAdditional.setStaffSid(professionalqualification.getStaffSid());
|
||||
staffAdditionalService.save(staffAdditional);
|
||||
}
|
||||
|
||||
List<PhotoCommonOneVo> list=professionalQualificationDto.getCertUrlList();
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
if(list!=null&&list.size()>0) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
photoCommon.setFilePath(list.get(i).getFilePath());
|
||||
photoCommon.setType("professionalQualificationCertPhoto");
|
||||
photoCommon.setLinkSid(professionalqualification.getSid());
|
||||
photoCommonApi.save(photoCommon);
|
||||
}
|
||||
}
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean update(@Valid ProfessionalQualificationDto professionalQualificationDto, String sid) {
|
||||
ProfessionalQualification professionalQualification = professionalQualificationService.fetchBySid(sid);
|
||||
if (professionalQualification == null) {
|
||||
return ResultBean.fireFail().setMsg("该专业技术资格不存在");
|
||||
}
|
||||
professionalQualification.setState(1);
|
||||
int i = professionalQualificationService
|
||||
.updateBySid(professionalQualificationDto.toMap(professionalQualification), sid);
|
||||
|
||||
if (i <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
|
||||
StaffAdditional staffAdditional = staffAdditionalService.selectByStaffSid(professionalQualification.getStaffSid());
|
||||
if (staffAdditional != null) {
|
||||
staffAdditional.setProfessionalQualificationState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
|
||||
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("professionalQualificationCertPhoto");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
List<PhotoCommonOneVo> list=professionalQualificationDto.getCertUrlList();
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
if(list!=null&&list.size()>0) {
|
||||
for (int j = 0; j<list.size(); j++) {
|
||||
photoCommon.setFilePath(list.get(j).getFilePath());
|
||||
photoCommon.setType("professionalQualificationCertPhoto");
|
||||
photoCommon.setLinkSid(sid);
|
||||
photoCommonApi.save(photoCommon);
|
||||
}
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除教育经历
|
||||
*
|
||||
* @param sid 教育经历sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid) {
|
||||
// 根据sid查询教育经历是否存在
|
||||
ProfessionalQualification professionalQualification = professionalQualificationService.fetchBySid(sid);
|
||||
if (professionalQualification == null) {
|
||||
return ResultBean.fireFail().setMsg("该教育经历不存在");
|
||||
}
|
||||
int i = professionalQualificationService.deleteBySid(sid);
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
|
||||
int count = professionalQualificationService.selectCountByStaffSid(professionalQualification.getStaffSid());
|
||||
int num = professionalQualificationService.selectStateByStaffSid(professionalQualification.getStaffSid());
|
||||
StaffAdditional staffAdditional = staffAdditionalService
|
||||
.selectByStaffSid(professionalQualification.getStaffSid());
|
||||
if (staffAdditional != null) {
|
||||
staffAdditional.setProfessionalQualificationNum(count);
|
||||
if (num == 0) {
|
||||
staffAdditional.setProfessionalQualificationState(2);// 已审核
|
||||
} else {
|
||||
staffAdditional.setProfessionalQualificationState(1);// 未审核
|
||||
}
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("professionalQualificationCertPhoto");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 注册审核通过更新人员信息
|
||||
*
|
||||
* @param staffRegisterDto 注册人员信息dto对象
|
||||
* @param sid 注册人员sid
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public ResultBean InfoUpdate(Integer state, String sid) {
|
||||
ProfessionalQualification professionalQualification = professionalQualificationService.fetchBySid(sid);
|
||||
if (state != null) {
|
||||
// 通过
|
||||
int i = professionalQualificationService.updateState(state, sid);
|
||||
|
||||
if (professionalQualification != null) {
|
||||
int num = professionalQualificationService
|
||||
.selectStateByStaffSid(professionalQualification.getStaffSid());
|
||||
StaffAdditional staffAdditional = staffAdditionalService
|
||||
.selectByStaffSid(professionalQualification.getStaffSid());
|
||||
if (staffAdditional != null) {
|
||||
if (num == 0) {
|
||||
staffAdditional.setProfessionalQualificationState(2);// 已审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
} else {
|
||||
staffAdditional.setProfessionalQualificationState(1);// 未审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
} else {
|
||||
if (state == 2) {
|
||||
return ResultBean.fireSuccess().setMsg("审核通过");
|
||||
} else {
|
||||
return ResultBean.fireSuccess().setMsg("审核未通过");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return ResultBean.fireSuccess().setMsg("专业技术资格信息审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<ProfessionalQualificationVo> getVo(String sid) {
|
||||
ResultBean<ProfessionalQualificationVo> resultBean = ResultBean.fireFail();
|
||||
ProfessionalQualification professionalQualification = professionalQualificationService.fetchBySid(sid);
|
||||
ProfessionalQualificationVo vo = new ProfessionalQualificationVo();
|
||||
vo.fromEntity(professionalQualification);
|
||||
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("professionalQualificationCertPhoto");
|
||||
List<PhotoCommonVo> list=photoCommonApi.queryBylinkSidAndType(q1).getData();
|
||||
vo.setCertUrlList(list);
|
||||
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<Map<String, Object>> dictSelect() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
List<Map<String, Object>> list = new ArrayList();
|
||||
// List<Map<String, Object>> xrzglist
|
||||
// =dictCommonApi.dictSelect("xrzg").getData();
|
||||
// List<Map<String, Object>> zyjslist =
|
||||
// dictCommonApi.dictSelect("zyjs").getData();
|
||||
List<Map<String, Object>> xrzglist = dictCommonService.list("zyjszgmc");// 技术资格
|
||||
List<Map<String, Object>> zyjslist = dictCommonService.list("zyjs");// 专业技术系列
|
||||
List<Map<String, Object>> zymclist = dictCommonService.list("zymc");// 专业名称
|
||||
map.put("xrzglist", xrzglist);
|
||||
map.put("zyjslist", zyjslist);
|
||||
map.put("zymclist", zymclist);
|
||||
return new ResultBean().success().setData(map);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.professionalqualification;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalqualification.ProfessionalQualification;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalqualification.ProfessionalQualificationVo;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.javassist.expr.NewArray;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/1 9:21
|
||||
* @description 专业技术资格
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProfessionalQualificationMapper extends BaseMapper<ProfessionalQualification> {
|
||||
|
||||
|
||||
/**
|
||||
* 根据人员sid查询该人员的教育经历
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return 该人员的教育经历list
|
||||
*/
|
||||
public List<ProfessionalQualificationVo> selectByStaffSid(@Param("staffSid") String staffSid,@Param("path") String path);
|
||||
|
||||
int updateState(@Param("state") Integer state, @Param("sid") String sid);
|
||||
|
||||
public int selectStateByStaffSid(String staffSid);
|
||||
|
||||
public int selectCountByStaffSid(String staffSid);
|
||||
|
||||
public List<ProfessionalQualification> listByStaffSid(String staffSid);
|
||||
|
||||
public void updateBystaffSid(@Param("staffInfoSid") String staffInfoSid, @Param("state") int state);
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.professionalqualification.ProfessionalQualificationMapper">
|
||||
<select id="selectByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.professionalqualification.ProfessionalQualificationVo">
|
||||
SELECT (select dictValue from jlzx_system.dict_common where dictKey=pro.subject and dictType='zymc')subject,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=pro.professionalSeries and dictType='zyjsxl')professionalSeries,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=pro.name and dictType='zyjszgmc') name,
|
||||
pro.`approlNo`,
|
||||
pro.`confermentDate`,
|
||||
pro.`issueOrg`,
|
||||
pro.`certNo`,
|
||||
pro.staffSid,
|
||||
pro.sid,pro.state,
|
||||
pro.certUrl,
|
||||
pro.psOrg,
|
||||
pro.spOrg
|
||||
FROM professional_qualification pro
|
||||
WHERE pro.staffSid = #{staffSid} ORDER BY confermentDate
|
||||
</select>
|
||||
<update id="updateState">
|
||||
UPDATE professional_qualification
|
||||
SET state =#{state}
|
||||
WHERE sid = #{sid}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="updateBystaffSid">
|
||||
UPDATE professional_qualification
|
||||
SET state =#{state}
|
||||
WHERE staffSid = #{staffInfoSid}
|
||||
</update>
|
||||
|
||||
<select id="selectStateByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id) from professional_qualification where state=1 and staffSid = #{staffSid}
|
||||
</select>
|
||||
<select id="selectCountByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id) from professional_qualification where staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
<select id="listByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.professionalqualification.ProfessionalQualification">
|
||||
SELECT *
|
||||
FROM professional_qualification
|
||||
WHERE staffSid = #{staffSid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,53 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.professionalqualification;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalachievement.ProfessionalAchievement;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalqualification.ProfessionalQualification;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalqualification.ProfessionalQualificationVo;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/1 9:21
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class ProfessionalQualificationService extends MybatisBaseService<ProfessionalQualificationMapper, ProfessionalQualification> {
|
||||
/**
|
||||
* 通过人员sid查询该人员的教育经历
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return list
|
||||
*/
|
||||
public List<ProfessionalQualificationVo> selectByStaffSid(String staffSid,String path) {
|
||||
return baseMapper.selectByStaffSid(staffSid,path);
|
||||
}
|
||||
|
||||
public int updateState(Integer state, String sid) {
|
||||
return baseMapper.updateState(state, sid);
|
||||
}
|
||||
|
||||
public int selectStateByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectStateByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public int selectCountByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectCountByStaffSid(staffSid);
|
||||
}
|
||||
public List<ProfessionalQualification> listByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.listByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
|
||||
public void updateState(String staffInfoSid, int state) {
|
||||
// TODO Auto-generated method stub
|
||||
baseMapper.updateBystaffSid(staffInfoSid,state);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.professionalwork;
|
||||
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalachievement.ProfessionalAchievement;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalwork.ProfessionalWork;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalwork.ProfessionalWorkApi;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalwork.ProfessionalWorkDto;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalwork.ProfessionalWorkVo;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditional;
|
||||
import com.yxt.jlzx.jlcyry.biz.professionalachievement.ProfessionalAchievementService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffadditional.StaffAdditionalService;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonDto;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonOneVo;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonQuery;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonVo;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 9:00
|
||||
* @description 专业技术工作经历
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("professionalWork")
|
||||
@Api(tags = "专业技术工作经历")
|
||||
public class ProfessionalWorkApiImpl implements ProfessionalWorkApi {
|
||||
|
||||
@Autowired
|
||||
private ProfessionalWorkService professionalWorkService;
|
||||
@Autowired
|
||||
private DictCommonApi dictCommonApi;
|
||||
@Autowired
|
||||
private StaffAdditionalService staffAdditionalService;
|
||||
@Autowired
|
||||
private PhotoCommonApi photoCommonApi;
|
||||
@Autowired
|
||||
private ProfessionalAchievementService professionalAchievementService;
|
||||
/**
|
||||
* 专业技术工作经历及业绩保存
|
||||
*
|
||||
* @param professionalWorkDto 专业技术工作经历to对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public ResultBean save(@Valid ProfessionalWorkDto professionalWorkDto) {
|
||||
ProfessionalWork professionalWork = professionalWorkDto.toEntity();
|
||||
|
||||
boolean isSave = professionalWorkService.save(professionalWork);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
|
||||
boolean isSave1 = false;
|
||||
ProfessionalAchievement professionalAchievement=new ProfessionalAchievement();
|
||||
if("wcqk2".equals(professionalWorkDto.getCompletionStatus())) {
|
||||
professionalAchievement.setProfessionalworkSid(professionalWork.getSid());
|
||||
professionalAchievement.setStaffSid(professionalWork.getStaffSid());
|
||||
isSave1= professionalAchievementService.save(professionalAchievement);
|
||||
}
|
||||
if (isSave1) {
|
||||
int count=professionalAchievementService.selectCountByStaffSid(professionalAchievement.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(professionalAchievement.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setProfessionalAchievementNum(count);
|
||||
staffAdditional.setProfessionalAchievementState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional=new StaffAdditional();
|
||||
staffAdditional.setProfessionalAchievementNum(count);
|
||||
staffAdditional.setProfessionalAchievementState(1);
|
||||
staffAdditional.setStaffSid(professionalAchievement.getStaffSid());
|
||||
staffAdditionalService.save(staffAdditional);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* List<PhotoCommonOneVo> list=professionalWorkDto.getCertUrlList();
|
||||
* PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
* if(list!=null&&list.size()>0) { for (int i = 0; i < list.size(); i++) {
|
||||
* photoCommon.setFilePath(list.get(i).getFilePath());
|
||||
* photoCommon.setType("professionalWorkPhoto");
|
||||
* photoCommon.setLinkSid(professionalWork.getSid());
|
||||
* photoCommonApi.save(photoCommon); } }
|
||||
*/
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(professionalWork.getStaffSid());
|
||||
int count=professionalWorkService.selectCountByStaffSid(professionalWork.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setProfessionalWorkNum(count);
|
||||
staffAdditional.setProfessionalWorkState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional=new StaffAdditional();
|
||||
staffAdditional.setProfessionalWorkNum(count);
|
||||
staffAdditional.setProfessionalWorkState(1);
|
||||
staffAdditional.setStaffSid(professionalWork.getStaffSid());
|
||||
staffAdditionalService.save(staffAdditional);
|
||||
}
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 专业技术工作经历及业绩修改(@PathVariable是spring3.0的一个新功能:接收请求路径中占位符的值.
|
||||
* 通过 @PathVariable 可以将URL中占位符参数{xxx}绑定到处理器类的方法形参中@PathVariable(“xxx“) )
|
||||
*
|
||||
* @param professionalWorkDto 专业技术工作经历及业绩dto对象
|
||||
* @param sid 专业技术工作经历及业绩sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean update(@Valid ProfessionalWorkDto professionalWorkDto, String sid) {
|
||||
//根据sid查询专业技术工作经历及业绩是否存在
|
||||
ProfessionalWork professionalWork = professionalWorkService.fetchBySid(sid);
|
||||
if (professionalWork == null) {
|
||||
return ResultBean.fireFail().setMsg("该专业技术工作经历不存在");
|
||||
}
|
||||
professionalWork.setState(1);
|
||||
int i = professionalWorkService.updateBySid(professionalWorkDto.toMap(professionalWork), sid);
|
||||
if (i <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
|
||||
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(professionalWork.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setProfessionalWorkState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
/*
|
||||
* PhotoCommonQuery q1=new PhotoCommonQuery(); q1.setLinkSid(sid);
|
||||
* q1.setType("professionalWorkPhoto");
|
||||
* photoCommonApi.deleteBylinkSidAndType(q1); List<PhotoCommonOneVo>
|
||||
* list=professionalWorkDto.getCertUrlList(); PhotoCommonDto photoCommon=new
|
||||
* PhotoCommonDto(); if(list!=null&&list.size()>0) { for (int j = 0; j<
|
||||
* list.size(); j++) { photoCommon.setFilePath(list.get(j).getFilePath());
|
||||
* photoCommon.setType("professionalWorkPhoto"); photoCommon.setLinkSid(sid);
|
||||
* photoCommonApi.save(photoCommon); } }
|
||||
*/
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 专业技术工作经历及业绩删除
|
||||
*
|
||||
* @param sid 专业技术工作经历及业绩sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public ResultBean delete(String sid) {
|
||||
//根据sid查询专业技术工作经历及业绩是否存在
|
||||
ProfessionalWork professionalWork = professionalWorkService.fetchBySid(sid);
|
||||
if (professionalWork == null) {
|
||||
return ResultBean.fireFail().setMsg("该专业技术工作经历不存在");
|
||||
}
|
||||
int i = professionalWorkService.deleteBySid(sid);
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
|
||||
int count=professionalWorkService.selectCountByStaffSid(professionalWork.getStaffSid());
|
||||
int num=professionalWorkService.selectStateByStaffSid(professionalWork.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(professionalWork.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setProfessionalWorkNum(count);
|
||||
if(num==0) {
|
||||
staffAdditional.setProfessionalWorkState(2);//已审核
|
||||
}else {
|
||||
staffAdditional.setProfessionalWorkState(1);//未审核
|
||||
}
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
/*
|
||||
* PhotoCommonQuery q1=new PhotoCommonQuery(); q1.setLinkSid(sid);
|
||||
* q1.setType("professionalWorkPhoto");
|
||||
* photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
*/
|
||||
//同时删除工作技术业绩表数据
|
||||
ProfessionalAchievement professionalAchievement=professionalAchievementService.selectByprofessionalworkSid(sid);
|
||||
int a=professionalAchievementService.deleteByprofessionalworkSid(sid);
|
||||
if (a>0) {
|
||||
int count1=professionalAchievementService.selectCountByStaffSid(professionalAchievement.getStaffSid());
|
||||
int num1=professionalAchievementService.selectStateByStaffSid(professionalAchievement.getStaffSid());
|
||||
StaffAdditional staffAdditional1=staffAdditionalService.selectByStaffSid(professionalAchievement.getStaffSid());
|
||||
if(staffAdditional1!=null) {
|
||||
staffAdditional1.setProfessionalAchievementNum(count1);
|
||||
if(num1==0) {
|
||||
staffAdditional1.setProfessionalAchievementState(2);//已审核
|
||||
}else {
|
||||
staffAdditional1.setProfessionalAchievementState(1);//未审核
|
||||
}
|
||||
staffAdditionalService.updateById(staffAdditional1);
|
||||
}
|
||||
|
||||
// q1.setLinkSid(professionalAchievement.getSid());
|
||||
// q1.setType("professionalAchievementPhoto");
|
||||
// photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
// return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<ProfessionalWorkVo>> selectByStaffSid(String staffSid) {
|
||||
List<ProfessionalWorkVo> page = professionalWorkService.selectByStaffSid(staffSid);
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean infoUpdate(Integer state, String sid) {
|
||||
ProfessionalWork professionalWork=professionalWorkService.fetchBySid(sid);
|
||||
if (state!=null) {
|
||||
//通过
|
||||
int i = professionalWorkService.updateState(state, sid);
|
||||
|
||||
if(professionalWork!=null) {
|
||||
int num=professionalWorkService.selectStateByStaffSid(professionalWork.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(professionalWork.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
if(num==0) {
|
||||
staffAdditional.setProfessionalWorkState(2);//已审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional.setProfessionalWorkState(1);//未审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
}else {
|
||||
if(state==2) {
|
||||
return ResultBean.fireSuccess().setMsg("审核通过");
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("人审核未通过");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("专业技术工作经历信息审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<ProfessionalWorkVo> getVo(String sid) {
|
||||
ResultBean<ProfessionalWorkVo> resultBean=ResultBean.fireFail();
|
||||
ProfessionalWork professionalWork=professionalWorkService.fetchBySid(sid);
|
||||
ProfessionalWorkVo vo=new ProfessionalWorkVo();
|
||||
vo.fromEntity(professionalWork);
|
||||
// PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
// q1.setLinkSid(sid);
|
||||
// q1.setType("professionalWorkPhoto");
|
||||
// List<PhotoCommonVo> list=photoCommonApi.queryBylinkSidAndType(q1).getData();
|
||||
// vo.setCertUrlList(list);
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<Map<String, Object>> dictSelect() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
ResultBean<Map<String, Object>> dictCommonInitVoResultBean = dictCommonApi.dictCommonProfessionalwork();
|
||||
map.put("dictCommonList", dictCommonInitVoResultBean.getData());
|
||||
return new ResultBean().success().setData(map);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.professionalwork;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalwork.ProfessionalWork;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalwork.ProfessionalWorkVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 9:02
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProfessionalWorkMapper extends BaseMapper<ProfessionalWork> {
|
||||
public List<ProfessionalWorkVo> selectByStaffSid(String staffSid);
|
||||
|
||||
int updateState(@Param("state") Integer state, @Param("sid") String sid);
|
||||
|
||||
public int selectStateByStaffSid(String staffSid);
|
||||
public int selectCountByStaffSid(String staffSid);
|
||||
|
||||
public List<ProfessionalWork> listByStaffSid(String staffSid);
|
||||
|
||||
public void updateBystaffSid(@Param("staffInfoSid") String staffInfoSid, @Param("state") int state);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.professionalwork.ProfessionalWorkMapper">
|
||||
|
||||
<select id="selectByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.professionalwork.ProfessionalWorkVo">
|
||||
select pro.`dateStart`,
|
||||
pro.`dateEnd`, pro.`name`,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=pro.`workLevel` and dictType='xmjb') workLevel,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=pro.`workTitle` and dictType='gzxm') workTitle,
|
||||
pro.`workContent`,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=pro.`completionStatus` and dictType='wcqk')completionStatus,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=pro.`partakeType` and dictType='cyqk') partakeType,
|
||||
pro.staffSid,
|
||||
pro.sid,pro.state,pro.mc,(select count(*) from professional_achievement where professionalWorkSid=pro.sid)cgNum
|
||||
from professionalwork pro
|
||||
where pro.staffSid = #{staffSid} ORDER BY dateStart
|
||||
</select>
|
||||
<update id="updateState">
|
||||
UPDATE professionalwork
|
||||
SET state =#{state}
|
||||
WHERE sid = #{sid}
|
||||
</update>
|
||||
|
||||
<update id="updateBystaffSid">
|
||||
UPDATE professionalwork
|
||||
SET state =#{state}
|
||||
WHERE staffSid = #{staffInfoSid}
|
||||
</update>
|
||||
|
||||
<select id="selectStateByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id) from professionalwork where state=1 and staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
<select id="selectCountByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id) from professionalwork where staffSid = #{staffSid}
|
||||
</select>
|
||||
<select id="listByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.professionalwork.ProfessionalWork">
|
||||
SELECT *
|
||||
FROM professionalwork
|
||||
WHERE staffSid = #{staffSid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.professionalwork;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalqualification.ProfessionalQualification;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalwork.ProfessionalWork;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalwork.ProfessionalWorkVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 9:02
|
||||
* @description 专业技术工作经历及业绩
|
||||
*/
|
||||
@Service
|
||||
public class ProfessionalWorkService extends MybatisBaseService<ProfessionalWorkMapper, ProfessionalWork> {
|
||||
|
||||
public List<ProfessionalWorkVo> selectByStaffSid(String staffSid) {
|
||||
return baseMapper.selectByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public int updateState(Integer state, String sid) {
|
||||
return baseMapper.updateState(state, sid);
|
||||
}
|
||||
|
||||
public int selectStateByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectStateByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public int selectCountByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectCountByStaffSid(staffSid);
|
||||
}
|
||||
public List<ProfessionalWork> listByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.listByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
|
||||
public void updateState(String staffInfoSid, int state) {
|
||||
// TODO Auto-generated method stub
|
||||
baseMapper.updateBystaffSid(staffInfoSid,state);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.rewardinfo;
|
||||
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.jlzx.jlcyry.api.rewardinfo.RewardInfo;
|
||||
import com.yxt.jlzx.jlcyry.api.rewardinfo.RewardInfoApi;
|
||||
import com.yxt.jlzx.jlcyry.api.rewardinfo.RewardInfoDto;
|
||||
import com.yxt.jlzx.jlcyry.api.rewardinfo.RewardInfoVo;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditional;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffadditional.StaffAdditionalService;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonDto;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonQuery;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/1 10:50
|
||||
* @description 培训经历
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/rewardInfo")
|
||||
@Api(tags = "奖励情况")
|
||||
public class RewardInfoApiImpl implements RewardInfoApi {
|
||||
|
||||
@Autowired
|
||||
private RewardInfoService rewardInfoService;
|
||||
@Autowired
|
||||
private PhotoCommonApi photoCommonApi;
|
||||
@Autowired
|
||||
private DictCommonApi dictCommonApi;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
private StaffAdditionalService staffAdditionalService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<RewardInfo>> pagerList(PagerQuery pagerQuery) {
|
||||
ResultBean<PagerVo<RewardInfo>> rb = ResultBean.fireFail();
|
||||
PagerVo<RewardInfo> page = rewardInfoService.page(pagerQuery);
|
||||
return rb.success().setData(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 培训经历保存
|
||||
*
|
||||
* @param RewardInfoDto 培训经历Dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(@Valid RewardInfoDto rewardInfoDto) {
|
||||
RewardInfo rewardInfo = rewardInfoDto.toEntity();
|
||||
if(StringUtils.isNoneBlank(rewardInfoDto.getCertUrl())) {
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
photoCommon.setFilePath(rewardInfoDto.getCertUrl());
|
||||
photoCommon.setType("rewardInfoPhoto");
|
||||
photoCommon.setLinkSid(rewardInfo.getSid());
|
||||
ResultBean resultBean=photoCommonApi.save(photoCommon);
|
||||
}
|
||||
boolean isSave = rewardInfoService.save(rewardInfo);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(rewardInfo.getStaffSid());
|
||||
int count=rewardInfoService.selectCountByStaffSid(rewardInfo.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setRewardInfoNum(count);
|
||||
staffAdditional.setRewardInfoState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional=new StaffAdditional();
|
||||
staffAdditional.setRewardInfoNum(count);
|
||||
staffAdditional.setRewardInfoState(1);
|
||||
staffAdditional.setStaffSid(rewardInfo.getStaffSid());
|
||||
staffAdditionalService.save(staffAdditional);
|
||||
}
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 培训经历修改(@PathVariable是spring3.0的一个新功能:接收请求路径中占位符的值.
|
||||
* 通过 @PathVariable 可以将URL中占位符参数{xxx}绑定到处理器类的方法形参中@PathVariable(“xxx“) )
|
||||
*
|
||||
* @param RewardInfoDto 培训经历Dto对象
|
||||
* @param sid 培训经历sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean update(@Valid RewardInfoDto rewardInfoDto, String sid) {
|
||||
//根据sid查询培训经历是否存在
|
||||
RewardInfo rewardInfo = rewardInfoService.fetchBySid(sid);
|
||||
if (rewardInfo == null) {
|
||||
return ResultBean.fireFail().setMsg("该奖励情况不存在");
|
||||
}
|
||||
rewardInfo.setState(1);//修改后状态改为未审核
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
if(rewardInfoDto.getCertUrl().indexOf(path)>-1) {
|
||||
rewardInfoDto.setCertUrl(rewardInfoDto.getCertUrl().replace(path, ""));
|
||||
}
|
||||
int i = rewardInfoService.updateBySid(rewardInfoDto.toMap(rewardInfo), sid);
|
||||
if (i <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
|
||||
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(rewardInfo.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setRewardInfoState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("rewardInfoPhoto");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
photoCommon.setFilePath(rewardInfo.getCertUrl());
|
||||
photoCommon.setType("rewardInfoPhoto");
|
||||
photoCommon.setLinkSid(sid);
|
||||
photoCommonApi.save(photoCommon);
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除培训经历
|
||||
*
|
||||
* @param sid 培训经历sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid) {
|
||||
//根据sid查询培训经历是否存在
|
||||
RewardInfo rewardInfo = rewardInfoService.fetchBySid(sid);
|
||||
if (rewardInfo == null) {
|
||||
return ResultBean.fireFail().setMsg("该奖励情况不存在");
|
||||
}
|
||||
int i = rewardInfoService.deleteBySid(sid);
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
|
||||
int count=rewardInfoService.selectCountByStaffSid(rewardInfo.getStaffSid());
|
||||
int num=rewardInfoService.selectStateByStaffSid(rewardInfo.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(rewardInfo.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setRewardInfoNum(count);
|
||||
if(num==0) {
|
||||
staffAdditional.setRewardInfoState(2);//已审核
|
||||
}else {
|
||||
staffAdditional.setRewardInfoState(1);//未审核
|
||||
}
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("rewardInfoPhoto");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过人员sid查询培训经历
|
||||
*
|
||||
* @param staffSid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<List<RewardInfoVo>> selectByStaffSid(String staffSid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
List<RewardInfoVo> page = rewardInfoService.selectByStaffSid(staffSid,path);
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean infoUpdate(Integer state, String sid){
|
||||
RewardInfo rewardInfo=rewardInfoService.fetchBySid(sid);
|
||||
if (state!=null) {
|
||||
//通过
|
||||
int i = rewardInfoService.updateState(state, sid);
|
||||
|
||||
if(rewardInfo!=null) {
|
||||
int num=rewardInfoService.selectStateByStaffSid(rewardInfo.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(rewardInfo.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
if(num==0) {
|
||||
staffAdditional.setRewardInfoState(2);//已审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional.setRewardInfoState(1);//未审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
}else {
|
||||
if(state==2) {
|
||||
return ResultBean.fireSuccess().setMsg("审核通过");
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("人审核未通过");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("奖励情况信息审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<RewardInfoVo> getVo(String sid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
ResultBean<RewardInfoVo> resultBean=ResultBean.fireFail();
|
||||
RewardInfo rewardInfo=rewardInfoService.fetchBySid(sid);
|
||||
RewardInfoVo vo=new RewardInfoVo();
|
||||
vo.fromEntity(rewardInfo);
|
||||
vo.setCertUrl(path+vo.getCertUrl());
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<Map<String, Object>> dictSelect() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
ResultBean<Map<String, Object>> dictCommonInitVoResultBean = dictCommonApi.dictCommonRewardInfo();
|
||||
map.put("dictCommonList", dictCommonInitVoResultBean.getData());
|
||||
return new ResultBean().success().setData(map);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.rewardinfo;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.rewardinfo.RewardInfo;
|
||||
import com.yxt.jlzx.jlcyry.api.rewardinfo.RewardInfoVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/1 10:51
|
||||
* @description 培训经历
|
||||
*/
|
||||
@Mapper
|
||||
public interface RewardInfoMapper extends BaseMapper<RewardInfo> {
|
||||
|
||||
List<RewardInfoVo> selectByStaffSid(@Param("staffSid") String staffSid,@Param("path") String path);
|
||||
|
||||
int updateState(@Param("state") Integer state, @Param("sid") String sid);
|
||||
|
||||
public int selectStateByStaffSid(String staffSid);
|
||||
public int selectCountByStaffSid(String staffSid);
|
||||
|
||||
List<RewardInfo> listByStaffSid(String staffSid);
|
||||
|
||||
public void updateBystaffSid(@Param("staffInfoSid") String staffInfoSid, @Param("state") int state);
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.rewardinfo.RewardInfoMapper">
|
||||
|
||||
<select id="selectByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.rewardinfo.RewardInfoVo">
|
||||
select
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=t1.name and dictType='jlqk1') name,
|
||||
t1.`issueOrg`,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=t1.syjb and dictType='syjb') syjb,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=t1.sort and dictType='jlpm') sort,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=t1.level and dictType='jldc') level,
|
||||
t1.`issueDate`,
|
||||
t1.`certNo`,
|
||||
t1.`staffSid`, t1.sid ,t1.state ,
|
||||
concat(#{path},t1.certUrl) as certUrl
|
||||
from reward_info t1
|
||||
where t1.staffSid = #{staffSid} ORDER BY issueDate DESC
|
||||
|
||||
</select>
|
||||
<select id="listByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.rewardinfo.RewardInfo">
|
||||
SELECT *
|
||||
FROM reward_info
|
||||
WHERE staffSid = #{staffSid}
|
||||
</select>
|
||||
<update id="updateState">
|
||||
UPDATE reward_info
|
||||
SET state =#{state}
|
||||
WHERE sid = #{sid}
|
||||
</update>
|
||||
|
||||
<update id="updateBystaffSid">
|
||||
UPDATE reward_info
|
||||
SET state =#{state}
|
||||
WHERE staffSid = #{staffInfoSid}
|
||||
</update>
|
||||
|
||||
<select id="selectStateByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id) from reward_info where state=1 and staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
<select id="selectCountByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id) from reward_info where staffSid = #{staffSid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.rewardinfo;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.professionalwork.ProfessionalWork;
|
||||
import com.yxt.jlzx.jlcyry.api.rewardinfo.RewardInfo;
|
||||
import com.yxt.jlzx.jlcyry.api.rewardinfo.RewardInfoVo;
|
||||
import com.yxt.jlzx.jlcyry.api.train.Train;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/1 10:53
|
||||
* @description 培训经历
|
||||
*/
|
||||
@Service
|
||||
public class RewardInfoService extends MybatisBaseService<RewardInfoMapper, RewardInfo> {
|
||||
|
||||
public List<RewardInfoVo> selectByStaffSid(String staffSid,String path) {
|
||||
return baseMapper.selectByStaffSid(staffSid,path);
|
||||
}
|
||||
|
||||
public int updateState(Integer state, String sid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.updateState(state, sid);
|
||||
}
|
||||
|
||||
public int selectStateByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectStateByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public int selectCountByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectCountByStaffSid(staffSid);
|
||||
}
|
||||
public List<RewardInfo> listByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.listByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public void updateState(String staffInfoSid, int state) {
|
||||
// TODO Auto-generated method stub
|
||||
baseMapper.updateBystaffSid(staffInfoSid,state);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,251 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.science;
|
||||
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.jlzx.jlcyry.api.science.Science;
|
||||
import com.yxt.jlzx.jlcyry.api.science.ScienceApi;
|
||||
import com.yxt.jlzx.jlcyry.api.science.ScienceDto;
|
||||
import com.yxt.jlzx.jlcyry.api.science.ScienceVo;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditional;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffadditional.StaffAdditionalService;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonDto;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonOneVo;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonQuery;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonVo;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/28 14:46
|
||||
* @description 学术情况
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/science")
|
||||
@Api(tags = "著作、论文及重要技术报告")
|
||||
public class ScienceApiImpl implements ScienceApi {
|
||||
|
||||
@Autowired
|
||||
private ScienceService scienceService;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
|
||||
@Autowired
|
||||
private DictCommonApi dictCommonApi;
|
||||
|
||||
@Autowired
|
||||
private PhotoCommonApi photoCommonApi;
|
||||
@Autowired
|
||||
private StaffAdditionalService staffAdditionalService;
|
||||
|
||||
|
||||
/**
|
||||
* 学术情况保存
|
||||
*
|
||||
* @param scienceDto 学术情况dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(@Valid ScienceDto scienceDto) {
|
||||
Science science = scienceDto.toEntity();
|
||||
// if(StringUtils.isNoneBlank(scienceDto.getFilePath())) {
|
||||
// PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
// photoCommon.setFilePath(scienceDto.getFilePath());
|
||||
// photoCommon.setType("scienceFile");
|
||||
// photoCommon.setLinkSid(science.getSid());
|
||||
// photoCommonApi.save(photoCommon);
|
||||
// }
|
||||
boolean isSave = scienceService.save(science);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(science.getStaffSid());
|
||||
int count=scienceService.selectCountByStaffSid(science.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setScienceNum(staffAdditional.getScienceNum()+1);
|
||||
staffAdditional.setScienceState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional=new StaffAdditional();
|
||||
staffAdditional.setScienceNum(staffAdditional.getScienceNum()+1);
|
||||
staffAdditional.setScienceState(1);
|
||||
staffAdditional.setStaffSid(science.getStaffSid());
|
||||
staffAdditionalService.save(staffAdditional);
|
||||
}
|
||||
|
||||
List<PhotoCommonOneVo> list=scienceDto.getPhotoUrlList();
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
if(list!=null&&list.size()>0) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
photoCommon.setFilePath(list.get(i).getFilePath());
|
||||
photoCommon.setType("scienceFile");
|
||||
photoCommon.setLinkSid(science.getSid());
|
||||
photoCommonApi.save(photoCommon);
|
||||
}
|
||||
}
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 学术情况修改(@PathVariable是spring3.0的一个新功能:接收请求路径中占位符的值.
|
||||
* 通过 @PathVariable 可以将URL中占位符参数{xxx}绑定到处理器类的方法形参中@PathVariable(“xxx“) )
|
||||
*
|
||||
* @param scienceDto 学术情况dto对象
|
||||
* @param sid 学术情况sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean update(@Valid ScienceDto scienceDto, String sid) {
|
||||
//根据sid查询学术情况是否存在
|
||||
Science science = scienceService.fetchBySid(sid);
|
||||
if (science == null) {
|
||||
return ResultBean.fireFail().setMsg("该学术情况不存在");
|
||||
}
|
||||
science.setState(1);
|
||||
int i = scienceService.updateBySid(scienceDto.toMap(science), sid);
|
||||
if (i <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(science.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setScienceState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("scienceFile");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
List<PhotoCommonOneVo> list=scienceDto.getPhotoUrlList();
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
if(list!=null&&list.size()>0) {
|
||||
for (int j = 0; j< list.size(); j++) {
|
||||
photoCommon.setFilePath(list.get(j).getFilePath());
|
||||
photoCommon.setType("scienceFile");
|
||||
photoCommon.setLinkSid(sid);
|
||||
photoCommonApi.save(photoCommon);
|
||||
}
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 学术情况删除
|
||||
*
|
||||
* @param sid 学术情况sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid) {
|
||||
//根据sid查询学术情况是否存在
|
||||
Science science = scienceService.fetchBySid(sid);
|
||||
if (science == null) {
|
||||
return ResultBean.fireFail().setMsg("该学术不存在");
|
||||
}
|
||||
int i = scienceService.deleteBySid(sid);
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
|
||||
int count=scienceService.selectCountByStaffSid(science.getStaffSid());
|
||||
int num=scienceService.selectStateByStaffSid(science.getStaffSid());//未审核个数
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(science.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setScienceNum(count);
|
||||
if(num==0) {
|
||||
staffAdditional.setScienceState(2);//已审核
|
||||
}else {
|
||||
staffAdditional.setScienceState(1);//未审核
|
||||
}
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("scienceFile");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean infoUpdate(Integer state, String sid){
|
||||
Science science = scienceService.fetchBySid(sid);
|
||||
if (state!=null) {
|
||||
//通过
|
||||
int i = scienceService.updateState(state, sid);
|
||||
|
||||
if(science!=null) {
|
||||
int num=scienceService.selectStateByStaffSid(science.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(science.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
if(num==0) {
|
||||
staffAdditional.setScienceState(2);//已审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional.setScienceState(1);//未审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
}else {
|
||||
if(state==2) {
|
||||
return ResultBean.fireSuccess().setMsg("审核通过");
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("人审核未通过");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("著作、论文及重要技术报告信息审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<ScienceVo> getVo(String sid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
ResultBean<ScienceVo> resultBean=ResultBean.fireFail();
|
||||
Science science=scienceService.fetchBySid(sid);
|
||||
ScienceVo vo=new ScienceVo();
|
||||
vo.fromEntity(science);
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("scienceFile");
|
||||
List<PhotoCommonVo> list=photoCommonApi.queryBylinkSidAndType(q1).getData();
|
||||
vo.setPhotoUrlList(list);
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<ScienceVo>> selectByStaffSid(String staffSid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
List<ScienceVo> page = scienceService.selectByStaffSid(staffSid,path);
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
@Override
|
||||
public ResultBean<Map<String, Object>> dictSelect() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
ResultBean<Map<String, Object>> dictCommonInitVoResultBean = dictCommonApi.dictCommonScience();
|
||||
map.put("dictCommonList", dictCommonInitVoResultBean.getData());
|
||||
return new ResultBean().success().setData(map);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.science;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.science.Science;
|
||||
import com.yxt.jlzx.jlcyry.api.science.ScienceVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/28 14:52
|
||||
* @description 学术情况
|
||||
*/
|
||||
@Mapper
|
||||
public interface ScienceMapper extends BaseMapper<Science> {
|
||||
|
||||
int updateState(@Param("state") Integer state, @Param("sid") String sid);
|
||||
|
||||
public List<ScienceVo> selectByStaffSid(@Param("staffSid") String staffSid,@Param("path") String path);
|
||||
|
||||
int selectStateByStaffSid(String staffSid);
|
||||
public int selectCountByStaffSid(String staffSid);
|
||||
|
||||
List<Science> listByStaffSid(String staffSid);
|
||||
|
||||
public void updateBystaffSid(@Param("staffInfoSid") String staffInfoSid, @Param("state") int state);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.science.ScienceMapper">
|
||||
|
||||
<select id="selectByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.science.ScienceVo">
|
||||
select
|
||||
pubDate,
|
||||
title,
|
||||
achievement,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=partakeType and dictType='zyfs') partakeType,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=type and dictType='zylb1') type,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=level and dictType='zyjb') level,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey=sort and dictType='zypm') sort,
|
||||
bookNum,
|
||||
wordNum,
|
||||
webAddr,
|
||||
staffSid,
|
||||
sid ,
|
||||
remarks,
|
||||
state
|
||||
from science
|
||||
where staffSid = #{staffSid} ORDER BY pubDate DESC
|
||||
</select>
|
||||
<update id="updateState">
|
||||
UPDATE science
|
||||
SET state =#{state}
|
||||
WHERE sid = #{sid}
|
||||
</update>
|
||||
|
||||
<update id="updateBystaffSid">
|
||||
UPDATE science
|
||||
SET state =#{state}
|
||||
WHERE staffSid = #{staffInfoSid}
|
||||
</update>
|
||||
|
||||
<select id="selectStateByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id) from science where state=1 and staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCountByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id) from science where staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="listByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.science.Science">
|
||||
SELECT *
|
||||
FROM science
|
||||
WHERE staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.science;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.rewardinfo.RewardInfo;
|
||||
import com.yxt.jlzx.jlcyry.api.science.Science;
|
||||
import com.yxt.jlzx.jlcyry.api.science.ScienceVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/28 14:54
|
||||
* @description 学术情况
|
||||
*/
|
||||
@Service
|
||||
public class ScienceService extends MybatisBaseService<ScienceMapper, Science> {
|
||||
|
||||
public List<ScienceVo> selectByStaffSid(String staffSid,String path) {
|
||||
return baseMapper.selectByStaffSid(staffSid,path);
|
||||
}
|
||||
public int updateState(Integer state, String sid) {
|
||||
return baseMapper.updateState(state, sid);
|
||||
}
|
||||
public int selectStateByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectStateByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public int selectCountByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectCountByStaffSid(staffSid);
|
||||
}
|
||||
public List<Science> listByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.listByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public void updateState(String staffInfoSid, int state) {
|
||||
// TODO Auto-generated method stub
|
||||
baseMapper.updateBystaffSid(staffInfoSid,state);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.staffadditional;
|
||||
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditional;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditionalApi;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditionalDto;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditionalVo;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonDto;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/28 14:46
|
||||
* @description 学术情况
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/staffadditional")
|
||||
@Api(tags = "人员附加信息关联表")
|
||||
public class StaffAdditionalApiImpl implements StaffAdditionalApi {
|
||||
|
||||
@Autowired
|
||||
private StaffAdditionalService staffadditionalService;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<StaffAdditional>> pagerList(PagerQuery pagerQuery) {
|
||||
ResultBean<PagerVo<StaffAdditional>> rb = ResultBean.fireFail();
|
||||
PagerVo<StaffAdditional> page = staffadditionalService.page(pagerQuery);
|
||||
return rb.success().setData(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 学术情况保存
|
||||
*
|
||||
* @param staffadditionalDto 学术情况dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(@Valid StaffAdditionalDto staffadditionalDto) {
|
||||
StaffAdditional staffadditional = staffadditionalDto.toEntity();
|
||||
boolean isSave = staffadditionalService.save(staffadditional);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 学术情况修改(@PathVariable是spring3.0的一个新功能:接收请求路径中占位符的值.
|
||||
* 通过 @PathVariable 可以将URL中占位符参数{xxx}绑定到处理器类的方法形参中@PathVariable(“xxx“) )
|
||||
*
|
||||
* @param staffadditionalDto 学术情况dto对象
|
||||
* @param sid 学术情况sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean update(@Valid StaffAdditionalDto staffadditionalDto, String sid) {
|
||||
//根据sid查询学术情况是否存在
|
||||
StaffAdditional staffadditional = staffadditionalService.fetchBySid(sid);
|
||||
if (staffadditional == null) {
|
||||
return ResultBean.fireFail().setMsg("该学术情况不存在");
|
||||
}
|
||||
int i = staffadditionalService.updateBySid(staffadditionalDto.toMap(staffadditional), sid);
|
||||
if (i <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<StaffAdditionalVo> getVo(String sid) {
|
||||
ResultBean<StaffAdditionalVo> resultBean=ResultBean.fireFail();
|
||||
StaffAdditional staffadditional=staffadditionalService.fetchBySid(sid);
|
||||
StaffAdditionalVo vo=new StaffAdditionalVo();
|
||||
vo.fromEntity(staffadditional);
|
||||
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<StaffAdditional> selectByStaffSid(String staffSid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
StaffAdditional vo = staffadditionalService.selectByStaffSid(staffSid);
|
||||
return new ResultBean().success().setData(vo);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.staffadditional;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditional;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditionalVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/28 14:52
|
||||
* @description 学术情况
|
||||
*/
|
||||
@Mapper
|
||||
public interface StaffAdditionalMapper extends BaseMapper<StaffAdditional> {
|
||||
|
||||
int updateState(@Param("state") Integer state, @Param("sid") String sid);
|
||||
|
||||
public StaffAdditional selectByStaffSid(@Param("staffSid") String staffSid);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.staffadditional.StaffAdditionalMapper">
|
||||
|
||||
<select id="selectByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditional">
|
||||
select
|
||||
*
|
||||
from staff_additional
|
||||
where staffSid = #{staffSid}
|
||||
</select>
|
||||
<update id="updateState">
|
||||
UPDATE staff_additional
|
||||
SET state =#{state}
|
||||
WHERE sid = #{sid}
|
||||
</update>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.staffadditional;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditional;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditionalVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/28 14:54
|
||||
* @description 学术情况
|
||||
*/
|
||||
@Service
|
||||
public class StaffAdditionalService extends MybatisBaseService<StaffAdditionalMapper, StaffAdditional> {
|
||||
|
||||
public StaffAdditional selectByStaffSid(String staffSid) {
|
||||
return baseMapper.selectByStaffSid(staffSid);
|
||||
}
|
||||
public int updateState(Integer state, String sid) {
|
||||
return baseMapper.updateState(state, sid);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.staffappendwait;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.jlzx.jlcyry.api.clientalterrecord.ClientAlterRecordQuery;
|
||||
import com.yxt.jlzx.jlcyry.api.education.EducationVo;
|
||||
import com.yxt.jlzx.jlcyry.api.staffappendwait.StaffAppendWait;
|
||||
import com.yxt.jlzx.jlcyry.api.staffinfo.*;
|
||||
import com.yxt.jlzx.system.api.department.DepartmentQuery;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/27 8:59
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface StaffAppendWaitMapper extends BaseMapper<StaffAppendWait> {
|
||||
|
||||
public int selectByStaffSid(String staffSid);
|
||||
public void deleteByAppendSid(String appendSid);
|
||||
public List<StaffAppendWait> selectByStaffSidAndAppendSid(@Param("staffSid") String staffSid,@Param("appendSid") String appendSid);
|
||||
public void deleteByStaffSid(String staffSid);
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.staffappendwait.StaffAppendWaitMapper">
|
||||
<select id="selectByStaffSid" resultType="java.lang.Integer">
|
||||
select count(*) from staff_append_wait where staffSid= #{staffSid}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByAppendSid">
|
||||
delete from staff_append_wait where appendSid= #{appendSid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByStaffSid">
|
||||
delete from staff_append_wait where staffSid= #{staffSid}
|
||||
</delete>
|
||||
|
||||
<select id="selectByStaffSidAndAppendSid" resultType="com.yxt.jlzx.jlcyry.api.staffappendwait.StaffAppendWait">
|
||||
select * from staff_append_wait where staffSid= #{staffSid} and appendSid= #{appendSid}
|
||||
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,144 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.staffappendwait;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.yxt.jlzx.jlcyry.biz.tempworksummary.TempWorkSummaryService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.staffappendwait.StaffAppendWait;
|
||||
import com.yxt.jlzx.jlcyry.api.staffinfo.StaffInfo;
|
||||
import com.yxt.jlzx.jlcyry.api.temptechnicalreport.TempTechnicalreport;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffbackrecord.StaffBackRecordService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffinfo.StaffInfoService;
|
||||
import com.yxt.jlzx.jlcyry.biz.tempTechnicalreport.TempTechnicalreportService;
|
||||
import com.yxt.jlzx.jlcyry.biz.tempcertificate.TempCertificateService;
|
||||
import com.yxt.jlzx.jlcyry.biz.tempeducation.TempEducationService;
|
||||
import com.yxt.jlzx.jlcyry.biz.tempexpertpostinfo.TempExpertPostInfoService;
|
||||
import com.yxt.jlzx.jlcyry.biz.tempprofessionalachievement.TempProfessionalAchievementService;
|
||||
import com.yxt.jlzx.jlcyry.biz.tempprofessionalqualification.TempProfessionalQualificationService;
|
||||
import com.yxt.jlzx.jlcyry.biz.tempprofessionalwork.TempProfessionalWorkService;
|
||||
import com.yxt.jlzx.jlcyry.biz.temprewardinfo.TempRewardInfoService;
|
||||
import com.yxt.jlzx.jlcyry.biz.tempscience.TempScienceService;
|
||||
import com.yxt.jlzx.jlcyry.biz.tempstafforg.TempStaffOrgService;
|
||||
import com.yxt.jlzx.jlcyry.biz.temptrain.TempTrainService;
|
||||
import com.yxt.jlzx.jlcyry.biz.tempworkexperience.TempWorkExperienceService;
|
||||
import com.yxt.jlzx.jlcyry.biz.tempworkexperiencejl.TempWorkExperienceJlService;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/27 9:12
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class StaffAppendWaitService extends MybatisBaseService<StaffAppendWaitMapper, StaffAppendWait> {
|
||||
@Autowired
|
||||
private StaffBackRecordService staffBackRecordService;
|
||||
@Autowired
|
||||
private StaffInfoService staffInfoService;
|
||||
@Autowired
|
||||
private TempStaffOrgService tempStaffOrgService;
|
||||
@Autowired
|
||||
private TempEducationService tempEducationService;
|
||||
@Autowired
|
||||
private TempExpertPostInfoService tempExpertPostInfoService;
|
||||
@Autowired
|
||||
private TempProfessionalAchievementService tempProfessionalAchievementService;
|
||||
@Autowired
|
||||
private TempProfessionalQualificationService tempProfessionalQualificationService;
|
||||
@Autowired
|
||||
private TempProfessionalWorkService tempProfessionalWorkService;
|
||||
@Autowired
|
||||
private TempRewardInfoService tempRewardInfoService;
|
||||
@Autowired
|
||||
private TempScienceService tempScienceService;
|
||||
@Autowired
|
||||
private TempTrainService tempTrainService;
|
||||
@Autowired
|
||||
private TempWorkExperienceJlService tempWorkExperienceJlService;
|
||||
@Autowired
|
||||
private TempWorkExperienceService tempWorkExperienceService;
|
||||
|
||||
@Autowired
|
||||
private TempTechnicalreportService tempTechnicalreportService;
|
||||
|
||||
@Autowired
|
||||
private TempCertificateService tempCertificateService;
|
||||
@Autowired
|
||||
private TempWorkSummaryService tempWorkSummaryService;
|
||||
|
||||
|
||||
public int selectByStaffSid(String staffSid) {
|
||||
return baseMapper.selectByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
|
||||
public void deleteByAppendSid(String appendSid) {
|
||||
baseMapper.deleteByAppendSid(appendSid);
|
||||
}
|
||||
|
||||
public void deleteByStaffSid(String staffSid) {
|
||||
baseMapper.deleteByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public boolean save(String staffSid, String appendSid, String remarks) {
|
||||
StaffAppendWait entity = new StaffAppendWait();
|
||||
entity.setAppendSid(appendSid);
|
||||
entity.setStaffSid(staffSid);
|
||||
entity.setRemarks(remarks);
|
||||
return save(entity);
|
||||
}
|
||||
|
||||
public int tzOrBack(String staffSid, String appendSid) {
|
||||
deleteByAppendSid(appendSid);
|
||||
StaffInfo fetchBySid = staffInfoService.fetchBySid(staffSid);
|
||||
int num = selectByStaffSid(staffSid);//判断是否为最后一条
|
||||
if (num == 0) {
|
||||
fetchBySid.setShState(0);//人员信息审核完成
|
||||
int n = staffBackRecordService.selectByStaffSid(staffSid);//判断审核通过还是退回
|
||||
if (n > 0) {
|
||||
if (fetchBySid != null) {
|
||||
fetchBySid.setState(3);
|
||||
staffInfoService.updateById(fetchBySid);
|
||||
//staffInfoService.updateState(3,staffSid);
|
||||
}
|
||||
} else {
|
||||
if (fetchBySid != null) {
|
||||
fetchBySid.setState(2);
|
||||
staffInfoService.updateById(fetchBySid);
|
||||
//staffInfoService.updateState(2,staffSid);
|
||||
}
|
||||
|
||||
tempStaffOrgService.deleteByStaffSid(staffSid);
|
||||
tempCertificateService.deleteByStaffSid(staffSid);
|
||||
tempEducationService.deleteByStaffSid(staffSid);
|
||||
tempExpertPostInfoService.deleteByStaffSid(staffSid);
|
||||
tempProfessionalAchievementService.deleteByStaffSid(staffSid);
|
||||
tempProfessionalQualificationService.deleteByStaffSid(staffSid);
|
||||
tempProfessionalWorkService.deleteByStaffSid(staffSid);
|
||||
tempRewardInfoService.deleteByStaffSid(staffSid);
|
||||
tempScienceService.deleteByStaffSid(staffSid);
|
||||
tempTrainService.deleteByStaffSid(staffSid);
|
||||
tempWorkExperienceJlService.deleteByStaffSid(staffSid);
|
||||
tempTechnicalreportService.deleteByStaffSid(staffSid);
|
||||
tempWorkSummaryService.deleteByStaffSid(staffSid);
|
||||
//tempWorkExperienceService.deleteBySid(appendSid);
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
} else {
|
||||
fetchBySid.setShState(1);//人员信息审核中
|
||||
staffInfoService.updateById(fetchBySid);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public List<StaffAppendWait> selectByStaffSidAndAppendSid(String sid, String appendSid) {
|
||||
return baseMapper.selectByStaffSidAndAppendSid(sid, appendSid);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
/*
|
||||
package com.yxt.jlzx.jlcyry.biz.staffapply;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.jlzx.jlcyry.api.staffapply.StaffApplyApi;
|
||||
import com.yxt.jlzx.jlcyry.api.staffapply.StaffApplyDto;
|
||||
import com.yxt.jlzx.jlcyry.api.staffapply.StaffApply;
|
||||
import com.yxt.jlzx.system.api.user.User;
|
||||
import com.yxt.jlzx.system.api.user.UserApi;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
*/
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/19 16:04
|
||||
* @description
|
||||
*//*
|
||||
|
||||
@Controller
|
||||
@RequestMapping("/staffApply")
|
||||
public class StaffApplyApiImpl implements StaffApplyApi {
|
||||
|
||||
@Autowired
|
||||
private StaffApplyService staffApplyService;
|
||||
@Autowired
|
||||
private UserApi userApi;
|
||||
|
||||
*/
|
||||
/**
|
||||
* 待审核的注册人员信息保存
|
||||
*
|
||||
* @param staffApplyDto 注册人员待审核信息dto对象
|
||||
* @return ResultBean
|
||||
*//*
|
||||
|
||||
@Override
|
||||
public ResultBean save(@Valid StaffApplyDto staffApplyDto) {
|
||||
StaffApply staffApply = staffApplyDto.toEntity();
|
||||
boolean isSave = staffApplyService.save(staffApply);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
return ResultBean.fireSuccess().setData(staffApply.getSid());
|
||||
}
|
||||
|
||||
*/
|
||||
/**
|
||||
* 根据人员身份证号查询人员
|
||||
*
|
||||
* @param idCard
|
||||
* @return
|
||||
*//*
|
||||
|
||||
@Override
|
||||
public StaffApply selectByIdCard(String idCard) {
|
||||
StaffApply staffApply = staffApplyService.selectByIdCard(idCard);
|
||||
return staffApply;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StaffApply selectByUserName(String userName) {
|
||||
StaffApply staffApply = staffApplyService.selectByUserName(userName);
|
||||
return staffApply;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean deleteByUserName(String userName) {
|
||||
//根据sid查询人员是否存在
|
||||
StaffApply staffApply = staffApplyService.selectByUserName(userName);
|
||||
if (staffApply == null) {
|
||||
return ResultBean.fireFail().setMsg("注册人员不存在");
|
||||
}
|
||||
int i = staffApplyService.deleteByUserName(userName);
|
||||
User u=userApi.selectByUserNameOne(userName).getData();
|
||||
int y=0;
|
||||
if(u!=null&&u.getState()!=2) {
|
||||
y = userApi.deleteByUserName(userName);
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
}
|
||||
*/
|
||||
@@ -0,0 +1,24 @@
|
||||
/*
|
||||
package com.yxt.jlzx.jlcyry.biz.staffapply;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.staffapply.StaffApply;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
*/
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/21 11:44
|
||||
* @description
|
||||
*//*
|
||||
|
||||
@Mapper
|
||||
public interface StaffApplyMapper extends BaseMapper<StaffApply> {
|
||||
|
||||
public StaffApply selectByIdCard(String idCard);
|
||||
|
||||
public StaffApply selectUserName(String userName);
|
||||
|
||||
public int deleteByUserName(String userName);
|
||||
}
|
||||
*/
|
||||
@@ -0,0 +1,26 @@
|
||||
<!--
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.staffapply.StaffApplyMapper">
|
||||
|
||||
<select id="selectByIdCard" resultType="com.yxt.jlzx.jlcyry.api.staffapply.StaffApply">
|
||||
select *
|
||||
from staff_apply
|
||||
where userName = #{idCard}
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectUserName" resultType="com.yxt.jlzx.jlcyry.api.staffapply.StaffApply">
|
||||
select *
|
||||
from staff_apply
|
||||
where userName = #{userName}
|
||||
|
||||
</select>
|
||||
|
||||
<delete id="deleteByUserName">
|
||||
delete
|
||||
from staff_apply
|
||||
where userName = #{userName}
|
||||
</delete>
|
||||
|
||||
</mapper>-->
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
package com.yxt.jlzx.jlcyry.biz.staffapply;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.staffapply.StaffApply;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
*/
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/21 11:44
|
||||
* @description
|
||||
*//*
|
||||
|
||||
@Service
|
||||
public class StaffApplyService extends MybatisBaseService<StaffApplyMapper, StaffApply> {
|
||||
|
||||
public StaffApply selectByIdCard(String idCard){
|
||||
return baseMapper.selectByIdCard(idCard);
|
||||
}
|
||||
|
||||
public StaffApply selectByUserName(String userName){
|
||||
return baseMapper.selectUserName(userName);
|
||||
|
||||
}
|
||||
|
||||
public int deleteByUserName(String userName){
|
||||
return baseMapper.deleteByUserName(userName);
|
||||
|
||||
}
|
||||
}
|
||||
*/
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.staffbackrecord;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.yxt.common.base.config.RedisUtil;
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecord;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecordApi;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecordDto;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecordVo;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffinfo.StaffInfoService;
|
||||
import com.yxt.jlzx.jlcyry.biz.workexperience.WorkExperienceService;
|
||||
import com.yxt.jlzx.system.api.department.DepartmentApi;
|
||||
import com.yxt.jlzx.system.api.departmentstaff.DepartmentStaffApi;
|
||||
import com.yxt.jlzx.system.api.organization.OrganizationApi;
|
||||
import com.yxt.jlzx.system.api.user.UserApi;
|
||||
import com.yxt.jlzx.system.api.userrole.UserRoleApi;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 10:11
|
||||
* @description 人员机构关系
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/staffBackRecord")
|
||||
@Api(tags = "人员机构")
|
||||
public class StaffBackRecordApiImpl implements StaffBackRecordApi {
|
||||
|
||||
@Autowired
|
||||
private StaffBackRecordService staffBackRecordService;
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Autowired(required = false)
|
||||
private HttpServletRequest httpServletRequest;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
private DepartmentApi departmentApi;
|
||||
@Autowired
|
||||
private DepartmentStaffApi departmentStaffApi;
|
||||
@Autowired
|
||||
private UserApi userApi;
|
||||
@Autowired
|
||||
private StaffInfoService staffInfoService;
|
||||
@Autowired
|
||||
private OrganizationApi organizationApi;
|
||||
@Autowired
|
||||
private UserRoleApi userRoleApi;
|
||||
@Autowired
|
||||
private WorkExperienceService workExperienceService;
|
||||
@Override
|
||||
public ResultBean save(@Valid StaffBackRecordDto staffBackRecordDto) {
|
||||
StaffBackRecord staffBackRecord = staffBackRecordDto.toEntity();
|
||||
boolean isSave = staffBackRecordService.save(staffBackRecord);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
@Override
|
||||
public ResultBean deleteByItemSid(String itemSid) {
|
||||
// TODO Auto-generated method stub
|
||||
staffBackRecordService.deleteByItemSid(itemSid);
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
@Override
|
||||
public ResultBean<List<StaffBackRecordVo>> selectByItemSid(String itemSid) {
|
||||
List<StaffBackRecordVo> listvo=staffBackRecordService.selectByItemSid(itemSid);
|
||||
return new ResultBean<List<StaffBackRecordVo>>().setData(listvo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.staffbackrecord;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecord;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecordVo;
|
||||
import com.yxt.jlzx.jlcyry.api.stafforg.StaffBingdingVo;
|
||||
import com.yxt.jlzx.jlcyry.api.stafforg.StaffOrg;
|
||||
import com.yxt.jlzx.jlcyry.api.stafforg.StaffOrgBingingDetailsVo;
|
||||
import com.yxt.jlzx.jlcyry.api.stafforg.StaffOrgVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 10:11
|
||||
* @description 人员机构关系
|
||||
*/
|
||||
@Mapper
|
||||
public interface StaffBackRecordMapper extends BaseMapper<StaffBackRecord> {
|
||||
|
||||
public void deleteByItemSid(String itemSid);
|
||||
|
||||
public List<StaffBackRecordVo> selectByItemSid(String itemSid);
|
||||
|
||||
public int selectByStaffSid(String staffSid);
|
||||
|
||||
public StaffBackRecordVo selectByItemSidMax(String itemSid);
|
||||
|
||||
public void deleteByStaffSid(String staffSid);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.staffbackrecord.StaffBackRecordMapper">
|
||||
|
||||
|
||||
<delete id="deleteByItemSid" >
|
||||
delete from staff_back_record where itemSid=#{itemSid}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteByStaffSid" >
|
||||
delete from staff_back_record where staffSid=#{staffSid}
|
||||
</delete>
|
||||
|
||||
<select id="selectByItemSid" resultType="com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecordVo">
|
||||
select * from staff_back_record where itemSid=#{itemSid} ORDER BY createTime DESC LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectByItemSidMax" resultType="com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecordVo">
|
||||
select * from staff_back_record where itemSid=#{itemSid} ORDER BY createTime DESC LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectByStaffSid" resultType="java.lang.Integer">
|
||||
select count(*) from staff_back_record where staffSid=#{staffSid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.staffbackrecord;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecord;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecordVo;
|
||||
import com.yxt.jlzx.jlcyry.api.stafforg.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 10:11
|
||||
* @description 人员机构关系
|
||||
*/
|
||||
@Service
|
||||
public class StaffBackRecordService extends MybatisBaseService<StaffBackRecordMapper, StaffBackRecord> {
|
||||
|
||||
public void deleteByItemSid(String itemSid) {
|
||||
// TODO Auto-generated method stub
|
||||
baseMapper.deleteByItemSid(itemSid);
|
||||
}
|
||||
|
||||
public void deleteByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
baseMapper.deleteByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public List<StaffBackRecordVo> selectByItemSid(String itemSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectByItemSid(itemSid);
|
||||
}
|
||||
|
||||
public int selectByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectByStaffSid(staffSid);
|
||||
}
|
||||
public StaffBackRecordVo selectByItemSidMax(String itemSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectByItemSidMax(itemSid);
|
||||
}
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,128 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.staffinfo;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.jlzx.jlcyry.api.clientalterrecord.ClientAlterRecordQuery;
|
||||
import com.yxt.jlzx.jlcyry.api.staffinfo.*;
|
||||
import com.yxt.jlzx.system.api.department.DepartmentQuery;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/27 8:59
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface StaffInfoMapper extends BaseMapper<StaffInfo> {
|
||||
|
||||
|
||||
/**
|
||||
* 根据证件号码查询人员信息,是否有此证件号码的人员
|
||||
*
|
||||
* @param idNo 证件号码
|
||||
* @return 证件号码为idNo的人员数量
|
||||
*/
|
||||
public int selectByIdNo(String idNo);
|
||||
|
||||
public int selectByIdNoAndId(String idNo, Integer id);
|
||||
|
||||
/**
|
||||
* 单位人员分页列表
|
||||
*
|
||||
* @param page 分页
|
||||
* @param qw 查询条件
|
||||
* @return 单位人员分页列表
|
||||
*/
|
||||
public IPage<StaffUnitVo> staffUnitPageList(
|
||||
IPage<?> page, @Param(Constants.WRAPPER) Wrapper<StaffUnitVo> qw);
|
||||
|
||||
public IPage<StaffNoUnitVo> staffNoUnitPageList(
|
||||
IPage<?> page, @Param(Constants.WRAPPER) Wrapper<StaffNoUnitVo> qw);
|
||||
|
||||
|
||||
public StaffInfo selectByIdCard(String idCard);
|
||||
|
||||
/**
|
||||
* 根据用户名查询人员信息
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @return 人员信息
|
||||
*/
|
||||
public StaffBasicDetailsVo selectByUserName(String userName);
|
||||
|
||||
/**
|
||||
* 根据人员sid 查询人员基本信息
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return 人员基本信息
|
||||
*/
|
||||
public StaffBasicDetailsVo selectByStaffSid(String staffSid);
|
||||
|
||||
/**
|
||||
* 人员列表导出excel(已测试☺)
|
||||
*
|
||||
* @param qw 查询条件
|
||||
* @return 根据条件查询出来的人员列表
|
||||
*/
|
||||
public List<ExportVo> listExcel(@Param(Constants.WRAPPER) Wrapper<ExportVo> qw);
|
||||
|
||||
/**
|
||||
* 根据人员sid查询人员信息详情
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return
|
||||
*/
|
||||
public StaffUnitDetailsVo staffUnitDetails(@Param("staffSid") String staffSid, @Param("path") String path);
|
||||
|
||||
public StaffNoUnitDetailsVo staffNoUnitDetails(@Param("staffSid") String staffSid, @Param("path") String path);
|
||||
|
||||
/**
|
||||
* 根据人员sid更新sid
|
||||
*
|
||||
* @param sid 人员sid
|
||||
* @param organizationSid 单位sid
|
||||
* @return
|
||||
*/
|
||||
public int updateOrganizationSid(@Param("sid") String sid, @Param("organizationSid") String organizationSid);
|
||||
|
||||
public int updateOrganizationSidOne(@Param("sid") String sid);
|
||||
|
||||
public int updateState(@Param("state") int state, @Param("staffSid") String staffSid);
|
||||
|
||||
public int updateJoinGroupDate(String sid);
|
||||
|
||||
public List<UserStaffVo> selectUserStaff(String organizationSid);
|
||||
|
||||
public UserStaffTwoVo selectMessage(@Param("staffSid") String staffSid);
|
||||
|
||||
IPage<StaffClientVo> staffClientList(IPage<ClientAlterRecordQuery> page, @Param(Constants.WRAPPER) Wrapper<StaffClientVo> qw);
|
||||
|
||||
public IPage<StaffUnitVo> administrativeInfoList(IPage<?> page, @Param(Constants.WRAPPER) Wrapper<StaffUnitVo> qw);
|
||||
|
||||
public IPage<StaffUnitVo> technicalInfoList(IPage<?> page, @Param(Constants.WRAPPER) Wrapper<StaffUnitVo> qw);
|
||||
|
||||
public IPage<StaffUnitVo> searchQtjsjgry(IPage<?> page, @Param(Constants.WRAPPER) Wrapper<StaffUnitVo> qw);
|
||||
|
||||
public IPage<StaffUnitVo> searchQjsydwry(IPage<?> page, @Param(Constants.WRAPPER) Wrapper<StaffUnitVo> qw);
|
||||
|
||||
public List<StaffBasicDetailsVo> staffBasicDetailsVoList(@Param("staffSid") String staffSid, @Param("path") String path);
|
||||
|
||||
List<StaffInfo> selectByregionSid(@Param("regionSid") String regionSid);
|
||||
|
||||
int updateStaffInfoBySid(@Param("sid") String sid, @Param("backPhoto") String backPhoto, @Param("frontPhoto") String frontPhoto, @Param("mobile") String mobile,@Param("telephone") String telephone);
|
||||
|
||||
//2021.10.28
|
||||
Integer selectIsFinish(@Param("staffSid") String staffSid);
|
||||
|
||||
StaffInfoInitVo selectByuSid(@Param("uSid") String uSid);
|
||||
|
||||
public int selectByIdCardCount(String idCard);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,401 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.stafforg;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.config.RedisUtil;
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.base.utils.MsgWs;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.jlzx.jlcyry.api.staffinfo.StaffBasicDetailsVo;
|
||||
import com.yxt.jlzx.jlcyry.api.staffinfo.StaffInfo;
|
||||
import com.yxt.jlzx.jlcyry.api.stafforg.*;
|
||||
import com.yxt.jlzx.jlcyry.api.tempstafforg.TempStaffOrg;
|
||||
import com.yxt.jlzx.jlcyry.api.workexperience.WorkExperience;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffappendwait.StaffAppendWaitService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffbackrecord.StaffBackRecordService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffinfo.StaffInfoService;
|
||||
import com.yxt.jlzx.jlcyry.biz.tempstaffinfo.TempStaffInfoService;
|
||||
import com.yxt.jlzx.jlcyry.biz.tempstafforg.TempStaffOrgService;
|
||||
import com.yxt.jlzx.jlcyry.biz.workexperience.WorkExperienceService;
|
||||
import com.yxt.jlzx.system.api.department.DepartmentApi;
|
||||
import com.yxt.jlzx.system.api.departmentstaff.DepartmentStaffApi;
|
||||
import com.yxt.jlzx.system.api.organization.Organization;
|
||||
import com.yxt.jlzx.system.api.organization.OrganizationApi;
|
||||
import com.yxt.jlzx.system.api.orgtype.OrgTypeApi;
|
||||
import com.yxt.jlzx.system.api.orguserrole.OrgUserRoleApi;
|
||||
import com.yxt.jlzx.system.api.role.RoleApi;
|
||||
import com.yxt.jlzx.system.api.user.User;
|
||||
import com.yxt.jlzx.system.api.user.UserApi;
|
||||
import com.yxt.jlzx.system.api.userrole.UserRoleApi;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.validation.Valid;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 10:11
|
||||
* @description 人员机构关系
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/staffOrg")
|
||||
@Api(tags = "人员机构")
|
||||
public class StaffOrgApiImpl implements StaffOrgApi {
|
||||
|
||||
@Autowired
|
||||
private StaffOrgService staffOrgService;
|
||||
@Autowired
|
||||
private RedisUtil redisUtil;
|
||||
|
||||
@Autowired(required = false)
|
||||
private HttpServletRequest httpServletRequest;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
private DepartmentApi departmentApi;
|
||||
@Autowired
|
||||
private DepartmentStaffApi departmentStaffApi;
|
||||
@Autowired
|
||||
private UserApi userApi;
|
||||
@Autowired
|
||||
private StaffInfoService staffInfoService;
|
||||
@Autowired
|
||||
private OrganizationApi organizationApi;
|
||||
@Autowired
|
||||
private UserRoleApi userRoleApi;
|
||||
@Autowired
|
||||
private WorkExperienceService workExperienceService;
|
||||
@Autowired
|
||||
private OrgTypeApi orgTypeApi;
|
||||
@Autowired
|
||||
private OrgUserRoleApi orgUserRoleApi;
|
||||
@Autowired
|
||||
private RoleApi roleApi;
|
||||
@Autowired
|
||||
private TempStaffOrgService tempStaffOrgService;
|
||||
@Autowired
|
||||
private TempStaffInfoService tempStaffInfoService;
|
||||
|
||||
@Autowired
|
||||
private StaffAppendWaitService staffAppendWaitService;
|
||||
@Autowired
|
||||
private StaffBackRecordService staffBackRecordService;
|
||||
|
||||
/**
|
||||
* 查看当前工作信息
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return 当前工作信息
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<StaffOrgVo> staffOrgInfo(String staffSid) {
|
||||
StaffOrgVo staffOrgVo = staffOrgService.staffOrgInfo(staffSid);
|
||||
if(staffOrgVo==null) {
|
||||
staffOrgVo=new StaffOrgVo();
|
||||
return new ResultBean<StaffOrgVo>().fail().setData(staffOrgVo);
|
||||
}
|
||||
return new ResultBean<StaffOrgVo>().success().setData(staffOrgVo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<StaffOrg>> pagerList(PagerQuery pagerQuery) {
|
||||
ResultBean<PagerVo<StaffOrg>> rb = ResultBean.fireFail();
|
||||
PagerVo<StaffOrg> page = staffOrgService.page(pagerQuery);
|
||||
return rb.success().setData(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员机构关系保存
|
||||
*
|
||||
* @param staffOrgDto 人员机构关系dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(@Valid StaffOrgDto staffOrgDto) {
|
||||
String staffSid = staffOrgDto.getStaffSid();
|
||||
StaffOrg staffOrgOne = staffOrgService.selectByStaffSid(staffSid);
|
||||
if (staffOrgOne != null) {
|
||||
String name = staffOrgService.selectByName(staffOrgOne.getOrgSid());
|
||||
return ResultBean.fireFail().setMsg("该人员已经绑定单位或已申请绑定" + name + "单位");
|
||||
}
|
||||
StaffOrg staffOrg = staffOrgDto.toEntity();
|
||||
boolean isSave = staffOrgService.save(staffOrg);
|
||||
WorkExperience workExperience = new WorkExperience();
|
||||
//根据单位sid查询单位名称
|
||||
WorkExperience workExperience1 = workExperienceService.selectByOrgSidAndStaffSid(staffSid, staffOrgDto.getOrgSid());
|
||||
if (workExperience1 != null) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("staffSid", staffOrgDto.getStaffSid());
|
||||
map.put("orgSid", staffOrgDto.getOrgSid());
|
||||
map.put("orgName", workExperience1.getOrgName());
|
||||
workExperienceService.updateBySid(map, workExperience1.getSid());
|
||||
} else {
|
||||
ResultBean<Organization> organizationResultBean = organizationApi.organizationOne(staffOrgDto.getOrgSid());
|
||||
workExperience.setStaffSid(staffOrgDto.getStaffSid());
|
||||
workExperience.setOrgSid(staffOrgDto.getOrgSid());
|
||||
workExperience.setOrgName(organizationResultBean.getData().getName());
|
||||
workExperienceService.save(workExperience);
|
||||
}
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 人员机构关系保存
|
||||
*
|
||||
* @param staffOrgDto 人员机构关系dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save1(@Valid StaffOrgDto staffOrgDto) {
|
||||
String staffSid = staffOrgDto.getStaffSid();
|
||||
StaffOrg staffOrgOne = staffOrgService.selectByStaffSid(staffSid);
|
||||
if (staffOrgOne != null) {
|
||||
return ResultBean.fireFail().setMsg("该人员已经绑定单位或已申请绑定单位");
|
||||
}
|
||||
String org = staffOrgDto.getOrg();
|
||||
ResultBean<Organization> rb = organizationApi.selectByOrgName(org);
|
||||
if (!rb.getSuccess()) {
|
||||
return ResultBean.fireFail().setMsg(rb.getMsg());
|
||||
}
|
||||
Organization organization = rb.getData();
|
||||
String orgSid = organization.getSid();
|
||||
StaffOrg staffOrg = staffOrgDto.toEntity();
|
||||
staffOrg.setOrgSid(orgSid);
|
||||
boolean isSave = staffOrgService.save(staffOrg);
|
||||
WorkExperience workExperience = new WorkExperience();
|
||||
//根据单位sid查询单位名称
|
||||
WorkExperience workExperience1 = workExperienceService.selectByOrgSidAndStaffSid(staffSid, orgSid);
|
||||
if (workExperience1 != null) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("staffSid", staffOrgDto.getStaffSid());
|
||||
map.put("orgSid", orgSid);
|
||||
map.put("orgName", workExperience1.getOrgName());
|
||||
workExperienceService.updateBySid(map, workExperience1.getSid());
|
||||
} else {
|
||||
ResultBean<Organization> organizationResultBean = organizationApi.organizationOne(orgSid);
|
||||
workExperience.setStaffSid(staffOrgDto.getStaffSid());
|
||||
workExperience.setOrgSid(orgSid);
|
||||
workExperience.setOrgName(org);
|
||||
workExperienceService.save(workExperience);
|
||||
}
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员机构关系修改(@PathVariable是spring3.0的一个新功能:接收请求路径中占位符的值.
|
||||
* 通过 @PathVariable 可以将URL中占位符参数{xxx}绑定到处理器类的方法形参中@PathVariable(“xxx“) )
|
||||
*
|
||||
* @param staffOrgDto 人员机构关系dto对象
|
||||
* @param sid 人员机构关系sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean update(@Valid StaffOrgDto staffOrgDto, String sid) {
|
||||
//根据sid查询人员机构关系是否存在
|
||||
StaffOrg staffOrg = staffOrgService.fetchBySid(sid);
|
||||
if (staffOrg == null) {
|
||||
return ResultBean.fireFail().setMsg("该人员机构关系不存在");
|
||||
}
|
||||
int i = staffOrgService.updateBySid(staffOrgDto.toMap(staffOrg), sid);
|
||||
if (i <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员机构关系删除
|
||||
*
|
||||
* @param organizationSid 单位sid
|
||||
* @param staffSid 人员sid
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public ResultBean delete(String organizationSid, String staffSid) {
|
||||
ResultBean<User> rb = userApi.selectByStaffSid(staffSid);
|
||||
User u = rb.getData();
|
||||
//根据sid查询人员机构关系是否存在
|
||||
StaffOrgVo staffOrgVo = staffOrgService.selectByOrgSidAndStaffSid(staffSid, organizationSid);
|
||||
if (staffOrgVo == null) {
|
||||
return ResultBean.fireFail().setMsg("该人员机构关系不存在");
|
||||
}
|
||||
int i = staffOrgService.deleteBySid(staffOrgVo.getSid());
|
||||
//解绑之后将机构sid从人员表中和user表中删除。
|
||||
staffInfoService.updateOrganizationSidOne(staffSid);
|
||||
staffInfoService.updateLinkTableState(staffSid);
|
||||
userApi.updateOrganizationSidOne(staffSid);
|
||||
userApi.updateIsadmin(staffSid, 3);
|
||||
|
||||
WorkExperience workExperience = workExperienceService.selectByOrgSidAndStaffSid(staffSid, organizationSid);
|
||||
if (workExperience != null) {
|
||||
workExperienceService.updateDate(workExperience.getSid());
|
||||
} else {
|
||||
ResultBean<Organization> organizationResultBean = organizationApi.organizationOne(organizationSid);
|
||||
workExperience.setStaffSid(staffSid);
|
||||
workExperience.setOrgSid(organizationSid);
|
||||
workExperience.setOrgName(organizationResultBean.getData().getName());
|
||||
workExperience.setLeaveDate(new Date());
|
||||
workExperienceService.save(workExperience);
|
||||
}
|
||||
departmentStaffApi.deleteByStaffSid(staffSid);
|
||||
if (u != null) {
|
||||
orgUserRoleApi.deleteByUserSid(u.getSid());
|
||||
}
|
||||
staffAppendWaitService.deleteByStaffSid(staffSid);
|
||||
staffBackRecordService.deleteByStaffSid(staffSid);
|
||||
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员绑定审核列表
|
||||
*
|
||||
* @param pagerQuery 查询条件
|
||||
* @return 人员绑定审核列表数据
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<StaffBingdingVo>> staffBingingList(PagerQuery<StaffBindingQuery> pagerQuery) {
|
||||
ResultBean<PagerVo<StaffBingdingVo>> rb = ResultBean.fireFail();
|
||||
String token = httpServletRequest.getHeader("token");
|
||||
String userName = redisUtil.get(token);
|
||||
if (StringUtils.isBlank(userName)) {
|
||||
return new ResultBean<PagerVo<StaffBingdingVo>>().fail().setMsg("账号错误");
|
||||
}
|
||||
String organizationSid = staffOrgService.selectOrganizationSid(userName);
|
||||
PagerVo<StaffBingdingVo> pv = new PagerVo<>();
|
||||
IPage<StaffBingdingVo> p2 = staffOrgService.staffBingingList(pagerQuery, organizationSid);
|
||||
PagerVo<StaffBingdingVo> pv1 = PagerUtil.pageToVo(p2, pv);
|
||||
return rb.success().setData(pv1);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 审核人员绑定
|
||||
*
|
||||
* @param verifyStaffOrgQuery 参数
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean verifyStaffOrg(VerifyStaffOrgQuery verifyStaffOrgQuery) {
|
||||
// String departmentSid = verifyStaffOrgQuery.getDepartmentSid();
|
||||
String organizationSid = verifyStaffOrgQuery.getOrganizationSid();
|
||||
Integer state = verifyStaffOrgQuery.getState();
|
||||
String staffSid = verifyStaffOrgQuery.getStaffSid();
|
||||
//ResultBean<User> userResultBean = userApi.selectByStaffSid1(staffSid);
|
||||
String msg = "";
|
||||
if (state == 2) {
|
||||
//通过
|
||||
int i = staffOrgService.updateState(state, staffSid, organizationSid);
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
}
|
||||
ResultBean<Integer> integerResultBean = userApi.updateOrganizationSid(staffSid, organizationSid);
|
||||
userApi.updateIsadmin(staffSid, 2);
|
||||
int ii = staffInfoService.updateOrganizationSid(staffSid, organizationSid);
|
||||
tempStaffInfoService.copyToTemp(staffSid,1);
|
||||
StaffBasicDetailsVo staffvo = staffInfoService.selectByStaffSid(staffSid);
|
||||
MsgWs.SendWaitWorkMsg(staffvo.getMobile(), MsgWs.MSG_ORG_STAFF);
|
||||
|
||||
//分角色
|
||||
// ResultBean<Organization> organizationResultBean = organizationApi.organizationOne(organizationSid);
|
||||
// if (organizationResultBean.getData().getDwType().equals("0001")) {
|
||||
// //技术机构
|
||||
// //分角色为技术机构一般人员
|
||||
// //将该人员的角色更改为技术机构一般人员,根据用户sid更改
|
||||
// userRoleApi.updateRoleSid(userResultBean.getData().getSid(), "000005");
|
||||
// } else if (organizationResultBean.getData().getDwType().equals("0002")) {
|
||||
// //行政机构//分角色为行政机构一般人员
|
||||
// userRoleApi.updateRoleSid(userResultBean.getData().getSid(), "000004");
|
||||
// }
|
||||
msg = "操作成功";
|
||||
} else if (state == 3) {
|
||||
StaffOrgVo staffOrgVo = staffOrgService.selectByOrgSidAndStaffSid(staffSid, organizationSid);
|
||||
int i = staffOrgService.deleteBySid(staffOrgVo.getSid());
|
||||
//解绑之后将机构sid从人员表中和user表中删除。
|
||||
staffInfoService.updateOrganizationSidOne(staffSid);
|
||||
userApi.updateOrganizationSidOne(staffSid);
|
||||
//userRoleApi.updateRoleSid(userResultBean.getData().getSid(), "000006");
|
||||
// staffOrgService.updateState(state, staffSid, organizationSid);
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户名查询人员绑定列表点击审核的初始化页面数据
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<StaffOrgBingingDetailsVo> staffOrgBingingDetails(String userName) {
|
||||
StaffOrgBingingDetailsVo staffOrgBingingDetailsVo = staffOrgService.staffOrgBingingDetails(userName);
|
||||
String idBackPhoto = fileUploadComponent.getUrlPrefix() + staffOrgBingingDetailsVo.getIdBackPhoto();
|
||||
String idFrontPhoto = fileUploadComponent.getUrlPrefix() + staffOrgBingingDetailsVo.getIdFrontPhoto();
|
||||
staffOrgBingingDetailsVo.setIdBackPhoto(idBackPhoto);
|
||||
staffOrgBingingDetailsVo.setIdFrontPhoto(idFrontPhoto);
|
||||
return new ResultBean<StaffOrgBingingDetailsVo>().success().setData(staffOrgBingingDetailsVo);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean saveOrUpdate(StaffOrgVo staffOrgVo) {
|
||||
// TODO Auto-generated method stub
|
||||
if(staffOrgVo!=null) {
|
||||
StaffOrg staffOrgInfo = staffOrgService.selectByStaffSid(staffOrgVo.getStaffSid());
|
||||
if(staffOrgInfo==null) {
|
||||
StaffOrg staffOrg=new StaffOrg();
|
||||
staffOrgVo.setSid(staffOrg.getSid());
|
||||
BeanUtils.copyProperties(staffOrgVo, staffOrg);
|
||||
staffOrgService.saveOrUpdate(staffOrg);
|
||||
tempStaffOrgService.copyToTemp(staffOrg.getStaffSid());
|
||||
return ResultBean.fireSuccess().setMessage("保存成功");
|
||||
}else{
|
||||
if(StringUtils.isBlank(staffOrgVo.getOrgSid())) {
|
||||
staffOrgService.deleteBySid(staffOrgInfo.getSid());
|
||||
tempStaffOrgService.deleteByStaffSid(staffOrgVo.getStaffSid());
|
||||
return ResultBean.fireSuccess().setMessage("修改成功");
|
||||
}else {
|
||||
staffOrgInfo.setOrgSid(staffOrgVo.getOrgSid());
|
||||
staffOrgInfo.setStaffSid(staffOrgVo.getStaffSid());
|
||||
staffOrgService.saveOrUpdate(staffOrgInfo);
|
||||
TempStaffOrg selectByStaffSid = tempStaffOrgService.selectByStaffSid(staffOrgVo.getStaffSid());
|
||||
if(selectByStaffSid!=null) {
|
||||
staffOrgInfo.setOrgSid(staffOrgVo.getOrgSid());
|
||||
tempStaffOrgService.updateById(selectByStaffSid);
|
||||
}
|
||||
return ResultBean.fireSuccess().setMessage("修改成功");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
return ResultBean.fireFail().setMessage("操作失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.stafforg;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.jlzx.jlcyry.api.stafforg.StaffBingdingVo;
|
||||
import com.yxt.jlzx.jlcyry.api.stafforg.StaffOrg;
|
||||
import com.yxt.jlzx.jlcyry.api.stafforg.StaffOrgBingingDetailsVo;
|
||||
import com.yxt.jlzx.jlcyry.api.stafforg.StaffOrgVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 10:11
|
||||
* @description 人员机构关系
|
||||
*/
|
||||
@Mapper
|
||||
public interface StaffOrgMapper extends BaseMapper<StaffOrg> {
|
||||
|
||||
/**
|
||||
* 查看当前工作信息
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return 查看当前工作信息
|
||||
*/
|
||||
public StaffOrgVo staffOrgInfo(
|
||||
@Param("staffSid") String staffSid);
|
||||
|
||||
/**
|
||||
* 根据人员sid和单位sid更新人员审核状态
|
||||
*
|
||||
* @param state 审核状态
|
||||
* @param staffSid 人员sid
|
||||
* @param organizationSid 机构sid
|
||||
* @return 更新状态是否成功
|
||||
*/
|
||||
public int updateState(@Param("state") Integer state, @Param("staffSid") String staffSid, @Param("organizationSid") String organizationSid);
|
||||
|
||||
/**
|
||||
* 根据用户名查询单钩sid
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @return
|
||||
*/
|
||||
public String selectOrganizationSid(String userName);
|
||||
|
||||
|
||||
/**
|
||||
* 根据单位sid查询绑定该单位的待审核的人员列表
|
||||
*
|
||||
* @param page 分页
|
||||
* @param qw 查询条件
|
||||
* @param sid 单位sid
|
||||
* @return 绑定该单位的待审核的人员列表数据
|
||||
*/
|
||||
public IPage<StaffBingdingVo> staffBingingList(
|
||||
IPage<?> page, @Param(Constants.WRAPPER) Wrapper<StaffBingdingVo> qw, String sid);
|
||||
|
||||
public StaffOrgVo selectByOrgSidAndStaffSid(@Param("staffSid") String staffSid, @Param("orgSid") String orgSid);
|
||||
|
||||
/**
|
||||
* 根据用户名查询人员绑定列表点击审核的初始化页面数据
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @return
|
||||
*/
|
||||
public StaffOrgBingingDetailsVo staffOrgBingingDetails(String userName);
|
||||
|
||||
public StaffOrg selectByStaffSid(String staffSid);
|
||||
|
||||
public String selectByName(String orgSid);
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,140 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.stafforg.StaffOrgMapper">
|
||||
|
||||
|
||||
<!-- <resultMap id="staffOrgInfoMap" type="com.yxt.jlzx.jlcyry.api.stafforg.StaffOrgVo">
|
||||
<result column="organizationName" jdbcType="VARCHAR" property="organizationName"/>
|
||||
<result column="orgSid" jdbcType="VARCHAR" property="orgSid"/>
|
||||
<result column="identity" jdbcType="VARCHAR" property="identity"/>
|
||||
<result column="joinDate" jdbcType="VARCHAR" property="joinDate"/>
|
||||
<result column="joinType" jdbcType="VARCHAR" property="joinType"/>
|
||||
<result column="staffClass" jdbcType="VARCHAR" property="staffClass"/>
|
||||
<result column="currentjob" jdbcType="VARCHAR" property="currentjob"/>
|
||||
<result column="nowTechtitle" jdbcType="VARCHAR" property="nowTechtitle"/>
|
||||
<result column="nowTechtitleDate" jdbcType="VARCHAR" property="nowTechtitleDate"/>
|
||||
<result column="currentPost" jdbcType="VARCHAR" property="currentPost"/>
|
||||
<result column="currentPostDate" jdbcType="VARCHAR" property="currentPostDate"/>
|
||||
<result column="post" jdbcType="VARCHAR" property="post"/>
|
||||
<result column="title" jdbcType="VARCHAR" property="title"/>
|
||||
<result column="sid" jdbcType="VARCHAR" property="sid"/>
|
||||
<collection property="postList" ofType="Map"
|
||||
select="postList" column="post">
|
||||
</collection>
|
||||
<collection property="titleList" ofType="Map"
|
||||
select="titleList" column="title">
|
||||
</collection>
|
||||
</resultMap>
|
||||
<select id="postList" resultType="java.util.Map">
|
||||
SELECT dictKey, dictType, dictValue
|
||||
FROM jlzx_system.dict_common
|
||||
WHERE dictType = #{post}
|
||||
</select>
|
||||
<select id="titleList" resultType="java.util.Map">
|
||||
SELECT dictKey, dictType, dictValue
|
||||
FROM jlzx_system.dict_common
|
||||
WHERE dictType = #{title}
|
||||
</select> -->
|
||||
<select id="staffOrgInfo" resultType="com.yxt.jlzx.jlcyry.api.stafforg.StaffOrgVo">
|
||||
SELECT o.name organizationName,
|
||||
so.orgSid orgSid,
|
||||
so.identity,
|
||||
so.joinType,
|
||||
so.currentPost,
|
||||
so.currentjob,
|
||||
so.nowTechtitle,
|
||||
so.currentAdministrative,
|
||||
so.currentRank,
|
||||
DATE_FORMAT(so.joinDate, '%Y-%m') AS joinDate,
|
||||
DATE_FORMAT(so.nowTechtitleDate, '%Y-%m-%d') AS nowTechtitleDate,
|
||||
DATE_FORMAT(so.currentPostDate, '%Y-%m-%d') AS currentPostDate,
|
||||
DATE_FORMAT(so.currentAdministrativeDate, '%Y-%m-%d') AS currentAdministrativeDate,
|
||||
DATE_FORMAT(so.currentRankDate, '%Y-%m-%d') AS currentRankDate,
|
||||
so.staffClass,
|
||||
so.sid
|
||||
FROM jlzx_base.staff_org so
|
||||
LEFT JOIN jlzx_system.organization o ON o.sid = so.orgSid
|
||||
WHERE so.staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
<update id="updateState">
|
||||
UPDATE staff_org
|
||||
SET state =#{state}
|
||||
WHERE staffSid = #{staffSid}
|
||||
AND orgSid = #{organizationSid}
|
||||
</update>
|
||||
<select id="selectOrganizationSid" resultType="java.lang.String">
|
||||
SELECT organizationSid
|
||||
FROM jlzx_system.user
|
||||
WHERE userName = #{userName}
|
||||
</select>
|
||||
<select id="staffBingingList" resultType="com.yxt.jlzx.jlcyry.api.stafforg.StaffBingdingVo">
|
||||
SELECT so.staffSid,
|
||||
DATE_FORMAT(u.createTime, '%Y-%m-%d') AS createTime,
|
||||
si.name,
|
||||
si.idNo,
|
||||
si.mobile,
|
||||
so.orgSid,
|
||||
u.userName,
|
||||
so.state,
|
||||
d.name departmentName
|
||||
FROM jlzx_base.staff_org so
|
||||
LEFT JOIN staffinfo si ON si.sid = so.staffSid
|
||||
LEFT JOIN jlzx_system.user u ON u.staffSid = si.sid
|
||||
LEFT JOIN jlzx_system.department_staff df ON df.staffSid = so.staffSid
|
||||
LEFT JOIN jlzx_system.department d ON d.sid = df.departmentSid
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
|
||||
<select id="selectByOrgSidAndStaffSid" resultType="com.yxt.jlzx.jlcyry.api.stafforg.StaffOrgVo">
|
||||
SELECT o.name organizationName,
|
||||
so.orgSid orgSid,
|
||||
so.identity,
|
||||
so.joinType,
|
||||
so.currentPost,
|
||||
so.currentjob,
|
||||
so.nowTechtitle,
|
||||
so.currentAdministrative,
|
||||
so.currentRank,
|
||||
so.staffClass,
|
||||
DATE_FORMAT(so.joinDate, '%Y-%m-%d') AS joinDate,
|
||||
DATE_FORMAT(so.nowTechtitleDate, '%Y-%m-%d') AS nowTechtitleDate,
|
||||
DATE_FORMAT(so.currentPostDate, '%Y-%m-%d') AS currentPostDate,
|
||||
DATE_FORMAT(so.currentAdministrativeDate, '%Y-%m-%d') AS currentAdministrativeDate,
|
||||
DATE_FORMAT(so.currentRankDate, '%Y-%m-%d') AS currentRankDate,
|
||||
so.sid,
|
||||
so.state
|
||||
FROM jlzx_base.staff_org so
|
||||
LEFT JOIN jlzx_system.organization o ON o.sid = so.orgSid
|
||||
WHERE so.staffSid = #{staffSid}
|
||||
AND orgSid = #{orgSid}
|
||||
</select>
|
||||
|
||||
<select id="staffOrgBingingDetails" resultType="com.yxt.jlzx.jlcyry.api.stafforg.StaffOrgBingingDetailsVo">
|
||||
SELECT si.name,
|
||||
si.mobile,
|
||||
si.idNo,
|
||||
u.userName,
|
||||
si.idBackPhoto,
|
||||
si.idFrontPhoto,
|
||||
so.state
|
||||
FROM jlzx_base.staffinfo si
|
||||
LEFT JOIN jlzx_system.user u ON u.staffSid = si.sid
|
||||
LEFT JOIN jlzx_base.staff_org so ON so.staffSid = si.sid
|
||||
WHERE u.userName = #{userName}
|
||||
AND u.isDelete = 0
|
||||
</select>
|
||||
|
||||
<select id="selectByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.stafforg.StaffOrg">
|
||||
SELECT *
|
||||
FROM jlzx_base.staff_org
|
||||
WHERE staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
<select id="selectByName" resultType="java.lang.String">
|
||||
SELECT name
|
||||
FROM jlzx_system.organization
|
||||
WHERE sid = #{orgSid}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,208 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.stafforg;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.base.utils.StringUtils;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.jlzx.jlcyry.api.stafforg.*;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonApi;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonListVo;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonVo;
|
||||
import com.yxt.jlzx.system.api.index.IndexApi;
|
||||
import com.yxt.jlzx.system.api.index.IndexDetailsOrg;
|
||||
import com.yxt.jlzx.system.api.orgtype.OrgTypeApi;
|
||||
import com.yxt.jlzx.system.api.role.RoleApi;
|
||||
import com.yxt.jlzx.system.api.role.RoleQuery;
|
||||
import com.yxt.jlzx.system.api.role.RoleVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 10:11
|
||||
* @description 人员机构关系
|
||||
*/
|
||||
@Service
|
||||
public class StaffOrgService extends MybatisBaseService<StaffOrgMapper, StaffOrg> {
|
||||
@Autowired
|
||||
private DictCommonApi commonApi;
|
||||
@Autowired
|
||||
private OrgTypeApi orgTypeApi;
|
||||
@Autowired
|
||||
private RoleApi roleApi;
|
||||
@Autowired
|
||||
private IndexApi indexApi;
|
||||
|
||||
/**
|
||||
* 查看当前工作信息
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return 当前工作信息
|
||||
*/
|
||||
public StaffOrgVo staffOrgInfo(String staffSid) {
|
||||
StaffOrgVo vo = baseMapper.staffOrgInfo(staffSid);
|
||||
if (vo == null) {
|
||||
return null;
|
||||
}
|
||||
ResultBean<IndexDetailsOrg> bean = indexApi.indexOrgDetails(vo.getOrgSid());
|
||||
if (bean.getSuccess()) {
|
||||
vo.setOrganizationName(bean.getData().getName());
|
||||
}
|
||||
if (org.apache.commons.lang3.StringUtils.isNoneBlank(vo.getIdentity())) {
|
||||
ResultBean<DictCommonVo> selectBykey = commonApi.selectBykey(vo.getIdentity(), "rysf");
|
||||
vo.setIdentity(selectBykey.getData().getDictValue());
|
||||
}
|
||||
if (org.apache.commons.lang3.StringUtils.isNoneBlank(vo.getJoinType())) {
|
||||
ResultBean<DictCommonVo> selectBykey = commonApi.selectBykey(vo.getJoinType(), "jrbdwxs1");
|
||||
vo.setJoinType(selectBykey.getData().getDictValue());
|
||||
}
|
||||
if (org.apache.commons.lang3.StringUtils.isNoneBlank(vo.getCurrentPost())) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
if (org.apache.commons.lang3.StringUtils.isNoneBlank(vo.getOrgSid())) {
|
||||
list = orgTypeApi.findTypeKeysByOrgSid(vo.getOrgSid());
|
||||
}
|
||||
if (list != null && list.size() > 0) {
|
||||
ResultBean<DictCommonVo> selectBykey = commonApi.selectBykey(vo.getCurrentPost(), "xpgw");
|
||||
vo.setCurrentPost(selectBykey.getData().getDictValue());
|
||||
if (StringUtils.isNotBlank(vo.getCurrentRank())) {
|
||||
ResultBean<DictCommonVo> selectBykey1 = commonApi.selectBykey(vo.getCurrentRank(), "xrzj");
|
||||
vo.setCurrentRank(selectBykey1.getData().getDictValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
if (org.apache.commons.lang3.StringUtils.isNoneBlank(vo.getCurrentjob())) {
|
||||
ResultBean<DictCommonVo> selectBykey = commonApi.selectBykey(vo.getCurrentjob(), "xcsgz1");
|
||||
vo.setCurrentjob(selectBykey.getData().getDictValue());
|
||||
}
|
||||
if (org.apache.commons.lang3.StringUtils.isNoneBlank(vo.getNowTechtitle())) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
if (org.apache.commons.lang3.StringUtils.isNoneBlank(vo.getOrgSid())) {
|
||||
list = orgTypeApi.findTypeKeysByOrgSid(vo.getOrgSid());
|
||||
}
|
||||
if (list != null && list.size() > 0) {
|
||||
ResultBean<DictCommonVo> selectBykey = commonApi.selectBykey(vo.getNowTechtitle(), "zyjszgmc");
|
||||
vo.setNowTechtitle(selectBykey.getData().getDictValue());
|
||||
if (StringUtils.isNotBlank(vo.getCurrentAdministrative())) {
|
||||
ResultBean<DictCommonVo> selectBykey1 = commonApi.selectBykey(vo.getCurrentAdministrative(), "xrzw");
|
||||
vo.setCurrentAdministrative(selectBykey1.getData().getDictValue());
|
||||
}
|
||||
}
|
||||
}
|
||||
return vo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员基本信息审核通过
|
||||
*
|
||||
* @param state 审核状态
|
||||
* @param staffSid 人员sid
|
||||
* @param organizationSid 机构sid
|
||||
* @return 返回更新人员审核状态是否审核成功
|
||||
*/
|
||||
public int updateState(Integer state, String staffSid, String organizationSid) {
|
||||
return baseMapper.updateState(state, staffSid, organizationSid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户名查询机构sid
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @return
|
||||
*/
|
||||
public String selectOrganizationSid(String userName) {
|
||||
return baseMapper.selectOrganizationSid(userName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员绑定列表待审核人员数据
|
||||
*
|
||||
* @param pagerQuery 查询条件
|
||||
* @param sid 单位sid
|
||||
* @return
|
||||
*/
|
||||
public IPage<StaffBingdingVo> staffBingingList(PagerQuery<StaffBindingQuery> pagerQuery, String sid) {
|
||||
IPage<StaffBindingQuery> page = PagerUtil.queryToPage(pagerQuery);
|
||||
StaffBindingQuery params = pagerQuery.getParams();
|
||||
QueryWrapper<StaffBingdingVo> qw = new QueryWrapper<>();
|
||||
if (params != null) {
|
||||
String userName = params.getUserName();
|
||||
if (StringUtils.isNotBlank(userName)) {
|
||||
qw.like("si.name", userName);
|
||||
}
|
||||
}
|
||||
qw.eq("so.orgSid", sid);
|
||||
//qw.in("so.state", 1, 2);
|
||||
qw.in("so.state", 1);
|
||||
qw.eq("u.isAdmin", 3);
|
||||
qw.eq("u.isDelete", 0);
|
||||
return baseMapper.staffBingingList(page, qw, sid);
|
||||
}
|
||||
|
||||
public StaffOrgVo selectByOrgSidAndStaffSid(String staffSid, String orgSid) {
|
||||
StaffOrgVo vo = baseMapper.selectByOrgSidAndStaffSid(staffSid, orgSid);
|
||||
ResultBean<IndexDetailsOrg> bean = indexApi.indexOrgDetails(orgSid);
|
||||
if (bean.getSuccess()) {
|
||||
vo.setOrganizationName(bean.getData().getName());
|
||||
}
|
||||
if (vo == null) {
|
||||
return null;
|
||||
}
|
||||
List<String> list = new ArrayList<String>();
|
||||
list = orgTypeApi.findTypeKeysByOrgSid(orgSid);
|
||||
if (list != null && list.size() > 0) {
|
||||
if (list.contains("0002")) {
|
||||
ResultBean<List<DictCommonListVo>> dictsByTypeCode = commonApi.getDictsByTypeCode("xrzw");
|
||||
vo.setPostList(dictsByTypeCode.getData());
|
||||
ResultBean<List<DictCommonListVo>> dictsByTypeCode1 = commonApi.getDictsByTypeCode("xrzj");
|
||||
vo.setTitleList(dictsByTypeCode1.getData());
|
||||
} else {
|
||||
ResultBean<List<DictCommonListVo>> dictsByTypeCode = commonApi.getDictsByTypeCode("xrzg");
|
||||
vo.setPostList(dictsByTypeCode.getData());
|
||||
ResultBean<List<DictCommonListVo>> dictsByTypeCode1 = commonApi.getDictsByTypeCode("xpgw");
|
||||
vo.setTitleList(dictsByTypeCode1.getData());
|
||||
}
|
||||
}
|
||||
// RoleQuery q = new RoleQuery();
|
||||
// q.setOrgTypeKeys(list);
|
||||
// q.setUserType("2");
|
||||
// ResultBean<List<RoleVo>> rl = roleApi.list(q);
|
||||
// if (rl.getData() != null) {
|
||||
// List<RoleVo> list2 = rl.getData();
|
||||
// String str = "";
|
||||
// for (int i = 0; i < list2.size(); i++) {
|
||||
// str = list2.get(i).getRoleName() + ";" + str;
|
||||
// }
|
||||
// str = str.substring(0, str.length() - 1);
|
||||
// vo.setStaffClass(str);
|
||||
// }
|
||||
|
||||
return vo;
|
||||
|
||||
//return baseMapper.selectByOrgSidAndStaffSid(staffSid, orgSid);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据用户名查询人员绑定列表点击审核的初始化页面数据
|
||||
*
|
||||
* @param userName 用户名
|
||||
* @return
|
||||
*/
|
||||
public StaffOrgBingingDetailsVo staffOrgBingingDetails(String userName) {
|
||||
return baseMapper.staffOrgBingingDetails(userName);
|
||||
}
|
||||
|
||||
public StaffOrg selectByStaffSid(String staffSid) {
|
||||
return baseMapper.selectByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public String selectByName(String orgSid) {
|
||||
return baseMapper.selectByName(orgSid);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,267 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.technicalreport;
|
||||
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.jlzx.jlcyry.api.technicalreport.Technicalreport;
|
||||
import com.yxt.jlzx.jlcyry.api.technicalreport.TechnicalreportApi;
|
||||
import com.yxt.jlzx.jlcyry.api.technicalreport.TechnicalreportDto;
|
||||
import com.yxt.jlzx.jlcyry.api.technicalreport.TechnicalreportVo;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditional;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffadditional.StaffAdditionalService;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonDto;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonOneVo;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonQuery;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonVo;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/28 14:46
|
||||
* @description 学术情况
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/technicalreport")
|
||||
@Api(tags = "计量专业技术报告")
|
||||
public class TechnicalreportApiImpl implements TechnicalreportApi {
|
||||
|
||||
@Autowired
|
||||
private TechnicalreportService technicalreportService;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
|
||||
@Autowired
|
||||
private DictCommonApi dictCommonApi;
|
||||
|
||||
@Autowired
|
||||
private PhotoCommonApi photoCommonApi;
|
||||
@Autowired
|
||||
private StaffAdditionalService staffAdditionalService;
|
||||
|
||||
|
||||
/**
|
||||
* 学术情况保存
|
||||
*
|
||||
* @param technicalreportDto 学术情况dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(@Valid TechnicalreportDto technicalreportDto) {
|
||||
Technicalreport technicalreport = technicalreportDto.toEntity();
|
||||
// if(StringUtils.isNoneBlank(technicalreportDto.getFilePath())) {
|
||||
// PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
// photoCommon.setFilePath(technicalreportDto.getFilePath());
|
||||
// photoCommon.setType("technicalreportFile");
|
||||
// photoCommon.setLinkSid(technicalreport.getSid());
|
||||
// photoCommonApi.save(photoCommon);
|
||||
// }
|
||||
boolean isSave = technicalreportService.save(technicalreport);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
List<PhotoCommonOneVo> list1=technicalreportDto.getPhotoUrlList();
|
||||
PhotoCommonDto photoCommon1=new PhotoCommonDto();
|
||||
if(list1!=null&&list1.size()>0) {
|
||||
for (int i = 0; i < list1.size(); i++) {
|
||||
photoCommon1.setFilePath(list1.get(i).getFilePath());
|
||||
photoCommon1.setType("technicalreportFile");
|
||||
photoCommon1.setLinkSid(technicalreport.getSid());
|
||||
photoCommonApi.save(photoCommon1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 学术情况修改(@PathVariable是spring3.0的一个新功能:接收请求路径中占位符的值.
|
||||
* 通过 @PathVariable 可以将URL中占位符参数{xxx}绑定到处理器类的方法形参中@PathVariable(“xxx“) )
|
||||
*
|
||||
* @param technicalreportDto 学术情况dto对象
|
||||
* @param sid 学术情况sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean update(@Valid TechnicalreportDto technicalreportDto, String sid) {
|
||||
//根据sid查询学术情况是否存在
|
||||
Technicalreport technicalreport = technicalreportService.fetchBySid(sid);
|
||||
if (technicalreport == null) {
|
||||
return ResultBean.fireFail().setMsg("该学术情况不存在");
|
||||
}
|
||||
technicalreport.setState(1);
|
||||
int s = technicalreportService.updateBySid(technicalreportDto.toMap(technicalreport), sid);
|
||||
if (s <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
|
||||
// StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(technicalreport.getStaffSid());
|
||||
// if(staffAdditional!=null) {
|
||||
// staffAdditional.setTechnicalreportState(1);
|
||||
// staffAdditionalService.updateById(staffAdditional);
|
||||
// }
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("technicalreportFile1");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
|
||||
q1.setType("technicalreportFile2");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
|
||||
q1.setType("technicalreportFile3");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
|
||||
q1.setType("technicalreportFile4");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
|
||||
q1.setType("technicalreportFile5");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
|
||||
q1.setType("technicalreportFile6");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
|
||||
q1.setType("technicalreportFile7");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
|
||||
q1.setType("technicalreportFile8");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
|
||||
q1.setType("technicalreportFile9");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
|
||||
q1.setType("technicalreportFile10");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
|
||||
List<PhotoCommonOneVo> list1=technicalreportDto.getPhotoUrlList();
|
||||
PhotoCommonDto photoCommon1=new PhotoCommonDto();
|
||||
if(list1!=null&&list1.size()>0) {
|
||||
for (int i = 0; i < list1.size(); i++) {
|
||||
photoCommon1.setFilePath(list1.get(i).getFilePath());
|
||||
photoCommon1.setType("technicalreportFile");
|
||||
photoCommon1.setLinkSid(technicalreport.getSid());
|
||||
photoCommonApi.save(photoCommon1);
|
||||
}
|
||||
}
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 学术情况删除
|
||||
*
|
||||
* @param sid 学术情况sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid) {
|
||||
//根据sid查询学术情况是否存在
|
||||
Technicalreport technicalreport = technicalreportService.fetchBySid(sid);
|
||||
if (technicalreport == null) {
|
||||
return ResultBean.fireFail().setMsg("该学术不存在");
|
||||
}
|
||||
int i = technicalreportService.deleteBySid(sid);
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
|
||||
int count=technicalreportService.selectCountByStaffSid(technicalreport.getStaffSid());
|
||||
int num=technicalreportService.selectStateByStaffSid(technicalreport.getStaffSid());//未审核个数
|
||||
// StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(technicalreport.getStaffSid());
|
||||
// if(staffAdditional!=null) {
|
||||
// staffAdditional.setTechnicalreportNum(count);
|
||||
// if(num==0) {
|
||||
// staffAdditional.setTechnicalreportState(2);//已审核
|
||||
// }else {
|
||||
// staffAdditional.setTechnicalreportState(1);//未审核
|
||||
// }
|
||||
// staffAdditionalService.updateById(staffAdditional);
|
||||
// }
|
||||
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("technicalreportFile");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean infoUpdate(Integer state, String sid){
|
||||
Technicalreport technicalreport = technicalreportService.fetchBySid(sid);
|
||||
if (state!=null) {
|
||||
//通过
|
||||
int i = technicalreportService.updateState(state, sid);
|
||||
|
||||
if(technicalreport!=null) {
|
||||
// int num=technicalreportService.selectStateByStaffSid(technicalreport.getStaffSid());
|
||||
// StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(technicalreport.getStaffSid());
|
||||
// if(staffAdditional!=null) {
|
||||
// if(num==0) {
|
||||
// staffAdditional.setTechnicalreportState(2);//已审核
|
||||
// staffAdditionalService.updateById(staffAdditional);
|
||||
// }else {
|
||||
// staffAdditional.setTechnicalreportState(1);//未审核
|
||||
// staffAdditionalService.updateById(staffAdditional);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
}else {
|
||||
if(state==2) {
|
||||
return ResultBean.fireSuccess().setMsg("审核通过");
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("人审核未通过");
|
||||
}
|
||||
}
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("专业计量技术报告信息审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<TechnicalreportVo> getVo(String sid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
ResultBean<TechnicalreportVo> resultBean=ResultBean.fireFail();
|
||||
Technicalreport technicalreport=technicalreportService.fetchBySid(sid);
|
||||
TechnicalreportVo vo=new TechnicalreportVo();
|
||||
vo.fromEntity(technicalreport);
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("technicalreportFile");
|
||||
List<PhotoCommonVo> list1=photoCommonApi.queryBylinkSidAndType(q1).getData();
|
||||
vo.setPhotoUrlList(list1);
|
||||
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<TechnicalreportVo>> selectByStaffSid(String staffSid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
List<TechnicalreportVo> page = technicalreportService.selectByStaffSid(staffSid,path);
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
@Override
|
||||
public ResultBean<Map<String, Object>> dictSelect() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
ResultBean<Map<String, Object>> dictCommonInitVoResultBean = dictCommonApi.dictCommonReport();
|
||||
map.put("dictCommonList", dictCommonInitVoResultBean.getData());
|
||||
return new ResultBean().success().setData(map);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.technicalreport;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.technicalreport.Technicalreport;
|
||||
import com.yxt.jlzx.jlcyry.api.technicalreport.TechnicalreportVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/28 14:52
|
||||
* @description 学术情况
|
||||
*/
|
||||
@Mapper
|
||||
public interface TechnicalreportMapper extends BaseMapper<Technicalreport> {
|
||||
|
||||
int updateState(@Param("state") Integer state, @Param("sid") String sid);
|
||||
|
||||
public List<TechnicalreportVo> selectByStaffSid(@Param("staffSid") String staffSid,@Param("path") String path);
|
||||
|
||||
int selectStateByStaffSid(String staffSid);
|
||||
public int selectCountByStaffSid(String staffSid);
|
||||
|
||||
List<Technicalreport> listByStaffSid(String staffSid);
|
||||
|
||||
public void updateBystaffSid(@Param("staffInfoSid") String staffInfoSid, @Param("state") int state);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.technicalreport.TechnicalreportMapper">
|
||||
<select id="selectByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.technicalreport.TechnicalreportVo">
|
||||
select pubDate,
|
||||
title,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey = type and dictType = 'zylb2') type,
|
||||
orgName,
|
||||
name,
|
||||
staffSid,
|
||||
sid,
|
||||
remarks,
|
||||
state,
|
||||
reportName
|
||||
from technical_report
|
||||
where staffSid = #{staffSid}
|
||||
ORDER BY pubDate DESC
|
||||
</select>
|
||||
<update id="updateState">
|
||||
UPDATE technical_report
|
||||
SET state =#{state}
|
||||
WHERE sid = #{sid}
|
||||
</update>
|
||||
|
||||
<update id="updateBystaffSid">
|
||||
UPDATE technical_report
|
||||
SET state =#{state}
|
||||
WHERE staffSid = #{staffInfoSid}
|
||||
</update>
|
||||
|
||||
<select id="selectStateByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id)
|
||||
from technical_report
|
||||
where state = 1
|
||||
and staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCountByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id)
|
||||
from technical_report
|
||||
where staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="listByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.technicalreport.Technicalreport">
|
||||
SELECT *
|
||||
FROM technical_report
|
||||
WHERE staffSid = #{staffSid}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.technicalreport;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.technicalreport.Technicalreport;
|
||||
import com.yxt.jlzx.jlcyry.api.technicalreport.TechnicalreportVo;
|
||||
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/28 14:54
|
||||
* @description 学术情况
|
||||
*/
|
||||
@Service
|
||||
public class TechnicalreportService extends MybatisBaseService<TechnicalreportMapper, Technicalreport> {
|
||||
|
||||
public List<TechnicalreportVo> selectByStaffSid(String staffSid,String path) {
|
||||
return baseMapper.selectByStaffSid(staffSid,path);
|
||||
}
|
||||
public int updateState(Integer state, String sid) {
|
||||
return baseMapper.updateState(state, sid);
|
||||
}
|
||||
public int selectStateByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectStateByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public int selectCountByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectCountByStaffSid(staffSid);
|
||||
}
|
||||
public List<Technicalreport> listByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.listByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public void updateState(String staffInfoSid, int state) {
|
||||
// TODO Auto-generated method stub
|
||||
baseMapper.updateBystaffSid(staffInfoSid,state);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,332 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.tempTechnicalreport;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditional;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecord;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecordDto;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecordVo;
|
||||
import com.yxt.jlzx.jlcyry.api.technicalreport.Technicalreport;
|
||||
import com.yxt.jlzx.jlcyry.api.temptechnicalreport.TempTechnicalreport;
|
||||
import com.yxt.jlzx.jlcyry.api.temptechnicalreport.TempTechnicalreportApi;
|
||||
import com.yxt.jlzx.jlcyry.api.temptechnicalreport.TempTechnicalreportDto;
|
||||
import com.yxt.jlzx.jlcyry.api.temptechnicalreport.TempTechnicalreportVo;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffadditional.StaffAdditionalService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffappendwait.StaffAppendWaitService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffbackrecord.StaffBackRecordService;
|
||||
import com.yxt.jlzx.jlcyry.biz.technicalreport.TechnicalreportService;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonDto;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonOneVo;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonQuery;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonVo;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/28 14:46
|
||||
* @description 学术情况
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/tempTechnicalreport")
|
||||
@Api(tags = "计量专业技术报告临时表")
|
||||
public class TempTechnicalreportApiImpl implements TempTechnicalreportApi {
|
||||
|
||||
@Autowired
|
||||
private TempTechnicalreportService tempTechnicalreportService;
|
||||
@Autowired
|
||||
private TechnicalreportService technicalreportService;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
private StaffBackRecordService staffBackRecordService;
|
||||
@Autowired
|
||||
private DictCommonApi dictCommonApi;
|
||||
|
||||
@Autowired
|
||||
private PhotoCommonApi photoCommonApi;
|
||||
@Autowired
|
||||
private StaffAdditionalService staffAdditionalService;
|
||||
|
||||
@Autowired
|
||||
private StaffAppendWaitService staffAppendWaitService;
|
||||
@Autowired
|
||||
private StaffBackRecordService StaffBackRecordService;
|
||||
/**
|
||||
* 学术情况保存
|
||||
*
|
||||
* @param tempTechnicalreportDto 学术情况dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(@Valid TempTechnicalreportDto tempTechnicalreportDto) {
|
||||
TempTechnicalreport tempTechnicalreport = tempTechnicalreportDto.toEntity();
|
||||
// if(StringUtils.isNoneBlank(tempTechnicalreportDto.getFilePath())) {
|
||||
// PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
// photoCommon.setFilePath(tempTechnicalreportDto.getFilePath());
|
||||
// photoCommon.setType("technicalreportFile");
|
||||
// photoCommon.setLinkSid(tempTechnicalreport.getSid());
|
||||
// photoCommonApi.save(photoCommon);
|
||||
// }
|
||||
boolean isSave = tempTechnicalreportService.save(tempTechnicalreport);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
|
||||
// StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(tempTechnicalreport.getStaffSid());
|
||||
// int count=tempTechnicalreportService.selectCountByStaffSid(tempTechnicalreport.getStaffSid());
|
||||
// if(staffAdditional!=null) {
|
||||
// staffAdditional.setScienceNum(staffAdditional.getScienceNum()+1);
|
||||
// staffAdditional.setScienceState(1);
|
||||
// staffAdditionalService.updateById(staffAdditional);
|
||||
// }else {
|
||||
// staffAdditional=new StaffAdditional();
|
||||
// staffAdditional.setScienceNum(staffAdditional.getScienceNum()+1);
|
||||
// staffAdditional.setScienceState(1);
|
||||
// staffAdditional.setStaffSid(tempTechnicalreport.getStaffSid());
|
||||
// staffAdditionalService.save(staffAdditional);
|
||||
// }
|
||||
|
||||
List<PhotoCommonOneVo> list1=tempTechnicalreportDto.getPhotoUrlList();
|
||||
PhotoCommonDto photoCommon1=new PhotoCommonDto();
|
||||
if(list1!=null&&list1.size()>0) {
|
||||
for (int i = 0; i < list1.size(); i++) {
|
||||
photoCommon1.setFilePath(list1.get(i).getFilePath());
|
||||
photoCommon1.setType("technicalreportFile");
|
||||
photoCommon1.setLinkSid(tempTechnicalreport.getSid());
|
||||
photoCommonApi.save(photoCommon1);
|
||||
}
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 学术情况修改(@PathVariable是spring3.0的一个新功能:接收请求路径中占位符的值.
|
||||
* 通过 @PathVariable 可以将URL中占位符参数{xxx}绑定到处理器类的方法形参中@PathVariable(“xxx“) )
|
||||
*
|
||||
* @param tempTechnicalreportDto 学术情况dto对象
|
||||
* @param sid 学术情况sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean update(@Valid TempTechnicalreportDto tempTechnicalreportDto, String sid) {
|
||||
if(tempTechnicalreportService.compareFields(tempTechnicalreportDto, sid)) {
|
||||
//根据sid查询学术情况是否存在
|
||||
TempTechnicalreport tempTechnicalreport = tempTechnicalreportService.fetchBySid(sid);
|
||||
staffBackRecordService.deleteByItemSid(sid);//审核通过删除退回记录表数据
|
||||
if (tempTechnicalreport == null) {
|
||||
return ResultBean.fireFail().setMsg("该学术情况不存在");
|
||||
}
|
||||
tempTechnicalreport.setState(1);
|
||||
int s = tempTechnicalreportService.updateBySid(tempTechnicalreportDto.toMap(tempTechnicalreport), sid);
|
||||
if (s <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
|
||||
// StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(tempTechnicalreport.getStaffSid());
|
||||
// if(staffAdditional!=null) {
|
||||
// staffAdditional.setScienceState(1);
|
||||
// staffAdditionalService.updateById(staffAdditional);
|
||||
// }
|
||||
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(tempTechnicalreport.getSid());
|
||||
q1.setType("technicalreportFile");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
List<PhotoCommonOneVo> list1=tempTechnicalreportDto.getPhotoUrlList();
|
||||
PhotoCommonDto photoCommon1=new PhotoCommonDto();
|
||||
if(list1!=null&&list1.size()>0) {
|
||||
for (int i = 0; i < list1.size(); i++) {
|
||||
photoCommon1.setFilePath(list1.get(i).getFilePath());
|
||||
photoCommon1.setType("technicalreportFile");
|
||||
photoCommon1.setLinkSid(tempTechnicalreport.getSid());
|
||||
photoCommonApi.save(photoCommon1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 学术情况删除
|
||||
*
|
||||
* @param sid 学术情况sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid) {
|
||||
//根据sid查询学术情况是否存在
|
||||
TempTechnicalreport tempTechnicalreport = tempTechnicalreportService.fetchBySid(sid);
|
||||
if (tempTechnicalreport == null) {
|
||||
return ResultBean.fireFail().setMsg("该学术不存在");
|
||||
}
|
||||
int i = tempTechnicalreportService.deleteBySid(sid);technicalreportService.deleteBySid(sid);
|
||||
staffBackRecordService.deleteByItemSid(sid);//删除当前数据同时删除退回记录表数据
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
|
||||
int count=tempTechnicalreportService.selectCountByStaffSid(tempTechnicalreport.getStaffSid());
|
||||
int num=tempTechnicalreportService.selectStateByStaffSid(tempTechnicalreport.getStaffSid());//未审核个数
|
||||
// StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(tempTechnicalreport.getStaffSid());
|
||||
// if(staffAdditional!=null) {
|
||||
// staffAdditional.setScienceNum(count);
|
||||
// if(num==0) {
|
||||
// staffAdditional.setScienceState(2);//已审核
|
||||
// }else {
|
||||
// staffAdditional.setScienceState(1);//未审核
|
||||
// }
|
||||
// staffAdditionalService.updateById(staffAdditional);
|
||||
// }
|
||||
//
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("technicalreportFile");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public ResultBean infoUpdate(Integer state, String sid){
|
||||
if (state!=null) {
|
||||
//通过
|
||||
int i = tempTechnicalreportService.updateState(state, sid);
|
||||
TempTechnicalreport tempTechnicalreport = tempTechnicalreportService.fetchBySid(sid);
|
||||
|
||||
if(tempTechnicalreport!=null) {
|
||||
Technicalreport technicalreport = technicalreportService.fetchBySid(sid);
|
||||
if(technicalreport==null) {
|
||||
technicalreport=new Technicalreport();
|
||||
}
|
||||
BeanUtils.copyProperties(tempTechnicalreport,technicalreport);
|
||||
technicalreportService.deleteBySid(sid);technicalreportService.insert(technicalreport);//审核通过更新正式表数据
|
||||
staffBackRecordService.deleteByItemSid(sid);//审核通过删除退回记录表数据
|
||||
int k=staffAppendWaitService.tzOrBack(tempTechnicalreport.getStaffSid(), sid);//判断是否是审核最后一条,若果是做下一步操作
|
||||
if(k==0) {
|
||||
tempTechnicalreportService.deleteByStaffSid(tempTechnicalreport.getStaffSid());
|
||||
}
|
||||
int num=tempTechnicalreportService.selectStateByStaffSid(tempTechnicalreport.getStaffSid());
|
||||
// StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(tempTechnicalreport.getStaffSid());
|
||||
// if(staffAdditional!=null) {
|
||||
// if(num==0) {
|
||||
// staffAdditional.setScienceState(2);//已审核
|
||||
// staffAdditionalService.updateById(staffAdditional);
|
||||
// }else {
|
||||
// staffAdditional.setScienceState(1);//未审核
|
||||
// staffAdditionalService.updateById(staffAdditional);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("审核通过");
|
||||
}
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("著作、论文及重要技术报告信息审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean infoUpdateBack(StaffBackRecordDto staffBackRecordDto) {
|
||||
String sid=staffBackRecordDto.getItemSid();
|
||||
|
||||
TempTechnicalreport tempTechnicalreport = tempTechnicalreportService.fetchBySid(sid);
|
||||
//通过
|
||||
int i = tempTechnicalreportService.updateState(3, sid);
|
||||
StaffBackRecord entity = staffBackRecordDto.toEntity();
|
||||
entity.setBackDate(new Date());
|
||||
staffBackRecordService.save(entity);
|
||||
staffAppendWaitService.tzOrBack(tempTechnicalreport.getStaffSid(), sid);//判断是否是审核最后一条,若果是做下一步操作
|
||||
if(tempTechnicalreport!=null) {
|
||||
int num=tempTechnicalreportService.selectStateByStaffSid(tempTechnicalreport.getStaffSid());
|
||||
// StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(tempTechnicalreport.getStaffSid());
|
||||
// if(staffAdditional!=null) {
|
||||
// if(num==0) {
|
||||
// staffAdditional.setScienceState(2);//已审核
|
||||
// staffAdditionalService.updateById(staffAdditional);
|
||||
// }else {
|
||||
// staffAdditional.setScienceState(1);//未审核
|
||||
// staffAdditionalService.updateById(staffAdditional);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("人审核未通过");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<TempTechnicalreportVo> getVo(String sid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
ResultBean<TempTechnicalreportVo> resultBean=ResultBean.fireFail();
|
||||
TempTechnicalreport tempTechnicalreport=tempTechnicalreportService.fetchBySid(sid);
|
||||
TempTechnicalreportVo vo=new TempTechnicalreportVo();
|
||||
vo.fromEntity(tempTechnicalreport);
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("technicalreportFile");
|
||||
List<PhotoCommonVo> list1=photoCommonApi.queryBylinkSidAndType(q1).getData();
|
||||
vo.setPhotoUrlList(list1);
|
||||
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<TempTechnicalreportVo>> selectByStaffSid(String staffSid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
List<TempTechnicalreportVo> page = tempTechnicalreportService.selectByStaffSid(staffSid,path);
|
||||
for(int i=0;page.size()>i;i++) {
|
||||
StaffBackRecordVo selectByItemSidMax = staffBackRecordService.selectByItemSidMax( page.get(i).getSid());
|
||||
if(selectByItemSidMax!=null) {
|
||||
page.get(i).setStaffBackRecordVo(selectByItemSidMax);
|
||||
}
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
String sid=page.get(i).getSid();
|
||||
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("technicalreportFile1");
|
||||
List<PhotoCommonVo> list1=photoCommonApi.queryBylinkSidAndType(q1).getData();
|
||||
page.get(i).setPhotoUrlList(list1);
|
||||
|
||||
}
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
@Override
|
||||
public ResultBean<Map<String, Object>> dictSelect() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
ResultBean<Map<String, Object>> dictCommonInitVoResultBean = dictCommonApi.dictCommonReport();
|
||||
map.put("dictCommonList", dictCommonInitVoResultBean.getData());
|
||||
return new ResultBean().success().setData(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<TempTechnicalreportVo>> doingInfo(String staffSid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
List<TempTechnicalreportVo> page = tempTechnicalreportService.doingInfo(staffSid,path);
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.tempTechnicalreport;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.temptechnicalreport.TempTechnicalreport;
|
||||
import com.yxt.jlzx.jlcyry.api.temptechnicalreport.TempTechnicalreportVo;
|
||||
|
||||
|
||||
/**
|
||||
* @author hanweijia
|
||||
* @date 2020/8/28 14:52
|
||||
* @description 学术情况
|
||||
*/
|
||||
@Mapper
|
||||
public interface TempTechnicalreportMapper extends BaseMapper<TempTechnicalreport> {
|
||||
|
||||
int updateState(@Param("state") Integer state, @Param("sid") String sid);
|
||||
|
||||
public List<TempTechnicalreportVo> selectByStaffSid(@Param("staffSid") String staffSid,@Param("path") String path);
|
||||
|
||||
public List<TempTechnicalreportVo> doingInfo(@Param("staffSid") String staffSid,@Param("path") String path);
|
||||
|
||||
int selectStateByStaffSid(String staffSid);
|
||||
public int selectCountByStaffSid(String staffSid);
|
||||
|
||||
void deleteByStaffSid(String staffSid);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.tempTechnicalreport.TempTechnicalreportMapper">
|
||||
<select id="selectByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.temptechnicalreport.TempTechnicalreportVo">
|
||||
select pubDate,
|
||||
title,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey = type and dictType = 'zylb2') type,
|
||||
orgName,
|
||||
name,
|
||||
staffSid,
|
||||
sid,
|
||||
remarks,
|
||||
state,
|
||||
reportName
|
||||
from temp_technical_report
|
||||
where staffSid = #{staffSid}
|
||||
ORDER BY pubDate DESC
|
||||
</select>
|
||||
|
||||
<select id="doingInfo" resultType="com.yxt.jlzx.jlcyry.api.temptechnicalreport.TempTechnicalreportVo">
|
||||
select pubDate,
|
||||
title,
|
||||
(select dictValue from jlzx_system.dict_common where dictKey = type and dictType = 'zylb2') type,
|
||||
orgName,
|
||||
name,
|
||||
staffSid,
|
||||
sid,
|
||||
remarks,
|
||||
state,
|
||||
reportName
|
||||
from temp_technical_report
|
||||
where staffSid = #{staffSid}
|
||||
and state = 1
|
||||
ORDER BY pubDate DESC
|
||||
</select>
|
||||
|
||||
<update id="updateState">
|
||||
UPDATE temp_technical_report
|
||||
SET state =#{state}
|
||||
WHERE sid = #{sid}
|
||||
</update>
|
||||
|
||||
<select id="selectStateByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id)
|
||||
from temp_technical_report
|
||||
where state = 1
|
||||
and staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectCountByStaffSid" resultType="java.lang.Integer">
|
||||
select count(id)
|
||||
from temp_technical_report
|
||||
where staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
|
||||
<delete id="deleteByStaffSid">
|
||||
delete
|
||||
from temp_technical_report
|
||||
where staffSid = #{staffSid}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -0,0 +1,122 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.tempTechnicalreport;
|
||||
|
||||
import java.beans.Introspector;
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.lang.reflect.Method;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.technicalreport.Technicalreport;
|
||||
import com.yxt.jlzx.jlcyry.api.temptechnicalreport.TempTechnicalreport;
|
||||
import com.yxt.jlzx.jlcyry.api.temptechnicalreport.TempTechnicalreportDto;
|
||||
import com.yxt.jlzx.jlcyry.api.temptechnicalreport.TempTechnicalreportVo;
|
||||
import com.yxt.jlzx.jlcyry.biz.technicalreport.TechnicalreportService;
|
||||
|
||||
|
||||
/**
|
||||
* @author hanweijia
|
||||
* @date 2020/8/28 14:54
|
||||
* @description 学术情况
|
||||
*/
|
||||
@Service
|
||||
public class TempTechnicalreportService extends MybatisBaseService<TempTechnicalreportMapper, TempTechnicalreport> {
|
||||
@Autowired
|
||||
private TechnicalreportService technicalreportService;
|
||||
|
||||
public List<TempTechnicalreportVo> selectByStaffSid(String staffSid,String path) {
|
||||
return baseMapper.selectByStaffSid(staffSid,path);
|
||||
}
|
||||
public List<TempTechnicalreportVo> doingInfo(String staffSid,String path) {
|
||||
return baseMapper.doingInfo(staffSid,path);
|
||||
}
|
||||
public int updateState(Integer state, String sid) {
|
||||
return baseMapper.updateState(state, sid);
|
||||
}
|
||||
public int selectStateByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectStateByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public int selectCountByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectCountByStaffSid(staffSid);
|
||||
}
|
||||
public void copyToTemp(String staffInfoSid,int isDelete) {
|
||||
int num = baseMapper.selectCountByStaffSid(staffInfoSid);
|
||||
if(num==0) {
|
||||
List<Technicalreport> list = technicalreportService.listByStaffSid(staffInfoSid);
|
||||
if(list!=null&list.size()>0) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
TempTechnicalreport tempTechnicalreport=new TempTechnicalreport();
|
||||
BeanUtils.copyProperties(list.get(i),tempTechnicalreport);
|
||||
tempTechnicalreport.setIsDelete(isDelete);
|
||||
insert(tempTechnicalreport);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
baseMapper.deleteByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public Boolean compareFields(TempTechnicalreportDto tempTechnicalreportDto1,String sid) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
try{
|
||||
List<String> ignoreList = null;
|
||||
Map<String, List<Object>> map = new HashMap<String, List<Object>>();
|
||||
TempTechnicalreport tempTechnicalreport = fetchBySid(sid);
|
||||
TempTechnicalreportDto tempTechnicalreportDto=new TempTechnicalreportDto();
|
||||
tempTechnicalreportDto.fromEntity(tempTechnicalreport);
|
||||
Class clazz = tempTechnicalreportDto.getClass();
|
||||
// 获取object的属性描述
|
||||
PropertyDescriptor[] pds = Introspector.getBeanInfo(clazz,Object.class).getPropertyDescriptors();
|
||||
for (PropertyDescriptor pd : pds) {// 这里就是所有的属性了
|
||||
String name = pd.getName();// 属性名
|
||||
// if(ignoreList != null && ignoreList.contains(name)){// 如果当前属性选择忽略比较,跳到下一次循环
|
||||
// continue;
|
||||
// }
|
||||
Method readMethod = pd.getReadMethod();// get方法
|
||||
// 在obj1上调用get方法等同于获得obj1的属性值
|
||||
Object o1 = readMethod.invoke(tempTechnicalreportDto);
|
||||
// 在obj2上调用get方法等同于获得obj2的属性值
|
||||
Object o2 = readMethod.invoke(tempTechnicalreportDto1);
|
||||
if(o1 instanceof Timestamp){
|
||||
o1 = new Date(((Timestamp) o1).getTime());
|
||||
}
|
||||
if(o2 instanceof Timestamp){
|
||||
o2 = new Date(((Timestamp) o2).getTime());
|
||||
}
|
||||
if(o1 == null && o2 == null){
|
||||
continue;
|
||||
}else if(o1 == null && o2 != null){
|
||||
list.add(name);
|
||||
continue;
|
||||
}
|
||||
if (!o1.equals(o2)) {// 比较这两个值是否相等,不等就可以放入map了
|
||||
list.add(name);
|
||||
}
|
||||
}
|
||||
if(list.size()==0) {
|
||||
return false;//字段没有发生变化
|
||||
}else {
|
||||
return true;//字段发生变化
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,355 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.tempcertificate;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.jlzx.jlcyry.api.certItem.CertItem;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.Certificate;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditional;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecord;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecordDto;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecordVo;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertItem.TempCertItem;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertItem.TempCertItemVo;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertificate.TempCertificate;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertificate.TempCertificateApi;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertificate.TempCertificateDto;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertificate.TempCertificateVo;
|
||||
import com.yxt.jlzx.jlcyry.biz.certificate.CertificateService;
|
||||
import com.yxt.jlzx.jlcyry.biz.certitem.CertItemService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffadditional.StaffAdditionalService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffappendwait.StaffAppendWaitService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffbackrecord.StaffBackRecordService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffinfo.StaffInfoService;
|
||||
import com.yxt.jlzx.jlcyry.biz.tempcertitem.TempCertItemService;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonDto;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonQuery;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/3 9:49
|
||||
* @description 人员从业资格情况
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/tempCertificate")
|
||||
@Api(tags = "人员从业资格情况临时表")
|
||||
public class TempCertificateApiImpl implements TempCertificateApi {
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
private StaffBackRecordService staffBackRecordService;
|
||||
@Autowired
|
||||
private CertificateService certificateService;
|
||||
@Autowired
|
||||
private CertItemService certItemService;
|
||||
@Autowired
|
||||
private TempCertItemService tempCertItemService;
|
||||
@Autowired
|
||||
private TempCertificateService tempcertificateService;
|
||||
@Autowired
|
||||
private PhotoCommonApi photoCommonApi;
|
||||
@Autowired
|
||||
private DictCommonApi dictCommonApi;
|
||||
@Autowired
|
||||
private StaffAdditionalService staffAdditionalService;
|
||||
@Autowired
|
||||
private StaffAppendWaitService staffAppendWaitService;
|
||||
@Override
|
||||
public ResultBean<PagerVo<TempCertificate>> pagerList(PagerQuery pagerQuery) {
|
||||
ResultBean<PagerVo<TempCertificate>> rb = ResultBean.fireFail();
|
||||
PagerVo<TempCertificate> page = tempcertificateService.page(pagerQuery);
|
||||
return rb.success().setData(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 证书保存
|
||||
*
|
||||
* @param tempcertificateDto 证书dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(@Valid TempCertificateDto tempcertificateDto) {
|
||||
TempCertificate tempcertificate = tempcertificateDto.toEntity();
|
||||
if(StringUtils.isNoneBlank(tempcertificateDto.getCertUrl())) {
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
photoCommon.setFilePath(tempcertificateDto.getCertUrl());
|
||||
photoCommon.setType("certificatePhoto");
|
||||
photoCommon.setLinkSid(tempcertificate.getSid());
|
||||
photoCommonApi.save(photoCommon);
|
||||
}
|
||||
|
||||
boolean isSave = tempcertificateService.save(tempcertificate);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(tempcertificate.getStaffSid());
|
||||
int count=tempcertificateService.selectCountByStaffSid(tempcertificate.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setCertificateNum(count);
|
||||
staffAdditional.setCertificateState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional=new StaffAdditional();
|
||||
staffAdditional.setCertificateNum(count);
|
||||
staffAdditional.setCertificateState(1);
|
||||
staffAdditional.setStaffSid(tempcertificate.getStaffSid());
|
||||
staffAdditionalService.save(staffAdditional);
|
||||
}
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 证书修改(@PathVariable是spring3.0的一个新功能:接收请求路径中占位符的值.
|
||||
* 通过 @PathVariable 可以将URL中占位符参数{xxx}绑定到处理器类的方法形参中@PathVariable(“xxx“) )
|
||||
*
|
||||
* @param tempcertificateDto 证书dto对象
|
||||
* @param sid 证书sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean update(@Valid TempCertificateDto tempcertificateDto, String sid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
if(tempcertificateDto.getCertUrl().indexOf(path)>-1) {
|
||||
tempcertificateDto.setCertUrl(tempcertificateDto.getCertUrl().replace(path, ""));
|
||||
}
|
||||
if(tempcertificateService.compareFields(tempcertificateDto, sid)) {//判断是否修改字段
|
||||
//先查询证书是否存在
|
||||
staffBackRecordService.deleteByItemSid(sid);//审核通过删除退回记录表数据
|
||||
TempCertificate tempcertificate = tempcertificateService.fetchBySid(sid);
|
||||
if (tempcertificate == null) {
|
||||
return ResultBean.fireFail().setMsg("人员从业资格情况不存在");
|
||||
}
|
||||
tempcertificate.setState(1);//修改后状态改为未审核
|
||||
int i = tempcertificateService.updateBySid(tempcertificateDto.toMap(tempcertificate), sid);
|
||||
if (i <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(tempcertificate.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setCertificateState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("certificatePhoto");
|
||||
//List<PhotoCommonVo> listVo1=photoCommonApi.queryBylinkSidAndType(q);
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
PhotoCommonDto photoCommon=new PhotoCommonDto();
|
||||
photoCommon.setFilePath(tempcertificateDto.getCertUrl());
|
||||
photoCommon.setType("certificatePhoto");
|
||||
photoCommon.setLinkSid(sid);
|
||||
photoCommonApi.save(photoCommon);
|
||||
}
|
||||
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 证书删除
|
||||
*
|
||||
* @param sid 证书sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid) {
|
||||
//查询证书是否存在
|
||||
TempCertificate tempcertificate = tempcertificateService.fetchBySid(sid);
|
||||
if (tempcertificate == null) {
|
||||
return ResultBean.fireFail().setMsg("人员从业资格情况不存在");
|
||||
}
|
||||
int i = tempcertificateService.deleteBySid(sid);//临时表删除同时删除正式表
|
||||
certificateService.deleteBySid(sid);
|
||||
staffBackRecordService.deleteByItemSid(sid);//删除当前数据同时删除退回记录表数据
|
||||
tempCertItemService.deleteByCertSid(sid);
|
||||
tempCertItemService.deleteByCertSid(sid);
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
int count=tempcertificateService.selectCountByStaffSid(tempcertificate.getStaffSid());
|
||||
int num=tempcertificateService.selectStateByStaffSid(tempcertificate.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(tempcertificate.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
staffAdditional.setCertificateNum(count);
|
||||
if(num==0) {
|
||||
staffAdditional.setCertificateState(2);//已审核
|
||||
}else {
|
||||
staffAdditional.setCertificateState(1);//未审核
|
||||
}
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
PhotoCommonQuery q1=new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("certificatePhoto");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<TempCertificateVo>> selectByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
List<TempCertificateVo> page = tempcertificateService.selectByStaffSid(staffSid, path);
|
||||
for(int i=0;page.size()>i;i++) {
|
||||
StaffBackRecordVo selectByItemSidMax = staffBackRecordService.selectByItemSidMax( page.get(i).getSid());
|
||||
if(selectByItemSidMax!=null) {
|
||||
page.get(i).setStaffBackRecordVo(selectByItemSidMax);
|
||||
}
|
||||
}
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public ResultBean infoUpdate(Integer state, String sid) {
|
||||
// List<TempCertItem> listCertItem = tempCertItemService.listByCertSid(sid);
|
||||
// for (TempCertItem tempCertItem : listCertItem) {
|
||||
// if(tempCertItem.getState()==1) {
|
||||
// return ResultBean.fireSuccess().setMsg("请先审核证书项目信息");
|
||||
// }
|
||||
// }
|
||||
|
||||
if (state!=null) {
|
||||
//通过
|
||||
int i = tempcertificateService.updateState(state, sid);
|
||||
TempCertificate tempcertificate=tempcertificateService.fetchBySid(sid);
|
||||
if(tempcertificate!=null) {
|
||||
int num=tempcertificateService.selectStateByStaffSid(tempcertificate.getStaffSid());
|
||||
Certificate certificate = certificateService.fetchBySid(sid);
|
||||
if(certificate==null) {
|
||||
certificate=new Certificate();
|
||||
}
|
||||
BeanUtils.copyProperties(tempcertificate,certificate);
|
||||
certificateService.deleteBySid(sid);
|
||||
certificateService.insert(certificate);//审核通过更新正式表数据
|
||||
staffBackRecordService.deleteByItemSid(sid);//审核通过删除退回记录表数据
|
||||
//tempcertificateService.deleteBySid(sid);
|
||||
List<TempCertItemVo> lists = tempCertItemService.selectByCertSid(sid);
|
||||
for(int j=0;lists.size()>j;j++) {
|
||||
certItemService.deleteBySid(lists.get(j).getSid());
|
||||
CertItem certItem=new CertItem();
|
||||
BeanUtils.copyProperties(lists.get(j),certItem);
|
||||
certItemService.insert(certItem);
|
||||
}
|
||||
|
||||
int k=staffAppendWaitService.tzOrBack(tempcertificate.getStaffSid(), sid);//判断是够是审核最后一条,若果是做下一步操作
|
||||
if(k==0) {
|
||||
List<TempCertificateVo> list = tempcertificateService.selectByStaffSid(certificate.getStaffSid());
|
||||
if(list!=null) {
|
||||
tempcertificateService.deleteByStaffSid(certificate.getStaffSid());
|
||||
for (int j = 0; j < list.size(); j++) {
|
||||
tempCertItemService.deleteBySid(list.get(j).getSid());
|
||||
}
|
||||
}
|
||||
}
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(tempcertificate.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
if(num==0) {
|
||||
staffAdditional.setCertificateState(2);//已审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional.setCertificateState(1);//未审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("人员从业资格情况审核通过");
|
||||
}
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("人员从业资格情况审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean infoUpdateBack(StaffBackRecordDto staffBackRecordDto) {
|
||||
String sid=staffBackRecordDto.getItemSid();
|
||||
// List<TempCertItem> listCertItem = tempCertItemService.listByCertSid(sid);
|
||||
// for (TempCertItem tempCertItem : listCertItem) {
|
||||
// if(tempCertItem.getState()==1) {
|
||||
// return ResultBean.fireSuccess().setMsg("请先审核证书项目信息");
|
||||
// }
|
||||
// }
|
||||
|
||||
TempCertificate tempcertificate=tempcertificateService.fetchBySid(sid);
|
||||
//通过
|
||||
int i = tempcertificateService.updateState(3, sid);
|
||||
StaffBackRecord entity = staffBackRecordDto.toEntity();
|
||||
entity.setBackDate(new Date());
|
||||
staffBackRecordService.save(entity);
|
||||
|
||||
staffAppendWaitService.tzOrBack(tempcertificate.getStaffSid(), sid);//判断是够是审核最后一条,若果是做下一步操作
|
||||
|
||||
if(tempcertificate!=null) {
|
||||
int num=tempcertificateService.selectStateByStaffSid(tempcertificate.getStaffSid());
|
||||
StaffAdditional staffAdditional=staffAdditionalService.selectByStaffSid(tempcertificate.getStaffSid());
|
||||
if(staffAdditional!=null) {
|
||||
if(num==0) {
|
||||
staffAdditional.setCertificateState(2);//已审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}else {
|
||||
staffAdditional.setCertificateState(1);//未审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("人员从业资格情况审核未通过");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<TempCertificateVo> getVo(String sid) {
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
ResultBean<TempCertificateVo> resultBean=ResultBean.fireFail();
|
||||
TempCertificate tempcertificate=tempcertificateService.fetchBySid(sid);
|
||||
TempCertificateVo vo=new TempCertificateVo();
|
||||
vo.fromEntity(tempcertificate);
|
||||
vo.setCertUrl(path+vo.getCertUrl());
|
||||
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<Map<String, Object>> dictSelect() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
ResultBean<Map<String, Object>> dictCommonInitVoResultBean = dictCommonApi.dictCommonCertificate();
|
||||
map.put("dictCommonList", dictCommonInitVoResultBean.getData());
|
||||
return new ResultBean().success().setData(map);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<List<TempCertificateVo>> doingInfo(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
String path=fileUploadComponent.getUrlPrefix();
|
||||
List<TempCertificateVo> page = tempcertificateService.doingInfo(staffSid, path);
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.tempcertificate;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertificate.TempCertificate;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertificate.TempCertificateVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/24 8:43
|
||||
* @description
|
||||
*/
|
||||
@Mapper
|
||||
public interface TempCertificateMapper extends BaseMapper<TempCertificate> {
|
||||
|
||||
public List<TempCertificateVo> selectByStaffSid(@Param("staffSid") String staffSid,@Param("path") String path);
|
||||
|
||||
int updateState(@Param("state") Integer state, @Param("sid") String sid);
|
||||
|
||||
public int selectStateByStaffSid(@Param("staffSid") String staffSid);
|
||||
|
||||
public int selectCountByStaffSid(String staffSid);
|
||||
|
||||
public List<TempCertificateVo> selectByStaffSid(String staffSid);
|
||||
|
||||
public void deleteByStaffSid(String staffSid);
|
||||
|
||||
public List<TempCertificateVo> doingInfo(@Param("staffSid") String staffSid,@Param("path") String path);
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.tempcertificate.TempCertificateMapper">
|
||||
|
||||
|
||||
<select id="selectByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.tempcertificate.TempCertificateVo">
|
||||
SELECT t.issueOrg,
|
||||
t.certNo,
|
||||
t.approvalDate,
|
||||
t.dateStart,
|
||||
t.dateEnd,
|
||||
t.staffSid,
|
||||
(SELECT dictValue
|
||||
FROM jlzx_system.dict_common
|
||||
WHERE dictKey = t.certType AND dictType = 'zslb') certType,
|
||||
(SELECT dictValue
|
||||
FROM jlzx_system.dict_common
|
||||
WHERE dictKey = t.certType AND dictType = 'cszy') jlzymc,sxzymc,
|
||||
(SELECT dictValue
|
||||
FROM jlzx_system.dict_common
|
||||
WHERE dictKey = t.certLevel AND dictType = 'zcjlszg') certLevel,
|
||||
t.others,
|
||||
concat(#{path}, t.`certUrl`) AS certUrl,
|
||||
(SELECT COUNT(id) FROM temp_certitem WHERE certSid = t.sid) subject,
|
||||
t.sid,
|
||||
t.state
|
||||
FROM temp_certificate t
|
||||
WHERE t.staffSid = #{staffSid}
|
||||
ORDER BY certificateDate DESC
|
||||
</select>
|
||||
<update id="updateState">
|
||||
UPDATE temp_certificate
|
||||
SET state =#{state}
|
||||
WHERE sid = #{sid}
|
||||
</update>
|
||||
<select id="selectStateByStaffSid" resultType="java.lang.Integer">
|
||||
SELECT count(id)
|
||||
FROM temp_certificate
|
||||
WHERE state = 1
|
||||
AND staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
<select id="selectCountByStaffSid" resultType="java.lang.Integer">
|
||||
SELECT count(id)
|
||||
FROM temp_certificate
|
||||
WHERE staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
<select id="selectByStaffSid" resultType="com.yxt.jlzx.jlcyry.api.tempcertificate.TempCertificateVo">
|
||||
SELECT *
|
||||
FROM temp_certificate
|
||||
WHERE staffSid = #{staffSid}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByStaffSid">
|
||||
delete from temp_certificate where staffSid = #{staffSid}
|
||||
</delete>
|
||||
|
||||
<select id="doingInfo" resultType="com.yxt.jlzx.jlcyry.api.tempcertificate.TempCertificateVo">
|
||||
SELECT t.issueOrg,
|
||||
t.certNo,
|
||||
t.approvalDate,
|
||||
t.dateStart,
|
||||
t.dateEnd,
|
||||
t.staffSid,
|
||||
(SELECT dictValue
|
||||
FROM jlzx_system.dict_common
|
||||
WHERE dictKey = t.certType AND dictType = 'zslb') certType,
|
||||
(SELECT dictValue
|
||||
FROM jlzx_system.dict_common
|
||||
WHERE dictKey = t.certLevel AND dictType = 'zcjlszg') certLevel,
|
||||
t.others,
|
||||
concat(#{path}, t.`certUrl`) AS certUrl,
|
||||
(SELECT COUNT(id) FROM temp_certitem WHERE certSid = t.sid) subject,
|
||||
t.sid,
|
||||
t.state
|
||||
FROM temp_certificate t
|
||||
WHERE t.staffSid = #{staffSid} and state=1
|
||||
ORDER BY certificateDate DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,167 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.tempcertificate;
|
||||
|
||||
import java.beans.Introspector;
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.lang.reflect.Method;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.core.domain.BaseEntity;
|
||||
import com.yxt.jlzx.jlcyry.api.certItem.CertItem;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.Certificate;
|
||||
import com.yxt.jlzx.jlcyry.api.staffinfo.StaffInfo;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertItem.TempCertItem;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertificate.TempCertificate;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertificate.TempCertificateDto;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertificate.TempCertificateVo;
|
||||
import com.yxt.jlzx.jlcyry.api.tempstaffinfo.TempStaffInfo;
|
||||
import com.yxt.jlzx.jlcyry.api.tempstaffinfo.TempStaffInfoState;
|
||||
import com.yxt.jlzx.jlcyry.biz.certificate.CertificateService;
|
||||
import com.yxt.jlzx.jlcyry.biz.certitem.CertItemService;
|
||||
import com.yxt.jlzx.jlcyry.biz.tempcertitem.TempCertItemService;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/3 9:51
|
||||
* @description
|
||||
*/
|
||||
@Service
|
||||
public class TempCertificateService extends MybatisBaseService<TempCertificateMapper, TempCertificate> {
|
||||
|
||||
@Autowired
|
||||
private CertificateService certificateService;
|
||||
@Autowired
|
||||
private CertItemService certItemService;
|
||||
@Autowired
|
||||
private TempCertItemService tempCertItemService;
|
||||
public List<TempCertificateVo> selectByStaffSid(String staffSid,String path) {
|
||||
return baseMapper.selectByStaffSid(staffSid,path);
|
||||
}
|
||||
|
||||
public int updateState(Integer state, String sid) {
|
||||
return baseMapper.updateState(state, sid);
|
||||
}
|
||||
|
||||
public int selectStateByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectStateByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public int selectCountByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectCountByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
public void copyToTemp(String staffInfoSid,int isDelete) {//正式表复制到临时表
|
||||
int num = baseMapper.selectCountByStaffSid(staffInfoSid);
|
||||
if(num==0) {
|
||||
List<Certificate> list = certificateService.listByStaffSid(staffInfoSid);
|
||||
if(list!=null&list.size()>0) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
TempCertificate tempCertificate=new TempCertificate();
|
||||
BeanUtils.copyProperties(list.get(i),tempCertificate);
|
||||
tempCertificate.setIsDelete(isDelete);
|
||||
insert(tempCertificate);
|
||||
|
||||
List<TempCertItem> listss = tempCertItemService.listByCertSid(list.get(i).getSid());
|
||||
if(listss.size()==0) {
|
||||
List<CertItem> list1 = certItemService.listByCertSid(list.get(i).getSid());
|
||||
if(list1!=null&list1.size()>0) {
|
||||
for (int j = 0; j < list1.size(); j++) {
|
||||
TempCertItem tempCertItem=new TempCertItem();
|
||||
BeanUtils.copyProperties(list1.get(i),tempCertItem);
|
||||
tempCertItem.setIsDelete(isDelete);
|
||||
tempCertItemService.insert(tempCertItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void deleteByStaffSid(String staffSid) {
|
||||
baseMapper.deleteByStaffSid(staffSid);
|
||||
List<TempCertificateVo> list=selectByStaffSid(staffSid);
|
||||
for (TempCertificateVo tempCertificateVo : list) {
|
||||
tempCertItemService.deleteByCertSid(tempCertificateVo.getSid());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<TempCertificateVo> selectByStaffSid(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectByStaffSid(staffSid);
|
||||
}
|
||||
|
||||
|
||||
public Boolean compareFields(TempCertificateDto tempcertificateDto1,String sid) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
try{
|
||||
List<String> ignoreList = null;
|
||||
Map<String, List<Object>> map = new HashMap<String, List<Object>>();
|
||||
TempCertificate tempCertificate = fetchBySid(sid);
|
||||
TempCertificateDto tempcertificateDto=new TempCertificateDto();
|
||||
tempcertificateDto.fromEntity(tempCertificate);
|
||||
Class clazz = tempcertificateDto.getClass();
|
||||
// 获取object的属性描述
|
||||
PropertyDescriptor[] pds = Introspector.getBeanInfo(clazz,Object.class).getPropertyDescriptors();
|
||||
for (PropertyDescriptor pd : pds) {// 这里就是所有的属性了
|
||||
String name = pd.getName();// 属性名
|
||||
// if(ignoreList != null && ignoreList.contains(name)){// 如果当前属性选择忽略比较,跳到下一次循环
|
||||
// continue;
|
||||
// }
|
||||
Method readMethod = pd.getReadMethod();// get方法
|
||||
// 在obj1上调用get方法等同于获得obj1的属性值
|
||||
Object o1 = readMethod.invoke(tempcertificateDto);
|
||||
// 在obj2上调用get方法等同于获得obj2的属性值
|
||||
Object o2 = readMethod.invoke(tempcertificateDto1);
|
||||
if(o1 instanceof Timestamp){
|
||||
o1 = new Date(((Timestamp) o1).getTime());
|
||||
}
|
||||
if(o2 instanceof Timestamp){
|
||||
o2 = new Date(((Timestamp) o2).getTime());
|
||||
}
|
||||
if(o1 == null && o2 == null){
|
||||
continue;
|
||||
}else if(o1 == null && o2 != null){
|
||||
list.add(name);
|
||||
continue;
|
||||
}
|
||||
if (!o1.equals(o2)) {// 比较这两个值是否相等,不等就可以放入map了
|
||||
list.add(name);
|
||||
}
|
||||
}
|
||||
if(list.size()==0) {
|
||||
return false;//字段没有发生变化
|
||||
}else {
|
||||
return true;//字段发生变化
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public List<TempCertificateVo> doingInfo(String staffSid, String path) {
|
||||
return baseMapper.doingInfo(staffSid,path);
|
||||
}
|
||||
|
||||
public void updateTemp(String staffInfoSid) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,229 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.tempcertitem;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.jlzx.jlcyry.api.certItem.CertItem;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecord;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecordDto;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecordVo;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertItem.TempCertItem;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertItem.TempCertItemApi;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertItem.TempCertItemDto;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertItem.TempCertItemVo;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertificate.TempCertificate;
|
||||
import com.yxt.jlzx.jlcyry.biz.certitem.CertItemService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffadditional.StaffAdditionalService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffappendwait.StaffAppendWaitService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffbackrecord.StaffBackRecordService;
|
||||
import com.yxt.jlzx.jlcyry.biz.tempcertificate.TempCertificateService;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 9:27
|
||||
* @description 专业项目
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/tempCertItem")
|
||||
@Api(tags = "专业项目临时表")
|
||||
public class TempCertItemApiImpl implements TempCertItemApi {
|
||||
|
||||
@Autowired
|
||||
private TempCertItemService tempcertItemService;
|
||||
@Autowired
|
||||
private CertItemService certItemService;
|
||||
@Autowired
|
||||
private StaffBackRecordService staffBackRecordService;
|
||||
@Autowired
|
||||
private StaffAdditionalService staffAdditionalService;
|
||||
@Autowired
|
||||
private StaffAppendWaitService staffAppendWaitService;
|
||||
@Autowired
|
||||
private TempCertificateService tempCertificateService;
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<PagerVo<TempCertItem>> pagerList(PagerQuery pagerQuery) {
|
||||
ResultBean<PagerVo<TempCertItem>> rb = ResultBean.fireFail();
|
||||
PagerVo<TempCertItem> page = tempcertItemService.page(pagerQuery);
|
||||
return rb.success().setData(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 专业项目保存
|
||||
*
|
||||
* @param tempcertItemDto 专业项目dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(@Valid TempCertItemDto tempcertItemDto) {
|
||||
TempCertItem tempcertItem = tempcertItemDto.toEntity();
|
||||
tempcertItem.setState(1);
|
||||
boolean isSave = tempcertItemService.save(tempcertItem);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
String certSid=tempcertItem.getCertSid();
|
||||
if(StringUtils.isNotBlank(certSid)) {
|
||||
TempCertificate certificate = tempCertificateService.fetchBySid(certSid);
|
||||
certificate.setState(1);
|
||||
tempCertificateService.updateById(certificate);
|
||||
staffBackRecordService.deleteByItemSid(tempcertItem.getCertSid());//审核通过删除退回记录表数据
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 专业项目修改(@PathVariable是spring3.0的一个新功能:接收请求路径中占位符的值.
|
||||
* 通过 @PathVariable 可以将URL中占位符参数{xxx}绑定到处理器类的方法形参中@PathVariable(“xxx“) )
|
||||
*
|
||||
* @param tempcertItemDto 专业项目dto对象
|
||||
* @param sid 专业项目sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean update(@Valid TempCertItemDto tempcertItemDto, String sid) {
|
||||
if(tempcertItemService.compareFields(tempcertItemDto, sid)) {
|
||||
//根据sid查询专业项目是否存在
|
||||
TempCertItem tempcertItem = tempcertItemService.fetchBySid(sid);
|
||||
if (tempcertItem == null) {
|
||||
return ResultBean.fireFail().setMsg("该专业项目不存在");
|
||||
}
|
||||
tempcertItem.setState(1);
|
||||
int i = tempcertItemService.updateBySid(tempcertItemDto.toMap(tempcertItem), sid);
|
||||
if (i <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
String certSid=tempcertItem.getCertSid();
|
||||
if(StringUtils.isNotBlank(certSid)) {
|
||||
TempCertificate certificate = tempCertificateService.fetchBySid(certSid);
|
||||
certificate.setState(1);
|
||||
tempCertificateService.updateById(certificate);
|
||||
staffBackRecordService.deleteByItemSid(tempcertItem.getCertSid());//审核通过删除退回记录表数据
|
||||
}
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 专业项目删除
|
||||
*
|
||||
* @param sid 专业项目sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid) {
|
||||
//根据sid查询专业项目是否存在
|
||||
TempCertItem tempcertItem = tempcertItemService.fetchBySid(sid);
|
||||
if (tempcertItem == null) {
|
||||
return ResultBean.fireFail().setMsg("该专业项目不存在");
|
||||
}
|
||||
int i = tempcertItemService.deleteBySid(sid);
|
||||
certItemService.deleteBySid(sid);
|
||||
if(StringUtils.isNotBlank(tempcertItem.getCertSid())) {
|
||||
// TempCertificate certificate = tempCertificateService.fetchBySid(tempcertItem.getCertSid());
|
||||
// certificate.setState(1);
|
||||
// tempCertificateService.updateById(certificate);
|
||||
staffBackRecordService.deleteByItemSid(tempcertItem.getCertSid());//审核通过删除退回记录表数据
|
||||
}
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
|
||||
//该方法暂时不用
|
||||
@Override
|
||||
public ResultBean infoUpdate(Integer state, String sid){
|
||||
if (state!=null) {
|
||||
//通过
|
||||
int i = tempcertItemService.updateState(state, sid);
|
||||
CertItem certItem = certItemService.fetchBySid(sid);
|
||||
TempCertItem tempCertItem = tempcertItemService.fetchBySid(sid);
|
||||
if(certItem==null) {
|
||||
certItem=new CertItem();
|
||||
}
|
||||
BeanUtils.copyProperties(tempCertItem,certItem);
|
||||
certItemService.deleteBySid(sid);certItemService.insert(certItem);//审核通过更新正式表数据
|
||||
staffBackRecordService.deleteByItemSid(sid);//审核通过删除退回记录表数据
|
||||
staffAppendWaitService.deleteByAppendSid(sid);//由于是字表审核,肯定不是最后一条审核
|
||||
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
}else {
|
||||
|
||||
if(state==2) {
|
||||
return ResultBean.fireSuccess().setMsg("审核通过");
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("审核未通过");
|
||||
}
|
||||
|
||||
}
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("证书项目信息审核失败");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//该方法暂时不用
|
||||
@Override
|
||||
public ResultBean infoUpdateBack(StaffBackRecordDto staffBackRecordDto) {
|
||||
String sid=staffBackRecordDto.getItemSid();
|
||||
|
||||
staffAppendWaitService.deleteByAppendSid(sid);//由于是子表审核,肯定不是最后一条审核
|
||||
|
||||
StaffBackRecord entity = staffBackRecordDto.toEntity();
|
||||
entity.setBackDate(new Date());
|
||||
staffBackRecordService.save(entity);
|
||||
//通过
|
||||
int i = tempcertItemService.updateState(3, sid);
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
}else {
|
||||
return ResultBean.fireSuccess().setMsg("审核未通过");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultBean<TempCertItemVo> getVo(String sid) {
|
||||
ResultBean<TempCertItemVo> resultBean=ResultBean.fireFail();
|
||||
TempCertItem TempCertItem=tempcertItemService.fetchBySid(sid);
|
||||
TempCertItemVo vo=new TempCertItemVo();
|
||||
vo.fromEntity(TempCertItem);
|
||||
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<TempCertItemVo>> selectByCertSid(String certSid) {
|
||||
// TODO Auto-generated method stub
|
||||
List<TempCertItemVo> page = tempcertItemService.selectByCertSid(certSid);
|
||||
for(int i=0;page.size()>i;i++) {
|
||||
StaffBackRecordVo selectByItemSidMax = staffBackRecordService.selectByItemSidMax( page.get(i).getSid());
|
||||
if(selectByItemSidMax!=null) {
|
||||
page.get(i).setStaffBackRecordVo(selectByItemSidMax);
|
||||
}
|
||||
}
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<TempCertItemVo>> doingInfo(String certSid) {
|
||||
List<TempCertItemVo> page = tempcertItemService.doingInfo(certSid);
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.tempcertitem;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertItem.TempCertItem;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertItem.TempCertItemVo;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 9:27
|
||||
* @description 专业项目
|
||||
*/
|
||||
@Mapper
|
||||
public interface TempCertItemMapper extends BaseMapper<TempCertItem> {
|
||||
|
||||
int updateState(@Param("state") Integer state, @Param("sid") String sid);
|
||||
|
||||
List<TempCertItemVo> selectByCertSid(String certSid);
|
||||
|
||||
List<TempCertItem> listByCertSid(String certSid);
|
||||
|
||||
void deleteByCertSid(String certSid);
|
||||
|
||||
List<TempCertItemVo> doingInfo(String certSid);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.jlzx.jlcyry.biz.tempcertitem.TempCertItemMapper">
|
||||
<select id="selectByCertSid" resultType="com.yxt.jlzx.jlcyry.api.tempcertItem.TempCertItemVo">
|
||||
select subject,
|
||||
item,
|
||||
subItem,
|
||||
state,
|
||||
basis,
|
||||
certSid,
|
||||
sid
|
||||
from temp_certitem
|
||||
where certSid = #{certSid}
|
||||
</select>
|
||||
<update id="updateState">
|
||||
UPDATE temp_certitem
|
||||
SET state =#{state}
|
||||
WHERE sid = #{sid}
|
||||
</update>
|
||||
|
||||
<select id="listByCertSid" resultType="com.yxt.jlzx.jlcyry.api.tempcertItem.TempCertItem">
|
||||
select *
|
||||
from temp_certitem
|
||||
where certSid = #{certSid}
|
||||
</select>
|
||||
|
||||
<delete id="deleteByCertSid">
|
||||
DELETE from temp_certitem where certSid = #{certSid}
|
||||
</delete>
|
||||
|
||||
<select id="doingInfo" resultType="com.yxt.jlzx.jlcyry.api.tempcertItem.TempCertItemVo">
|
||||
select subject,
|
||||
item,
|
||||
subItem,
|
||||
state,
|
||||
basis,
|
||||
certSid,
|
||||
sid
|
||||
from temp_certitem
|
||||
where certSid = #{certSid} and state=1
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.tempcertitem;
|
||||
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.jlzx.jlcyry.api.certItem.CertItem;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertItem.TempCertItem;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertItem.TempCertItemDto;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertItem.TempCertItemVo;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertificate.TempCertificate;
|
||||
import com.yxt.jlzx.jlcyry.api.tempcertificate.TempCertificateDto;
|
||||
|
||||
import java.beans.Introspector;
|
||||
import java.beans.PropertyDescriptor;
|
||||
import java.lang.reflect.Method;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/4 9:27
|
||||
* @description 专业项目
|
||||
*/
|
||||
@Service
|
||||
public class TempCertItemService extends MybatisBaseService<TempCertItemMapper, TempCertItem> {
|
||||
|
||||
|
||||
|
||||
public int updateState(Integer state, String sid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.updateState(state, sid);
|
||||
}
|
||||
|
||||
|
||||
public List<TempCertItemVo> selectByCertSid(String certSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.selectByCertSid(certSid);
|
||||
}
|
||||
|
||||
public List<TempCertItem> listByCertSid(String certSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.listByCertSid(certSid);
|
||||
}
|
||||
|
||||
|
||||
public void deleteByCertSid(String certSid) {
|
||||
// TODO Auto-generated method stub
|
||||
baseMapper.deleteByCertSid(certSid);
|
||||
}
|
||||
|
||||
public Boolean compareFields(TempCertItemDto tempcertItemDto1,String sid) {
|
||||
List<String> list = new ArrayList<String>();
|
||||
try{
|
||||
List<String> ignoreList = null;
|
||||
Map<String, List<Object>> map = new HashMap<String, List<Object>>();
|
||||
TempCertItem tempCertItem = fetchBySid(sid);
|
||||
TempCertItemDto tempCertItemDto=new TempCertItemDto();
|
||||
tempCertItemDto.fromEntity(tempCertItem);
|
||||
Class clazz = tempCertItemDto.getClass();
|
||||
// 获取object的属性描述
|
||||
PropertyDescriptor[] pds = Introspector.getBeanInfo(clazz,Object.class).getPropertyDescriptors();
|
||||
for (PropertyDescriptor pd : pds) {// 这里就是所有的属性了
|
||||
String name = pd.getName();// 属性名
|
||||
// if(ignoreList != null && ignoreList.contains(name)){// 如果当前属性选择忽略比较,跳到下一次循环
|
||||
// continue;
|
||||
// }
|
||||
Method readMethod = pd.getReadMethod();// get方法
|
||||
// 在obj1上调用get方法等同于获得obj1的属性值
|
||||
Object o1 = readMethod.invoke(tempCertItemDto);
|
||||
// 在obj2上调用get方法等同于获得obj2的属性值
|
||||
Object o2 = readMethod.invoke(tempcertItemDto1);
|
||||
if(o1 instanceof Timestamp){
|
||||
o1 = new Date(((Timestamp) o1).getTime());
|
||||
}
|
||||
if(o2 instanceof Timestamp){
|
||||
o2 = new Date(((Timestamp) o2).getTime());
|
||||
}
|
||||
if(o1 == null && o2 == null){
|
||||
continue;
|
||||
}else if(o1 == null && o2 != null){
|
||||
list.add(name);
|
||||
continue;
|
||||
}
|
||||
if (!o1.equals(o2)) {// 比较这两个值是否相等,不等就可以放入map了
|
||||
list.add(name);
|
||||
}
|
||||
}
|
||||
if(list.size()==0) {
|
||||
return false;//字段没有发生变化
|
||||
}else {
|
||||
return true;//字段发生变化
|
||||
}
|
||||
}catch(Exception e){
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public List<TempCertItemVo> doingInfo(String certSid) {
|
||||
// TODO Auto-generated method stub
|
||||
return baseMapper.doingInfo(certSid);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,404 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.tempeducation;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonDto;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonVo;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import com.yxt.common.base.config.component.FileUploadComponent;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.jlzx.jlcyry.api.certificate.Certificate;
|
||||
import com.yxt.jlzx.jlcyry.api.education.Education;
|
||||
import com.yxt.jlzx.jlcyry.api.staffadditional.StaffAdditional;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecord;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecordDto;
|
||||
import com.yxt.jlzx.jlcyry.api.staffbackrecord.StaffBackRecordVo;
|
||||
import com.yxt.jlzx.jlcyry.api.tempeducation.TempEducation;
|
||||
import com.yxt.jlzx.jlcyry.api.tempeducation.TempEducationApi;
|
||||
import com.yxt.jlzx.jlcyry.api.tempeducation.TempEducationDto;
|
||||
import com.yxt.jlzx.jlcyry.api.tempeducation.TempEducationVo;
|
||||
import com.yxt.jlzx.jlcyry.biz.datadictionary.DictCommonService;
|
||||
import com.yxt.jlzx.jlcyry.biz.education.EducationService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffadditional.StaffAdditionalService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffappendwait.StaffAppendWaitService;
|
||||
import com.yxt.jlzx.jlcyry.biz.staffbackrecord.StaffBackRecordService;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonApi;
|
||||
import com.yxt.jlzx.system.api.dictcommon.DictCommonListVo;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonApi;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonDto;
|
||||
import com.yxt.jlzx.system.api.photocommon.PhotoCommonQuery;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/8/31 8:45
|
||||
* @description 教育经历
|
||||
*/
|
||||
@Controller
|
||||
@RequestMapping("/tempEducation")
|
||||
@Api(tags = "教育经历临时表")
|
||||
public class TempEducationApiImpl implements TempEducationApi {
|
||||
|
||||
@Autowired
|
||||
private TempEducationService tempeducationService;
|
||||
@Autowired
|
||||
private EducationService educationService;
|
||||
@Autowired
|
||||
private DictCommonService dictCommonService;
|
||||
@Autowired
|
||||
private PhotoCommonApi photoCommonApi;
|
||||
@Autowired
|
||||
private DictCommonApi dictCommonApi;
|
||||
@Autowired
|
||||
private FileUploadComponent fileUploadComponent;
|
||||
@Autowired
|
||||
private StaffAdditionalService staffAdditionalService;
|
||||
@Autowired
|
||||
private StaffBackRecordService staffBackRecordService;
|
||||
@Autowired
|
||||
private StaffAppendWaitService staffAppendWaitService;
|
||||
|
||||
/**
|
||||
* 分页列表
|
||||
*
|
||||
* @param pagerQuery
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<PagerVo<TempEducation>> pagerList(PagerQuery pagerQuery) {
|
||||
ResultBean<PagerVo<TempEducation>> rb = ResultBean.fireFail();
|
||||
PagerVo<TempEducation> page = tempeducationService.page(pagerQuery);
|
||||
return rb.success().setData(page);
|
||||
}
|
||||
|
||||
/**
|
||||
* 教育经历保存
|
||||
*
|
||||
* @param tempeducationDto 教育经历Dto对象
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean save(@Valid TempEducationDto tempeducationDto) {
|
||||
String speciality = tempeducationDto.getSpeciality();
|
||||
ResultBean<DictCommonVo> dictCommonVoResultBean = dictCommonApi.selectBykey(speciality, "bkzy");
|
||||
DictCommonVo data = dictCommonVoResultBean.getData();
|
||||
if (StringUtils.isBlank(data.getDictKey())) {
|
||||
DictCommonDto dataDto = new DictCommonDto();
|
||||
dataDto.setDictKey(UUID.randomUUID().toString());
|
||||
dataDto.setDictType("bkzy");
|
||||
dataDto.setDictValue(speciality);
|
||||
dictCommonApi.save(dataDto);
|
||||
tempeducationDto.setSpeciality(dataDto.getDictKey());
|
||||
}
|
||||
TempEducation tempeducation = tempeducationDto.toEntity();
|
||||
|
||||
if (StringUtils.isNoneBlank(tempeducationDto.getDiploma())) {
|
||||
PhotoCommonDto photoCommon = new PhotoCommonDto();
|
||||
photoCommon.setFilePath(tempeducationDto.getDiploma());
|
||||
photoCommon.setType("diplomaPhoto");
|
||||
photoCommon.setLinkSid(tempeducation.getSid());
|
||||
ResultBean resultBean = photoCommonApi.save(photoCommon);
|
||||
}
|
||||
|
||||
if (StringUtils.isNoneBlank(tempeducationDto.getDegreeCert())) {
|
||||
PhotoCommonDto photoCommon1 = new PhotoCommonDto();
|
||||
photoCommon1.setFilePath(tempeducationDto.getDegreeCert());
|
||||
photoCommon1.setType("degreeCertPhoto");
|
||||
photoCommon1.setLinkSid(tempeducation.getSid());
|
||||
ResultBean resultBean1 = photoCommonApi.save(photoCommon1);
|
||||
}
|
||||
|
||||
if (StringUtils.isBlank(tempeducation.getIssueDate())) {
|
||||
tempeducation.setIssueDate(null);
|
||||
}
|
||||
boolean isSave = tempeducationService.save(tempeducation);
|
||||
if (!isSave) {
|
||||
return ResultBean.fireFail().setMsg("保存失败");
|
||||
}
|
||||
|
||||
int count = tempeducationService.selectCountByStaffSid(tempeducation.getStaffSid());
|
||||
StaffAdditional staffAdditional = staffAdditionalService.selectByStaffSid(tempeducation.getStaffSid());
|
||||
if (staffAdditional != null) {
|
||||
staffAdditional.setEducationNum(count);
|
||||
staffAdditional.setEducationState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
} else {
|
||||
staffAdditional = new StaffAdditional();
|
||||
staffAdditional.setEducationNum(count);
|
||||
staffAdditional.setEducationState(1);
|
||||
staffAdditional.setStaffSid(tempeducation.getStaffSid());
|
||||
staffAdditionalService.save(staffAdditional);
|
||||
}
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("保存成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 教育经历修改(@PathVariable是spring3.0的一个新功能:接收请求路径中占位符的值.
|
||||
* 通过 @PathVariable 可以将URL中占位符参数{xxx}绑定到处理器类的方法形参中@PathVariable(“xxx“) )
|
||||
*
|
||||
* @param tempeducationDto 教育经历Dto对象
|
||||
* @param sid 教育经历sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean update(@Valid TempEducationDto tempeducationDto, String sid) {
|
||||
String path = fileUploadComponent.getUrlPrefix();
|
||||
if (tempeducationDto.getDegreeCert().indexOf(path) > -1) {
|
||||
tempeducationDto.setDegreeCert(tempeducationDto.getDegreeCert().replace(path, ""));
|
||||
}
|
||||
if (tempeducationDto.getDiploma().indexOf(path) > -1) {
|
||||
tempeducationDto.setDiploma(tempeducationDto.getDiploma().replace(path, ""));
|
||||
}
|
||||
if (tempeducationService.compareFields(tempeducationDto, sid)) { //判断是否修改字段
|
||||
//根据sid查询教育经历是否存在
|
||||
TempEducation tempeducation = tempeducationService.fetchBySid(sid);
|
||||
staffBackRecordService.deleteByItemSid(sid);//审核通过删除退回记录表数据
|
||||
if (tempeducation == null) {
|
||||
return ResultBean.fireFail().setMsg("该教育经历不存在");
|
||||
}
|
||||
tempeducation.setState(1);
|
||||
if (StringUtils.isBlank(tempeducationDto.getIssueDate())) {
|
||||
tempeducationService.updateIssueDate(sid);
|
||||
tempeducationDto.setIssueDate(null);
|
||||
}
|
||||
String speciality = tempeducationDto.getSpeciality();
|
||||
ResultBean<DictCommonVo> dictCommonVoResultBean = dictCommonApi.selectBykey(speciality, "bkzy");
|
||||
DictCommonVo data = dictCommonVoResultBean.getData();
|
||||
if(StringUtils.isBlank(data.getDictKey())){
|
||||
DictCommonDto dataDto=new DictCommonDto();
|
||||
dataDto.setDictKey(UUID.randomUUID().toString());
|
||||
dataDto.setDictType("bkzy");
|
||||
dataDto.setDictValue(speciality);
|
||||
dictCommonApi.save(dataDto);
|
||||
tempeducationDto.setSpeciality(dataDto.getDictKey());
|
||||
}
|
||||
int i = tempeducationService.updateBySid(tempeducationDto.toMap(tempeducation), sid);
|
||||
// if (StringUtils.isBlank(tempeducation.getIssueDate())){
|
||||
// tempeducationService.updateIssueDate(sid);
|
||||
// }
|
||||
if (i <= 0) {
|
||||
return ResultBean.fireFail().setMsg("修改失败");
|
||||
}
|
||||
StaffAdditional staffAdditional = staffAdditionalService.selectByStaffSid(tempeducation.getStaffSid());
|
||||
if (staffAdditional != null) {
|
||||
staffAdditional.setEducationState(1);
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
PhotoCommonQuery q1 = new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("diplomaPhoto");
|
||||
//List<PhotoCommonVo> listVo1=photoCommonApi.queryBylinkSidAndType(q);
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
PhotoCommonDto photoCommon = new PhotoCommonDto();
|
||||
photoCommon.setFilePath(tempeducationDto.getDiploma());
|
||||
photoCommon.setType("diplomaPhoto");
|
||||
photoCommon.setLinkSid(tempeducation.getSid());
|
||||
photoCommonApi.save(photoCommon);
|
||||
|
||||
q1.setType("degreeCertPhoto");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
photoCommon.setFilePath(tempeducationDto.getDegreeCert());
|
||||
photoCommon.setType("degreeCertPhoto");
|
||||
photoCommon.setLinkSid(tempeducation.getSid());
|
||||
photoCommonApi.save(photoCommon);
|
||||
}
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除教育经历
|
||||
*
|
||||
* @param sid 教育经历sid
|
||||
* @return ResultBean
|
||||
*/
|
||||
@Override
|
||||
public ResultBean delete(String sid) {
|
||||
//根据sid查询教育经历是否存在
|
||||
TempEducation tempeducation = tempeducationService.fetchBySid(sid);
|
||||
if (tempeducation == null) {
|
||||
return ResultBean.fireFail().setMsg("该教育经历不存在");
|
||||
}
|
||||
int i = tempeducationService.deleteBySid(sid);
|
||||
educationService.deleteBySid(sid);
|
||||
staffBackRecordService.deleteByItemSid(sid);//删除当前数据同时删除退回记录表数据
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("删除失败");
|
||||
}
|
||||
|
||||
int count = tempeducationService.selectCountByStaffSid(tempeducation.getStaffSid());
|
||||
int num = tempeducationService.selectStateByStaffSid(tempeducation.getStaffSid());
|
||||
StaffAdditional staffAdditional = staffAdditionalService.selectByStaffSid(tempeducation.getStaffSid());
|
||||
if (staffAdditional != null) {
|
||||
staffAdditional.setEducationNum(count);
|
||||
if (num == 0) {
|
||||
staffAdditional.setEducationState(2);//已审核
|
||||
} else {
|
||||
staffAdditional.setEducationState(1);//未审核
|
||||
}
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
PhotoCommonQuery q1 = new PhotoCommonQuery();
|
||||
q1.setLinkSid(sid);
|
||||
q1.setType("diplomaPhoto");
|
||||
//List<PhotoCommonVo> listVo1=photoCommonApi.queryBylinkSidAndType(q);
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
q1.setType("degreeCertPhoto");
|
||||
photoCommonApi.deleteBylinkSidAndType(q1);
|
||||
return ResultBean.fireSuccess().setMsg("删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过人员sid查询教育经历
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return 该人员的教育经历list
|
||||
*/
|
||||
@Override
|
||||
public ResultBean<List<TempEducationVo>> selectByStaffSid(String staffSid) {
|
||||
String path = fileUploadComponent.getUrlPrefix();
|
||||
List<TempEducationVo> page = tempeducationService.selectByStaffSid(staffSid, path);
|
||||
for (int i = 0; page.size() > i; i++) {
|
||||
StaffBackRecordVo selectByItemSidMax = staffBackRecordService.selectByItemSidMax(page.get(i).getSid());
|
||||
if (selectByItemSidMax != null) {
|
||||
page.get(i).setStaffBackRecordVo(selectByItemSidMax);
|
||||
}
|
||||
}
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 注册审核通过更新人员信息
|
||||
*
|
||||
* @param staffRegisterDto 注册人员信息dto对象
|
||||
* @param sid 注册人员sid
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public ResultBean educationInfoUpdate(Integer state, String sid) {
|
||||
if (state != null) {
|
||||
//通过
|
||||
int i = tempeducationService.updateState(state, sid);
|
||||
TempEducation tempeducation = tempeducationService.fetchBySid(sid);
|
||||
if (tempeducation != null) {
|
||||
Education education = educationService.fetchBySid(sid);
|
||||
if (education == null) {
|
||||
education = new Education();
|
||||
}
|
||||
BeanUtils.copyProperties(tempeducation, education);
|
||||
educationService.deleteBySid(sid);
|
||||
educationService.insert(education);
|
||||
staffBackRecordService.deleteByItemSid(sid);//审核通过删除退回记录表数据
|
||||
//tempeducationService.deleteBySid(sid);//审核通过删除临时表数据
|
||||
int k = staffAppendWaitService.tzOrBack(tempeducation.getStaffSid(), sid);//判断是够是审核最后一条,若果是做下一步操作
|
||||
if (k == 0) {
|
||||
tempeducationService.deleteByStaffSid(tempeducation.getStaffSid());
|
||||
}
|
||||
int num = tempeducationService.selectStateByStaffSid(tempeducation.getStaffSid());
|
||||
StaffAdditional staffAdditional = staffAdditionalService.selectByStaffSid(tempeducation.getStaffSid());
|
||||
if (staffAdditional != null) {//暂未使用该逻辑
|
||||
if (num == 0) {
|
||||
staffAdditional.setEducationState(2);//已审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
} else {
|
||||
staffAdditional.setEducationState(1);//未审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
} else {
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("审核通过");
|
||||
|
||||
}
|
||||
} else {
|
||||
return ResultBean.fireSuccess().setMsg("教育经历信息审核失败");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean infoUpdateBack(StaffBackRecordDto staffBackRecordDto) {
|
||||
String sid = staffBackRecordDto.getItemSid();
|
||||
TempEducation tempeducation = tempeducationService.fetchBySid(sid);
|
||||
//未通过
|
||||
int i = tempeducationService.updateState(3, sid);
|
||||
StaffBackRecord entity = staffBackRecordDto.toEntity();
|
||||
entity.setBackDate(new Date());
|
||||
staffBackRecordService.save(entity);
|
||||
staffAppendWaitService.tzOrBack(tempeducation.getStaffSid(), sid);//判断是否是审核最后一条,若果是做下一步操作
|
||||
|
||||
if (tempeducation != null) {
|
||||
int num = tempeducationService.selectStateByStaffSid(tempeducation.getStaffSid());
|
||||
StaffAdditional staffAdditional = staffAdditionalService.selectByStaffSid(tempeducation.getStaffSid());
|
||||
if (staffAdditional != null) {
|
||||
if (num == 0) {
|
||||
staffAdditional.setEducationState(2);//已审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
} else {
|
||||
staffAdditional.setEducationState(1);//未审核
|
||||
staffAdditionalService.updateById(staffAdditional);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i == 0) {
|
||||
return ResultBean.fireFail().setMsg("审核失败");
|
||||
} else {
|
||||
|
||||
return ResultBean.fireSuccess().setMsg("审核未通过");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<Map<String, Object>> dictSelect() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
ResultBean<Map<String, Object>> dictCommonInitVoResultBean = dictCommonApi.dictCommonEducation();
|
||||
map.put("dictCommonList", dictCommonInitVoResultBean.getData());
|
||||
return new ResultBean().success().setData(map);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<TempEducationVo> getVo(String sid) {
|
||||
String path = fileUploadComponent.getUrlPrefix();
|
||||
ResultBean<TempEducationVo> resultBean = ResultBean.fireFail();
|
||||
//TempEducation tempeducation=tempeducationService.selectBySid(sid,path);
|
||||
TempEducation tempeducation = tempeducationService.fetchBySid(sid);
|
||||
TempEducationVo vo = new TempEducationVo();
|
||||
vo.fromEntity(tempeducation);
|
||||
vo.setDiploma(path + tempeducation.getDiploma());
|
||||
vo.setDegreeCert(path + tempeducation.getDegreeCert());
|
||||
return resultBean.success().setData(vo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<TempEducationVo>> doingInfo(String staffSid) {
|
||||
// TODO Auto-generated method stub
|
||||
String path = fileUploadComponent.getUrlPrefix();
|
||||
List<TempEducationVo> page = tempeducationService.doingInfo(staffSid, path);
|
||||
return new ResultBean().success().setData(page);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResultBean<List<DictCommonListVo>> likeZymc(String likeStr) {
|
||||
ResultBean<List<DictCommonListVo>> dictCommonInitVoResultBean = dictCommonApi.likeZymc(likeStr);
|
||||
return dictCommonInitVoResultBean;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.yxt.jlzx.jlcyry.biz.tempeducation;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.yxt.common.core.result.ResultBean;
|
||||
import com.yxt.jlzx.jlcyry.api.tempeducation.TempEducation;
|
||||
import com.yxt.jlzx.jlcyry.api.tempeducation.TempEducationVo;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author dimengzhe
|
||||
* @date 2020/9/1 9:21
|
||||
* @description 教育经历
|
||||
*/
|
||||
@Mapper
|
||||
public interface TempEducationMapper extends BaseMapper<TempEducation> {
|
||||
|
||||
/**
|
||||
* 根据人员sid查询该人员的教育经历
|
||||
*
|
||||
* @param staffSid 人员sid
|
||||
* @return 该人员的教育经历list
|
||||
*/
|
||||
public List<TempEducationVo> selectByStaffSid(@Param("staffSid") String staffSid,@Param("path") String path);
|
||||
|
||||
public TempEducation selectBySid(@Param("sid") String sid,@Param("path") String path);
|
||||
|
||||
int updateState(@Param("state") Integer state, @Param("tempeducationSid") String tempeducationSid);
|
||||
|
||||
public int selectStateByStaffSid(@Param("staffSid") String staffSid);
|
||||
|
||||
public int selectCountByStaffSid(@Param("staffSid") String staffSid);
|
||||
|
||||
public void deleteByStaffSid(String staffSid);
|
||||
|
||||
public List<TempEducationVo> doingInfo(@Param("staffSid") String staffSid,@Param("path") String path);
|
||||
|
||||
public int updateIssueDate(@Param("tempeducationSid") String tempeducationSid);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user