Merge remote-tracking branch 'origin/develop_1' into develop_master
This commit is contained in:
+5
-4
@@ -63,10 +63,11 @@ public class TsInstitutionController extends BaseController<TsInstitution> {
|
||||
* @return ResponseMessage<List<TsUser>>
|
||||
*/
|
||||
@ApiOperation("查询机构的人员")
|
||||
@GetMapping("/user")
|
||||
public ResponseMessage<List<TsUser>> getUserByInstitutionId(@RequestParam String institutionId){
|
||||
List<TsUser> tsUsers=tsUserService.getUserByInstitutionId(institutionId);
|
||||
return Result.success(tsUsers);
|
||||
@PostMapping("/user")
|
||||
public ResponseMessage<Object> getUserByInstitutionId(TsUser tsUser){
|
||||
// List<TsUser> tsUsers=tsUserService.getUserByInstitutionId(institutionId);
|
||||
List<TsUser> tsUserList = tsUserService.getUserByInstitutionId(tsUser);
|
||||
return Result.success(tsUserList);
|
||||
}
|
||||
|
||||
@ApiOperation("导入机构数据")
|
||||
|
||||
+7
-66
@@ -227,72 +227,13 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
|
||||
@PostMapping("/save")
|
||||
@ApiOperation("同步车型项目数据")
|
||||
public ResponseDto save(@RequestBody String jsonStr){
|
||||
Head head = new Head();
|
||||
ResponseDto responseDto = new ResponseDto();
|
||||
|
||||
// try {
|
||||
//是数组就JSONarray,是对象就JSONobject
|
||||
//把字符串转换成对象
|
||||
JsonObject jsonObject = (JsonObject) new JsonParser().parse(jsonStr);
|
||||
//要把jsonObject里的HEAD强转成JsonObject类型
|
||||
JsonObject HEAD = (JsonObject) jsonObject.get("HEAD");
|
||||
//因为是最后要取的值了,所以就拿到之后把它转换成String类型
|
||||
;
|
||||
HEAD.get("CONSUMER").getAsString();
|
||||
|
||||
head.setBIZTRANSACTIONID(HEAD.get("BIZTRANSACTIONID").getAsString());
|
||||
|
||||
|
||||
//LIST是数组,所以强转成JSONArray
|
||||
JsonArray LIST = (JsonArray) jsonObject.get("LIST");
|
||||
for (int i = 0; i < LIST.size(); i++) {
|
||||
//把数组中的第一个强转成对象
|
||||
JsonObject projectObject = (JsonObject) LIST.get(i);
|
||||
|
||||
//把刚刚拿到的值存到实体类里
|
||||
SarStandProjectLibrary sarStandProjectLibrary = new SarStandProjectLibrary();
|
||||
sarStandProjectLibrary
|
||||
.setProjectPlatfor(projectObject.get("eng_platform").getAsString())
|
||||
.setProjectNumber(projectObject.get("code").getAsString())
|
||||
.setProjectName(projectObject.get("name").getAsString())
|
||||
.setProjectClassification(projectObject.get("catalog_name").getAsString())
|
||||
.setProjectStatus(projectObject.get("project_status").getAsString())
|
||||
.setProjectGroup(projectObject.get("project_group_name").getAsString())
|
||||
.setCurrentNode(projectObject.get("project_current_milestone").getAsString())
|
||||
.setProjectLevel(projectObject.get("project_level").getAsString())
|
||||
.setProductLine(projectObject.get("eng_product_line").getAsString());
|
||||
|
||||
projectObject.get("target_end_on").getAsString();
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
Date targetBeginOn = null;
|
||||
try {
|
||||
targetBeginOn = simpleDateFormat.parse(projectObject.get("target_begin_on").getAsString());
|
||||
Date targetEndOn = simpleDateFormat.parse(projectObject.get("target_end_on").getAsString());
|
||||
sarStandProjectLibrary
|
||||
.setProjectStartDate(targetBeginOn)
|
||||
.setProjectEndDate(targetEndOn);
|
||||
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
sarStandProjectLibrary.setId(UUIDUtils.randomUUID20());
|
||||
QueryWrapper<SarStandProjectLibrary> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("project_number",sarStandProjectLibrary.getProjectNumber());
|
||||
|
||||
sarStandProjectLibraryService.saveOrUpdate(sarStandProjectLibrary,queryWrapper);
|
||||
|
||||
}
|
||||
// }catch (Exception e){
|
||||
// head.setERRORCODE("2");
|
||||
// head.setRESULT("业务失败需要重做");
|
||||
// return responseDto(head);
|
||||
// }
|
||||
head.setERRORCODE("0");
|
||||
head.setRESULT("成功");
|
||||
responseDto.setHEAD(head);
|
||||
Head head = sarStandProjectLibraryService.AnalysisJsonAndStorage(jsonStr);
|
||||
ArrayList<Company> companies = new ArrayList<>();
|
||||
ResponseDto responseDto = new ResponseDto(head,companies);
|
||||
Company company = new Company();
|
||||
company.setCOMPANY_CODE("");
|
||||
company.setFISCAL_YEAR("");
|
||||
companies.add(company);
|
||||
return responseDto;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.adc.da.slrs.sarStandProjectLibrary.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Company {
|
||||
private String COMPANY_CODE;
|
||||
|
||||
private String FISCAL_YEAR;
|
||||
}
|
||||
+5
-2
@@ -17,8 +17,11 @@ public class ResponseDto {
|
||||
// }
|
||||
|
||||
|
||||
public ResponseDto(Head head) {
|
||||
this.HEAD = head;
|
||||
List<Company> LIST;
|
||||
|
||||
public ResponseDto(Head HEAD, List<Company> LIST) {
|
||||
this.HEAD = HEAD;
|
||||
this.LIST = LIST;
|
||||
}
|
||||
|
||||
public ResponseDto() {
|
||||
|
||||
+7
-1
@@ -5,15 +5,17 @@ import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author ZhangJin
|
||||
@@ -49,10 +51,14 @@ public class SarStandProjectLibrary extends BaseEntity {
|
||||
@ApiModelProperty(value = "项目群")
|
||||
private String projectGroup;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "项目开始日期")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private Date projectStartDate;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "项目完成日期")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private Date projectEndDate;
|
||||
|
||||
@ApiModelProperty(value = "当前节点")
|
||||
|
||||
+1
@@ -19,5 +19,6 @@ public interface SarStandProjectLibraryService {
|
||||
void deleteByIds(List<StandProjectRelationDto> ids);
|
||||
void batchInsert(@Param("ids") List<StandProjectRelationDto> list);
|
||||
List<StandAttrInfoDto> exportStandAttrInfoExcel(StandAttrInfoExcelDto standAttrInfoExcelDto,String standId);
|
||||
public Head AnalysisJsonAndStorage(String jsonStr);
|
||||
|
||||
}
|
||||
|
||||
+87
-8
@@ -1,4 +1,5 @@
|
||||
package com.adc.da.slrs.sarStandProjectLibrary.service.impl;
|
||||
import com.adc.da.ocr.util.UUIDUtils;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.*;
|
||||
@@ -9,19 +10,17 @@ import com.adc.da.slrs.sarStandardsInfo.entity.SarStandardsInfo;
|
||||
import com.adc.da.sys.service.IDicTypeEOService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import org.springframework.stereotype.Service;
|
||||
import redis.clients.jedis.ScanResult;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -42,7 +41,87 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
@Resource
|
||||
private IDicTypeEOService iDicTypeEOService;
|
||||
|
||||
Date version = new Date();
|
||||
public String TimeVersion(){
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||
Date date = new Date();
|
||||
String version = simpleDateFormat.format(date);
|
||||
return version;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Head AnalysisJsonAndStorage(String jsonStr){
|
||||
Head head = new Head();
|
||||
|
||||
|
||||
try {
|
||||
//是数组就JSONarray,是对象就JSONobject
|
||||
//把字符串转换成对象
|
||||
JsonObject jsonObject = (JsonObject) new JsonParser().parse(jsonStr);
|
||||
//要把jsonObject里的HEAD强转成JsonObject类型
|
||||
JsonObject HEAD = (JsonObject) jsonObject.get("HEAD");
|
||||
//因为是最后要取的值了,所以就拿到之后把它转换成String类型
|
||||
;
|
||||
HEAD.get("CONSUMER").getAsString();
|
||||
|
||||
head.setBIZTRANSACTIONID(HEAD.get("BIZTRANSACTIONID").getAsString());
|
||||
|
||||
|
||||
//LIST是数组,所以强转成JSONArray
|
||||
JsonArray LIST = (JsonArray) jsonObject.get("LIST");
|
||||
for (int i = 0; i < LIST.size(); i++) {
|
||||
//把数组中的第一个强转成对象
|
||||
JsonObject projectObject = (JsonObject) LIST.get(i);
|
||||
|
||||
//把刚刚拿到的值存到实体类里
|
||||
SarStandProjectLibrary projectInfo = new SarStandProjectLibrary();
|
||||
projectInfo
|
||||
.setProjectPlatfor(projectObject.get("eng_platform").getAsString())
|
||||
.setProjectNumber(projectObject.get("code").getAsString())
|
||||
.setProjectName(projectObject.get("name").getAsString())
|
||||
.setProjectClassification(projectObject.get("catalog_name").getAsString())
|
||||
.setProjectStatus(projectObject.get("project_status").getAsString())
|
||||
.setProjectGroup(projectObject.get("project_group_name").getAsString())
|
||||
.setCurrentNode(projectObject.get("project_current_milestone").getAsString())
|
||||
.setProjectLevel(projectObject.get("project_level").getAsString())
|
||||
.setProductLine(projectObject.get("eng_product_line").getAsString());
|
||||
|
||||
projectObject.get("target_end_on").getAsString();
|
||||
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||
|
||||
|
||||
Date targetBeginOn = null;
|
||||
try {
|
||||
targetBeginOn = simpleDateFormat.parse(projectObject.get("target_begin_on").getAsString());
|
||||
|
||||
Date targetEndOn = simpleDateFormat.parse(projectObject.get("target_end_on").getAsString());
|
||||
projectInfo
|
||||
.setProjectStartDate(targetBeginOn)
|
||||
.setProjectEndDate(targetEndOn);
|
||||
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
projectInfo.setId(UUIDUtils.randomUUID20());
|
||||
QueryWrapper<SarStandProjectLibrary> updateCondition = new QueryWrapper<SarStandProjectLibrary>();
|
||||
updateCondition.eq("project_number",projectInfo.getProjectNumber());
|
||||
// .eq("project_start_date",targetBeginOn);
|
||||
|
||||
|
||||
this.saveOrUpdate(projectInfo,updateCondition);
|
||||
|
||||
}
|
||||
}catch (Exception e){
|
||||
head.setERRORCODE("2");
|
||||
head.setRESULT("业务失败需要重做");
|
||||
return head;
|
||||
}
|
||||
head.setERRORCODE("0");
|
||||
head.setRESULT("成功");
|
||||
|
||||
return head;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<SarStandProjectLibrary> queryMaintenanceProject(int current, int pageSize,
|
||||
@@ -278,7 +357,7 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
|
||||
|
||||
sarStandProjectLibraryDao.deleteByProjectId(list.get(0).getProjectId());
|
||||
sarStandProjectLibraryDao.batchInsert(list);
|
||||
sarStandProjectLibraryDao.updateByProjectId(list.get(0).getProjectId(), String.valueOf(version));
|
||||
sarStandProjectLibraryDao.updateByProjectId(list.get(0).getProjectId(), TimeVersion());
|
||||
|
||||
|
||||
}
|
||||
|
||||
+9
-2
@@ -3,6 +3,7 @@ package com.adc.da.slrs.sarStandProjectTeam.controller;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.Company;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.Head;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.ResponseDto;
|
||||
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary;
|
||||
@@ -16,6 +17,8 @@ import com.adc.da.slrs.sarStandProjectTeam.entity.SarStandProjectTeam;
|
||||
import io.swagger.annotations.Api;
|
||||
import com.adc.da.base.web.BaseController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -37,8 +40,12 @@ public class SarStandProjectTeamController extends BaseController<SarStandProjec
|
||||
@ApiOperation("同步PCMS组织信息")
|
||||
public ResponseDto save(@RequestBody String jsonStr){
|
||||
Head head = sarStandProjectTeamService.AnalysisJsonAndStorage(jsonStr);
|
||||
|
||||
ResponseDto responseDto = new ResponseDto(head);
|
||||
ArrayList<Company> companies = new ArrayList<>();
|
||||
Company company = new Company();
|
||||
company.setCOMPANY_CODE("");
|
||||
company.setFISCAL_YEAR("");
|
||||
companies.add(company);
|
||||
ResponseDto responseDto = new ResponseDto(head,companies);
|
||||
return responseDto;
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package com.adc.da.slrs.sarUser.dao;
|
||||
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.slrs.sarUser.entity.TsUser;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
@@ -45,8 +47,7 @@ public interface TsUserDao extends BaseMapper<TsUser> {
|
||||
* @param institutionId:岗位ID
|
||||
* @return List<TsUser>
|
||||
*/
|
||||
List<TsUser> getUserAndPosition(String institutionId);
|
||||
|
||||
List<TsUser> getUserAndPosition(@Param("TsUser") TsUser tsUser);
|
||||
/**
|
||||
* 通过岗位Id列表查询用户ID列表
|
||||
* @param positionIds:岗位ID列表
|
||||
|
||||
@@ -25,7 +25,7 @@ public interface ITsUserService extends IService<TsUser> {
|
||||
* @param institutionId:机构ID
|
||||
* @return List<TsUser>
|
||||
*/
|
||||
List<TsUser> getUserByInstitutionId(String institutionId);
|
||||
List<TsUser> getUserByInstitutionId(TsUser tsUser);
|
||||
|
||||
/**
|
||||
* 封禁、解禁用户
|
||||
|
||||
+3
-2
@@ -64,8 +64,9 @@ public class TsUserServiceImpl extends ServiceImpl<TsUserDao, TsUser> implements
|
||||
* @return List<TsUser>
|
||||
*/
|
||||
@Override
|
||||
public List<TsUser> getUserByInstitutionId(String institutionId) {
|
||||
return tsUserDao.getUserAndPosition(institutionId);
|
||||
public List<TsUser> getUserByInstitutionId(TsUser tsUser) {
|
||||
// return tsUserDao.getUserAndPosition(institutionId);
|
||||
return tsUserDao.getUserAndPosition(tsUser);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,13 +28,19 @@
|
||||
</collection>
|
||||
</resultMap>
|
||||
|
||||
<select id="getUserAndPosition" resultMap="UserPosition">
|
||||
<select id="getUserAndPosition" parameterType="com.adc.da.slrs.sarUser.entity.TsUser" resultMap="UserPosition">
|
||||
select u.*,p.id p_id,p.name p_name from ts_user u
|
||||
left join ts_user_position up
|
||||
on u.usid=up.user_id
|
||||
left join ts_position p
|
||||
on up.position_id=p.id
|
||||
where u.institution_id=#{institutionId}
|
||||
where u.institution_id=#{TsUser.institutionId}
|
||||
<if test="TsUser.uname != null and TsUser.uname != '' ">
|
||||
and u.uname like concat('%',#{TsUser.uname},'%')
|
||||
</if>
|
||||
<if test="TsUser.email != null and TsUser.email != '' ">
|
||||
and u.email like concat('%',#{TsUser.email},'%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getUserIdsByPositionIds" resultType="String">
|
||||
|
||||
Reference in New Issue
Block a user