Merge branch 'develop_master' into FOTON
# Conflicts: # adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/WorkFlowController.java
This commit is contained in:
+37
-112
@@ -13,6 +13,8 @@ import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.common.Page;
|
||||
import com.adc.da.login.util.JwtUtils;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.adc.da.slrs.sarUser.service.ITsUserService;
|
||||
import com.adc.da.sys.common.EmailUtils;
|
||||
import com.adc.da.sys.entity.UserEO;
|
||||
import com.adc.da.sys.service.IUserEOService;
|
||||
@@ -35,13 +37,10 @@ import sun.misc.BASE64Encoder;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.io.*;
|
||||
import java.net.URL;
|
||||
import java.net.URLConnection;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -54,102 +53,54 @@ public class WorkFlowController {
|
||||
|
||||
@Autowired
|
||||
private workFlowFeignClientImpl workFlowFeignClient;
|
||||
@Autowired
|
||||
private IUserEOService userService;
|
||||
@Autowired
|
||||
private JwtUtils jwtUtils;
|
||||
|
||||
@Value("${stand.edit.file.path}")
|
||||
private String standEditFilePath;
|
||||
|
||||
@Autowired
|
||||
private JwtUtils jwtUtils;
|
||||
|
||||
@Autowired
|
||||
private ITsUserService userService;
|
||||
|
||||
// @Autowired
|
||||
// private ExportExcelMapper exportExcelMapper;
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "手机获取token")
|
||||
@PostMapping(value = "/loginMobile")
|
||||
@ResponseBody
|
||||
public ResponseMessage<String> loginMobile(String taskIds, String pId) throws UnsupportedEncodingException {
|
||||
BusProcessNew busProcessNew = workFlowFeignClient.queryDetail(taskIds);
|
||||
if(busProcessNew == null || StringUtils.isBlank(busProcessNew.getUserId())){
|
||||
return Result.error("r0011", "用户不存在");
|
||||
}
|
||||
TsUser userEO = userService.getById(busProcessNew.getUserId());
|
||||
if (null == userEO) {
|
||||
return Result.error("r0011", "用户不存在");
|
||||
}
|
||||
if(userEO.getDisableFlag().equals("1")){
|
||||
return Result.error("r0011", "帐号已禁用");
|
||||
}
|
||||
String token = jwtUtils.generateToken(userEO.getUserId());
|
||||
userEO.setToken(token);
|
||||
// 加密重要信息
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
String userStr = JSON.toJSONString(userEO);
|
||||
String userStr2 = URLEncoder.encode(userStr,"UTF-8");
|
||||
userStr = encoder.encode(userStr2.getBytes());
|
||||
return Result.success(userStr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ApiOperation(value = "查询在线编辑流程汇总文件编辑对象")
|
||||
@GetMapping("/processModelHisOneCount")
|
||||
public BusProcessModelHis processModelHisOneCount(@RequestParam("pid") String pid){
|
||||
return workFlowFeignClient.processModelHisOneCount(pid);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "|onlyOffice接收文件")
|
||||
@PostMapping("/recieveFile")
|
||||
public void recieveFile(HttpServletRequest request, HttpServletResponse response, String fileNm,String standNo,String pid,String taskId){
|
||||
logger.info("**********进入onlyoffice接收文档接口************");
|
||||
try {
|
||||
PrintWriter writer = response.getWriter();
|
||||
String body = "";
|
||||
try {
|
||||
Scanner scanner = new Scanner(request.getInputStream());
|
||||
scanner.useDelimiter("\\A");
|
||||
body = scanner.hasNext() ? scanner.next() : "";
|
||||
scanner.close();
|
||||
} catch (Exception ex) {
|
||||
writer.write("get request.getInputStream error:" + ex.getMessage());
|
||||
return;
|
||||
}
|
||||
|
||||
if (body.isEmpty()) {
|
||||
writer.write("empty request.getInputStream");
|
||||
return;
|
||||
}
|
||||
|
||||
net.sf.json.JSONObject jsonObj = net.sf.json.JSONObject.fromObject(body);
|
||||
logger.info("**********onlyoffice接收文档接口获得结果body************" + body);
|
||||
int status = (Integer) jsonObj.get("status");
|
||||
|
||||
int saved = 0;
|
||||
if (status == 2 || status == 3)//MustSave, Corrupted
|
||||
{
|
||||
String downloadUri = (String) jsonObj.get("url");
|
||||
|
||||
try {
|
||||
logger.info("**********onlyoffice接收文档接口获得downloadUri************" + downloadUri);
|
||||
if (StringUtils.isNotEmpty(downloadUri)) {
|
||||
File file = new File(standEditFilePath + standNo + "\\" + fileNm);
|
||||
downloadNetFile(downloadUri, file);
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
saved = 1;
|
||||
logger.info("**********onlyoffice接收文档接口异常************" + ex.getMessage());
|
||||
logger.error(ex.getMessage(),ex);
|
||||
}
|
||||
} else if (status == 4) {
|
||||
logger.info("**********onlyoffice接收文档接口开始修改文件状态状态4************");
|
||||
|
||||
logger.info("**********onlyoffice接收文档接口修改文件状态成功状态4************");
|
||||
}
|
||||
logger.info("onlyoffice编辑完成--------------");
|
||||
writer.write("{\"error\":" + saved + "}");
|
||||
|
||||
// 更新在线编辑当前节点编辑状态
|
||||
workFlowFeignClient.processModelHisOneUpdStatus(pid,taskId);
|
||||
} catch (IOException e) {
|
||||
logger.info("**********onlyoffice接收文档接口异常************" + e.getMessage());
|
||||
logger.error(e.getMessage(),e);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void downloadNetFile(String downloadUrl, File file) {
|
||||
try {
|
||||
FileOutputStream fileOutputStream = new FileOutputStream(file);
|
||||
URL url = new URL(downloadUrl);
|
||||
URLConnection connection = url.openConnection();
|
||||
InputStream inputStream = connection.getInputStream();
|
||||
int length = 0;
|
||||
byte[] bytes = new byte[1024];
|
||||
while ((length = inputStream.read(bytes)) != -1) {
|
||||
fileOutputStream.write(bytes, 0, length);
|
||||
}
|
||||
fileOutputStream.close();
|
||||
inputStream.close();
|
||||
} catch (IOException e) {
|
||||
logger.error("download error ! url :{}, exception:{}", downloadUrl, e);
|
||||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "更新在线编辑流程当前节点编辑状态")
|
||||
@GetMapping("/processModelHisOneUpd")
|
||||
public BusProcessModelHis processModelHisOneUpd(@RequestParam("pid") String pid,@RequestParam("taskId") String taskId){
|
||||
@@ -831,30 +782,4 @@ public class WorkFlowController {
|
||||
}
|
||||
|
||||
|
||||
@ApiOperation(value = "手机端登录")
|
||||
@PostMapping(value = "/loginMobile")
|
||||
@ResponseBody
|
||||
public ResponseMessage<String> loginMobile(@RequestParam("taskIds") String taskIds, @RequestParam("pId") String pId)throws UnsupportedEncodingException {
|
||||
BusProcessNew busProcessNew = workFlowFeignClient.inboundLiaisonDetail(taskIds,pId);
|
||||
if(busProcessNew == null || StringUtils.isBlank(busProcessNew.getUserId())){
|
||||
return Result.error("","未通过流程实例获取到用户信息");
|
||||
}
|
||||
UserEO userEO = userService.getUserByLoginNameNotDeleted(busProcessNew.getUserId());
|
||||
if (null == userEO) {
|
||||
return Result.error("r0011", "用户不存在");
|
||||
}
|
||||
if(userEO.getDisableFlag()==1){
|
||||
return Result.error("r0011", "帐号已禁用");
|
||||
}
|
||||
String token = jwtUtils.generateToken(userEO.getUsid());
|
||||
userEO.setToken(token);
|
||||
// 加密重要信息
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
String userStr = JSON.toJSONString(userEO);
|
||||
String userStr2 = URLEncoder.encode(userStr,"UTF-8");
|
||||
userStr = encoder.encode(userStr2.getBytes());
|
||||
return Result.success(userStr);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -66,6 +66,9 @@ public class WebMvcConfig implements WebMvcConfigurer {
|
||||
// onlyOffice 回调
|
||||
addInterceptor.excludePathPatterns("/api/lawss/activiti/recieveFile");
|
||||
|
||||
// 手机获取token
|
||||
addInterceptor.excludePathPatterns("/api/lawss/activiti/loginMobile");
|
||||
|
||||
addInterceptor.excludePathPatterns("/api/lawss/activiti/processModelHisOne");
|
||||
|
||||
addInterceptor.excludePathPatterns("/api/lawss/activiti/processModelHisOneCount");
|
||||
|
||||
@@ -70,6 +70,9 @@ public class EsRevisePlan extends BasePage {
|
||||
@ApiModelProperty(value = "起草责任单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty(value = "起草责任单位ID")
|
||||
private String unitName;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+19
-19
@@ -86,25 +86,25 @@ public class LawsDto {
|
||||
@ApiModelProperty(value = "适用产品线")
|
||||
private String SYCPX;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "乘用车VPPS编码", index = 10)
|
||||
@ApiModelProperty(value = "乘用车VPPS编码")
|
||||
private String CYCVPPSBM;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "乘用车vpps中文名称", index = 11)
|
||||
@ApiModelProperty(value = "乘用车vpps中文名称")
|
||||
private String CYCVPPSCN;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "卡车VPPS编码", index = 12)
|
||||
@ApiModelProperty(value = "卡车VPPS编码")
|
||||
private String KCCVPPSBM;
|
||||
|
||||
@ColumnWidth(20)
|
||||
@ExcelProperty(value = "卡车vpps中文名称", index = 13)
|
||||
@ApiModelProperty(value = "卡车vpps中文名称")
|
||||
private String KCCVPPSCN;
|
||||
// @ColumnWidth(20)
|
||||
// @ExcelProperty(value = "乘用车VPPS编码", index = 10)
|
||||
// @ApiModelProperty(value = "乘用车VPPS编码")
|
||||
// private String CYCVPPSBM;
|
||||
//
|
||||
// @ColumnWidth(20)
|
||||
// @ExcelProperty(value = "乘用车vpps中文名称", index = 11)
|
||||
// @ApiModelProperty(value = "乘用车vpps中文名称")
|
||||
// private String CYCVPPSCN;
|
||||
//
|
||||
// @ColumnWidth(20)
|
||||
// @ExcelProperty(value = "卡车VPPS编码", index = 12)
|
||||
// @ApiModelProperty(value = "卡车VPPS编码")
|
||||
// private String KCCVPPSBM;
|
||||
//
|
||||
// @ColumnWidth(20)
|
||||
// @ExcelProperty(value = "卡车vpps中文名称", index = 13)
|
||||
// @ApiModelProperty(value = "卡车vpps中文名称")
|
||||
// private String KCCVPPSCN;
|
||||
|
||||
@ApiModelProperty(value = "责任工程师")
|
||||
// @ExcelProperty(value = "责任工程师", index = 17)
|
||||
|
||||
@@ -41,7 +41,7 @@ public interface TsRoleDao extends BaseMapper<TsRole> {
|
||||
* @param menuId:权限ID
|
||||
*/
|
||||
@Insert("insert into ts_role_menu (role_id,menu_id) values (#{roleId},#{menuId})")
|
||||
void addMenu(String roleId, String menuId);
|
||||
void addMenu(@Param("roleId") String roleId, @Param("menuId") String menuId);
|
||||
|
||||
/**
|
||||
* 删除权限
|
||||
|
||||
+12
-12
@@ -50,18 +50,18 @@ public class StandAttrInfoDto {
|
||||
//责任部门
|
||||
@ExcelProperty("责任部门")
|
||||
private String ZRBM;
|
||||
//关联模块--卡车VPPS编码
|
||||
@ExcelProperty("关联模块--卡车VPPS编码")
|
||||
private String KCCVPPSBM;
|
||||
//关联模块--卡车vpps中文名称
|
||||
@ExcelProperty("关联模块--卡车vpps中文名称")
|
||||
private String KCCVPPSCN;
|
||||
//关联模块--乘用车VPPS编码
|
||||
@ExcelProperty("关联模块--乘用车VPPS编码")
|
||||
private String CYCVPPSBM;
|
||||
//关联模块--乘用车vpps中文名称
|
||||
@ExcelProperty("关联模块--乘用车vpps中文名称")
|
||||
private String CYCVPPSCN;
|
||||
// //关联模块--卡车VPPS编码
|
||||
// @ExcelProperty("关联模块--卡车VPPS编码")
|
||||
// private String KCCVPPSBM;
|
||||
// //关联模块--卡车vpps中文名称
|
||||
// @ExcelProperty("关联模块--卡车vpps中文名称")
|
||||
// private String KCCVPPSCN;
|
||||
// //关联模块--乘用车VPPS编码
|
||||
// @ExcelProperty("关联模块--乘用车VPPS编码")
|
||||
// private String CYCVPPSBM;
|
||||
// //关联模块--乘用车vpps中文名称
|
||||
// @ExcelProperty("关联模块--乘用车vpps中文名称")
|
||||
// private String CYCVPPSCN;
|
||||
|
||||
private Long unCount;
|
||||
|
||||
|
||||
+12
-12
@@ -352,13 +352,13 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
p.setStandEnName(s.getStandEnName());
|
||||
for (SarStandAttrInfo a:list2){
|
||||
if(s.getId().equals(a.getStandId())){
|
||||
p.setCYCVPPSBM(a.getCycvppsbm());
|
||||
p.setCYCVPPSCN(a.getCycvppscn());
|
||||
// p.setCYCVPPSBM(a.getCycvppsbm());
|
||||
// p.setCYCVPPSCN(a.getCycvppscn());
|
||||
p.setSSRQ(a.getSsrq());
|
||||
p.setXCXSSRQ(a.getXcxssrq());
|
||||
p.setZCCSSRQ(a.getZccssrq());
|
||||
p.setKCCVPPSBM(a.getKccvppsbm());
|
||||
p.setKCCVPPSCN(a.getKccvppscn());
|
||||
// p.setKCCVPPSBM(a.getKccvppsbm());
|
||||
// p.setKCCVPPSCN(a.getKccvppscn());
|
||||
p.setZRBM(a.getZrbm());
|
||||
}
|
||||
}
|
||||
@@ -419,13 +419,13 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
p.setEndTimes(s.getEndTimes());
|
||||
for (SarStandAttrInfo a:list2){
|
||||
if(s.getId().equals(a.getStandId())){
|
||||
p.setCYCVPPSBM(a.getCycvppsbm());
|
||||
p.setCYCVPPSCN(a.getCycvppscn());
|
||||
// p.setCYCVPPSBM(a.getCycvppsbm());
|
||||
// p.setCYCVPPSCN(a.getCycvppscn());
|
||||
p.setSSRQ(a.getSsrq());
|
||||
p.setXCXSSRQ(a.getXcxssrq());
|
||||
p.setZCCSSRQ(a.getZccssrq());
|
||||
p.setKCCVPPSBM(a.getKccvppsbm());
|
||||
p.setKCCVPPSCN(a.getKccvppscn());
|
||||
// p.setKCCVPPSBM(a.getKccvppsbm());
|
||||
// p.setKCCVPPSCN(a.getKccvppscn());
|
||||
p.setZRBM(a.getZrbm());
|
||||
}
|
||||
}
|
||||
@@ -521,8 +521,8 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
p.setStandEnName(s.getStandEnName());
|
||||
for (SarStandAttrInfo a:userList2){
|
||||
if(s.getId().equals(a.getStandId())){
|
||||
p.setCYCVPPSBM(a.getCycvppsbm());
|
||||
p.setCYCVPPSCN(a.getCycvppscn());
|
||||
// p.setCYCVPPSBM(a.getCycvppsbm());
|
||||
// p.setCYCVPPSCN(a.getCycvppscn());
|
||||
if (a.getSsrq()!=null){
|
||||
p.setSSRQ(a.getSsrq().substring(0,10));
|
||||
}
|
||||
@@ -532,8 +532,8 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
if (a.getZccssrq()!=null){
|
||||
p.setZCCSSRQ(a.getZccssrq().substring(0,10));
|
||||
}
|
||||
p.setKCCVPPSBM(a.getKccvppsbm());
|
||||
p.setKCCVPPSCN(a.getKccvppscn());
|
||||
// p.setKCCVPPSBM(a.getKccvppsbm());
|
||||
// p.setKCCVPPSCN(a.getKccvppscn());
|
||||
p.setZRBM(a.getZrbm());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,6 +150,10 @@ public class TsUser extends BaseEntity {
|
||||
@TableField(exist = false)
|
||||
private Integer size;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String token;
|
||||
|
||||
|
||||
public TsUser() {
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
draft_time,
|
||||
release_time,
|
||||
unit,
|
||||
(select group_concat(ts_institution.name) from ts_institution where find_in_set(ts_institution.id,unit)) as unitName,
|
||||
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,drafter) ) as drafterName,
|
||||
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,res_person) ) as res_personName,
|
||||
(SELECT GROUP_CONCAT(UNAME) from ts_user WHERE find_in_set(USID,wg_leader) ) as wg_leaderName
|
||||
|
||||
Reference in New Issue
Block a user