履职清单迁移和代码整理
This commit is contained in:
parent
fd928430ba
commit
9e84e0b1d4
|
|
@ -97,4 +97,7 @@ public interface ListFactorMapper {
|
||||||
|
|
||||||
/*履职记录关联的履职清单*/
|
/*履职记录关联的履职清单*/
|
||||||
List<ListFactor> detailFactors(@Param("detailId") String detailId);
|
List<ListFactor> detailFactors(@Param("detailId") String detailId);
|
||||||
|
|
||||||
|
/*查询本年度履职清单*/
|
||||||
|
List<ListFactor> findAllByYear(@Param("yearStr") String yearStr);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -754,4 +754,15 @@
|
||||||
WHERE lr.`detail_id` = #{detailId} AND lr.`target_type` = 1
|
WHERE lr.`detail_id` = #{detailId} AND lr.`target_type` = 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!--查询本年度履职清单-->
|
||||||
|
<select id="findAllByYear" resultMap="BaseResultMap">
|
||||||
|
SELECT lt.*
|
||||||
|
FROM `listfactor` lt
|
||||||
|
WHERE lt.`SysYear` = #{yearStr}
|
||||||
|
AND lt.CheckStandard != 0
|
||||||
|
AND lt.`FactorCnt` != ''
|
||||||
|
AND lt.`del_state` = 1
|
||||||
|
ORDER BY lt.`ListPerformId` ASC
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ import com.rzyc.model.organization.OrgDanger;
|
||||||
import com.rzyc.model.user.*;
|
import com.rzyc.model.user.*;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.commons.beanutils.BeanUtils;
|
||||||
import org.apache.poi.ss.usermodel.*;
|
import org.apache.poi.ss.usermodel.*;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
@ -34,545 +35,6 @@ import java.util.*;
|
||||||
@RequestMapping("data")
|
@RequestMapping("data")
|
||||||
public class DataController extends com.rzyc.controller.BaseController {
|
public class DataController extends com.rzyc.controller.BaseController {
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能区地区用户处理
|
|
||||||
* @param multipartFile
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "功能区地区用户处理", notes = "功能区地区用户处理")
|
|
||||||
@RequestMapping(value = "/importAreaUser", method = RequestMethod.POST)
|
|
||||||
@ResponseBody
|
|
||||||
public SingleResult<String> importAreaUser(@RequestBody MultipartFile multipartFile)throws Exception{
|
|
||||||
SingleResult<String> result = new SingleResult<>();
|
|
||||||
handleAreaUser(multipartFile);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 街道导入驻村干部
|
|
||||||
* @param multipartFile
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
public void handleAreaUser(MultipartFile multipartFile)throws Exception{
|
|
||||||
if(null != multipartFile){
|
|
||||||
Workbook wookbook = WorkbookFactory.create(multipartFile.getInputStream());
|
|
||||||
Sheet sheet = wookbook.getSheetAt(0);
|
|
||||||
DataFormatter dataFormatter = new DataFormatter();
|
|
||||||
//获得表头
|
|
||||||
Row rowHead = sheet.getRow(0);
|
|
||||||
|
|
||||||
System.out.println("getPhysicalNumberOfCells -> "+rowHead.getPhysicalNumberOfCells());
|
|
||||||
//判断表头是否正确
|
|
||||||
if(true){
|
|
||||||
//获得数据的总行数
|
|
||||||
int totalRowNum = sheet.getLastRowNum();
|
|
||||||
|
|
||||||
if(totalRowNum > 0){
|
|
||||||
|
|
||||||
Boolean isSubject = true;
|
|
||||||
|
|
||||||
String superId = "510114118000";
|
|
||||||
|
|
||||||
//获得所有数据
|
|
||||||
for(int i = 1 ; i <= totalRowNum ; i++) {
|
|
||||||
|
|
||||||
int index = i + 1;
|
|
||||||
//获得第i行对象
|
|
||||||
Row row = sheet.getRow(i);
|
|
||||||
if (null == row) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
String netName = "";
|
|
||||||
String chinaNames = "";
|
|
||||||
|
|
||||||
|
|
||||||
Cell cell = row.getCell((short) 0);
|
|
||||||
if (null != cell) {
|
|
||||||
netName = dataFormatter.formatCellValue(cell);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
cell = row.getCell((short) 1);
|
|
||||||
if (null != cell) {
|
|
||||||
chinaNames = dataFormatter.formatCellValue(cell);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
netName = StringUtils.replaceBlank(netName);
|
|
||||||
chinaNames = StringUtils.replaceBlank(chinaNames);
|
|
||||||
|
|
||||||
System.out.println(netName + "-" + chinaNames);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SysOrg sysOrg = sysOrgMapper.findByName(netName,superId);
|
|
||||||
if(null == sysOrg){
|
|
||||||
sysOrg = new SysOrg();
|
|
||||||
sysOrg.setOrgcode(RandomNumber.getUUid());
|
|
||||||
sysOrg.setOrgname(netName);
|
|
||||||
sysOrg.setOrglevel(4);
|
|
||||||
sysOrg.setSuperiororgcode(superId);
|
|
||||||
sysOrg.setCreatedby("导入");
|
|
||||||
sysOrg.setCreatedon(new Date());
|
|
||||||
sysOrg.setModifiedby("导入");
|
|
||||||
sysOrg.setModifiedon(new Date());
|
|
||||||
sysOrgMapper.insert(sysOrg);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
String[] strs = chinaNames.split("、");
|
|
||||||
if(null != strs && strs.length > 0){
|
|
||||||
for (String str : strs){
|
|
||||||
SysUser sysUser = sysUserMapper.findByStreet(superId,str);
|
|
||||||
if(null != sysUser){
|
|
||||||
sysUserMapper.changeCommunityCode(sysUser.getSysuserid(),sysOrg.getOrgcode());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 功能区地区企业处理
|
|
||||||
* @param multipartFile
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "功能区地区企业处理", notes = "功能区地区企业处理")
|
|
||||||
@RequestMapping(value = "/importAreaEnt", method = RequestMethod.POST)
|
|
||||||
@ResponseBody
|
|
||||||
public SingleResult<String> importAreaEnt(@RequestBody MultipartFile multipartFile)throws Exception{
|
|
||||||
SingleResult<String> result = new SingleResult<>();
|
|
||||||
handleAreaEnt(multipartFile);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 街道导入驻村干部
|
|
||||||
* @param multipartFile
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
public void handleAreaEnt(MultipartFile multipartFile)throws Exception{
|
|
||||||
if(null != multipartFile){
|
|
||||||
Workbook wookbook = WorkbookFactory.create(multipartFile.getInputStream());
|
|
||||||
Sheet sheet = wookbook.getSheetAt(0);
|
|
||||||
DataFormatter dataFormatter = new DataFormatter();
|
|
||||||
//获得表头
|
|
||||||
Row rowHead = sheet.getRow(0);
|
|
||||||
|
|
||||||
System.out.println("getPhysicalNumberOfCells -> "+rowHead.getPhysicalNumberOfCells());
|
|
||||||
//判断表头是否正确
|
|
||||||
if(true){
|
|
||||||
//获得数据的总行数
|
|
||||||
int totalRowNum = sheet.getLastRowNum();
|
|
||||||
|
|
||||||
if(totalRowNum > 0){
|
|
||||||
|
|
||||||
Boolean isSubject = true;
|
|
||||||
|
|
||||||
String superId = "510114118000";
|
|
||||||
|
|
||||||
//获得所有数据
|
|
||||||
for(int i = 1 ; i <= totalRowNum ; i++) {
|
|
||||||
|
|
||||||
int index = i + 1;
|
|
||||||
//获得第i行对象
|
|
||||||
Row row = sheet.getRow(i);
|
|
||||||
if (null == row) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
String netName = "";
|
|
||||||
String entName = "";
|
|
||||||
|
|
||||||
|
|
||||||
Cell cell = row.getCell((short) 0);
|
|
||||||
if (null != cell) {
|
|
||||||
netName = dataFormatter.formatCellValue(cell);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
cell = row.getCell((short) 1);
|
|
||||||
if (null != cell) {
|
|
||||||
entName = dataFormatter.formatCellValue(cell);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
netName = StringUtils.replaceBlank(netName);
|
|
||||||
entName = StringUtils.replaceBlank(entName);
|
|
||||||
|
|
||||||
System.out.println(netName + "-" + entName);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SysOrg sysOrg = sysOrgMapper.findByName(netName,superId);
|
|
||||||
if(null == sysOrg){
|
|
||||||
sysOrg = new SysOrg();
|
|
||||||
sysOrg.setOrgcode(RandomNumber.getUUid());
|
|
||||||
sysOrg.setOrgname(netName);
|
|
||||||
sysOrg.setOrglevel(4);
|
|
||||||
sysOrg.setSuperiororgcode(superId);
|
|
||||||
sysOrg.setCreatedby("导入");
|
|
||||||
sysOrg.setCreatedon(new Date());
|
|
||||||
sysOrg.setModifiedby("导入");
|
|
||||||
sysOrg.setModifiedon(new Date());
|
|
||||||
sysOrgMapper.insert(sysOrg);
|
|
||||||
}
|
|
||||||
if(StringUtils.isNotBlank(entName)){
|
|
||||||
SysEnterprise enterprise = sysEnterpriseMapper.findByName(entName);
|
|
||||||
if(null != enterprise && superId.equals(enterprise.getStreetCode())){
|
|
||||||
sysEnterpriseMapper.changeCommunityCode(enterprise.getSysenterpriseid(),sysOrg.getOrgcode());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 石板滩用户责任树
|
|
||||||
* @param multipartFile
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "石板滩用户责任树", notes = "石板滩用户责任树")
|
|
||||||
@RequestMapping(value = "/userDutyTree", method = RequestMethod.POST)
|
|
||||||
@ResponseBody
|
|
||||||
public SingleResult<String> userDutyTree(@RequestBody MultipartFile multipartFile)throws Exception{
|
|
||||||
SingleResult<String> result = new SingleResult<>();
|
|
||||||
handleUserDutyTree(multipartFile);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 街道导入驻村干部
|
|
||||||
* @param multipartFile
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
public void handleUserDutyTree(MultipartFile multipartFile)throws Exception{
|
|
||||||
if(null != multipartFile){
|
|
||||||
Workbook wookbook = WorkbookFactory.create(multipartFile.getInputStream());
|
|
||||||
Sheet sheet = wookbook.getSheetAt(0);
|
|
||||||
DataFormatter dataFormatter = new DataFormatter();
|
|
||||||
//获得表头
|
|
||||||
Row rowHead = sheet.getRow(0);
|
|
||||||
|
|
||||||
System.out.println("getPhysicalNumberOfCells -> "+rowHead.getPhysicalNumberOfCells());
|
|
||||||
//判断表头是否正确
|
|
||||||
if(true){
|
|
||||||
//获得数据的总行数
|
|
||||||
int totalRowNum = sheet.getLastRowNum();
|
|
||||||
|
|
||||||
if(totalRowNum > 0){
|
|
||||||
|
|
||||||
Boolean isSubject = true;
|
|
||||||
|
|
||||||
String superId = "510114102000";
|
|
||||||
String leaderUserName = "";
|
|
||||||
|
|
||||||
SysUser leaderUser = new SysUser();
|
|
||||||
|
|
||||||
//获得所有数据
|
|
||||||
for(int i = 1 ; i <= totalRowNum ; i++) {
|
|
||||||
|
|
||||||
int index = i + 1;
|
|
||||||
//获得第i行对象
|
|
||||||
Row row = sheet.getRow(i);
|
|
||||||
if (null == row) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
String userName = "";
|
|
||||||
String mobile = "";
|
|
||||||
|
|
||||||
|
|
||||||
Cell cell = row.getCell((short) 0);
|
|
||||||
if (null != cell) {
|
|
||||||
String leaderStr = dataFormatter.formatCellValue(cell);
|
|
||||||
if(StringUtils.isNotBlank(leaderStr)){
|
|
||||||
leaderUserName = leaderStr;
|
|
||||||
leaderUser = sysUserMapper.findBySysUserName(leaderUserName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
cell = row.getCell((short) 1);
|
|
||||||
if (null != cell) {
|
|
||||||
userName = dataFormatter.formatCellValue(cell);
|
|
||||||
}
|
|
||||||
cell = row.getCell((short) 2);
|
|
||||||
if (null != cell) {
|
|
||||||
mobile = dataFormatter.formatCellValue(cell);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
leaderUserName = StringUtils.replaceBlank(leaderUserName);
|
|
||||||
userName = StringUtils.replaceBlank(userName);
|
|
||||||
mobile = StringUtils.replaceBlank(mobile);
|
|
||||||
|
|
||||||
|
|
||||||
if(null != leaderUser){
|
|
||||||
System.out.println(leaderUserName + " - " + userName+" - "+mobile);
|
|
||||||
System.out.println("laader ---------------> "+leaderUser.getSysuserid());
|
|
||||||
|
|
||||||
|
|
||||||
SysUser sysUser = sysUserMapper.findByStreetAndName(superId,userName,mobile);
|
|
||||||
if(null != sysUser){
|
|
||||||
DutyTree dutyTree = new DutyTree();
|
|
||||||
dutyTree.setDutyTreeId(RandomNumber.getUUid());
|
|
||||||
dutyTree.setUserId(leaderUser.getSysuserid());
|
|
||||||
dutyTree.setTargetId(sysUser.getSysuserid());
|
|
||||||
dutyTree.setTargetType(1);
|
|
||||||
dutyTree.setModified("导入");
|
|
||||||
dutyTree.setModifyTime(new Date());
|
|
||||||
dutyTree.setCreated("导入");
|
|
||||||
dutyTree.setCreateTime(new Date());
|
|
||||||
dutyTreeMapper.insert(dutyTree);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
System.out.println();
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 石板滩企业责任树
|
|
||||||
* @param multipartFile
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "石板滩企业责任树", notes = "石板滩企业责任树")
|
|
||||||
@RequestMapping(value = "/entDutyTree", method = RequestMethod.POST)
|
|
||||||
@ResponseBody
|
|
||||||
public SingleResult<String> entDutyTree(@RequestBody MultipartFile multipartFile)throws Exception{
|
|
||||||
SingleResult<String> result = new SingleResult<>();
|
|
||||||
handleEntDutyTree(multipartFile);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 街道导入驻村干部
|
|
||||||
* @param multipartFile
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
public void handleEntDutyTree(MultipartFile multipartFile)throws Exception{
|
|
||||||
if(null != multipartFile){
|
|
||||||
Workbook wookbook = WorkbookFactory.create(multipartFile.getInputStream());
|
|
||||||
Sheet sheet = wookbook.getSheetAt(0);
|
|
||||||
DataFormatter dataFormatter = new DataFormatter();
|
|
||||||
//获得表头
|
|
||||||
Row rowHead = sheet.getRow(0);
|
|
||||||
|
|
||||||
System.out.println("getPhysicalNumberOfCells -> "+rowHead.getPhysicalNumberOfCells());
|
|
||||||
//判断表头是否正确
|
|
||||||
if(true){
|
|
||||||
//获得数据的总行数
|
|
||||||
int totalRowNum = sheet.getLastRowNum();
|
|
||||||
|
|
||||||
if(totalRowNum > 0){
|
|
||||||
|
|
||||||
Boolean isSubject = true;
|
|
||||||
|
|
||||||
String superId = "510114102000";
|
|
||||||
|
|
||||||
//获得所有数据
|
|
||||||
for(int i = 1 ; i <= totalRowNum ; i++) {
|
|
||||||
|
|
||||||
int index = i + 1;
|
|
||||||
//获得第i行对象
|
|
||||||
Row row = sheet.getRow(i);
|
|
||||||
if (null == row) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
String userName = "";
|
|
||||||
String mobile = "";
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Cell cell = row.getCell((short) 1);
|
|
||||||
if (null != cell) {
|
|
||||||
userName = dataFormatter.formatCellValue(cell);
|
|
||||||
}
|
|
||||||
|
|
||||||
cell = row.getCell((short) 2);
|
|
||||||
if (null != cell) {
|
|
||||||
mobile = dataFormatter.formatCellValue(cell);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
userName = StringUtils.replaceBlank(userName);
|
|
||||||
mobile = StringUtils.replaceBlank(mobile);
|
|
||||||
|
|
||||||
|
|
||||||
List<String> entNames = new ArrayList<>();
|
|
||||||
for (int j = 3;j<=24;j++){
|
|
||||||
cell = row.getCell((short) j);
|
|
||||||
if (null != cell) {
|
|
||||||
String entName = dataFormatter.formatCellValue(cell);
|
|
||||||
if(StringUtils.isNotBlank(entName)){
|
|
||||||
entName = StringUtils.replaceBlank(entName);
|
|
||||||
entNames.add(entName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println(userName+" - "+mobile);
|
|
||||||
System.out.println("entNames -> "+JSONArray.toJSONString(entNames));
|
|
||||||
|
|
||||||
SysUser sysUser = sysUserMapper.findByStreetAndName(superId,userName,mobile);
|
|
||||||
if(null != sysUser){
|
|
||||||
for (String entName : entNames){
|
|
||||||
SysEnterprise enterprise = sysEnterpriseMapper.findByName(entName);
|
|
||||||
if(null != enterprise){
|
|
||||||
DutyTree dutyTree = new DutyTree();
|
|
||||||
dutyTree.setDutyTreeId(RandomNumber.getUUid());
|
|
||||||
dutyTree.setUserId(sysUser.getSysuserid());
|
|
||||||
dutyTree.setTargetId(enterprise.getSysenterpriseid());
|
|
||||||
dutyTree.setTargetType(2);
|
|
||||||
dutyTree.setModified("导入");
|
|
||||||
dutyTree.setModifyTime(new Date());
|
|
||||||
dutyTree.setCreated("导入");
|
|
||||||
dutyTree.setCreateTime(new Date());
|
|
||||||
dutyTreeMapper.insert(dutyTree);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
System.out.println();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "履职处理", notes = "履职处理")
|
|
||||||
@RequestMapping(value = "/handleFactor", method = RequestMethod.POST)
|
|
||||||
@ResponseBody
|
|
||||||
public SingleResult<String> handleFactor()throws Exception{
|
|
||||||
SingleResult<String> result = new SingleResult<>();
|
|
||||||
|
|
||||||
//超级管理员
|
|
||||||
String userId = "8D35010B-EB9A-40EE-BDEB-CDAE969D5EF4";
|
|
||||||
|
|
||||||
Integer nowYear = Calendar.getInstance().get(Calendar.YEAR);
|
|
||||||
Integer lastYear = nowYear - 1;
|
|
||||||
|
|
||||||
System.out.println("nowYear -> "+nowYear);
|
|
||||||
System.out.println("lastYear -> "+lastYear);
|
|
||||||
|
|
||||||
List<ListFactor> listFactors = listFactorMapper.findBySysYear(lastYear+"");
|
|
||||||
for(ListFactor listFactor : listFactors){
|
|
||||||
listFactor.setListfactorid(RandomNumber.getUUid());
|
|
||||||
listFactor.setIsfinish("否");
|
|
||||||
listFactor.setFinishProgres(0+"");
|
|
||||||
listFactor.setSysyear(nowYear+"");
|
|
||||||
listFactor.setDelState(DelState.NOT_DEL.getState());
|
|
||||||
listFactor.setCreatedby("导入");
|
|
||||||
listFactor.setCreatedon(new Date());
|
|
||||||
listFactor.setModifiedby("导入");
|
|
||||||
listFactor.setModifiedon(new Date());
|
|
||||||
listFactorMapper.insert(listFactor);
|
|
||||||
addFactorTask(listFactor,userId);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "三方机构隐患", notes = "三方机构隐患")
|
|
||||||
@RequestMapping(value = "/handleDanger", method = RequestMethod.POST)
|
|
||||||
@ResponseBody
|
|
||||||
public SingleResult<String> handleDanger()throws Exception{
|
|
||||||
SingleResult<String> result = new SingleResult<>();
|
|
||||||
|
|
||||||
|
|
||||||
List<OrgDanger> orgDangers = orgDangerMapper.findAll();
|
|
||||||
for(OrgDanger orgDanger : orgDangers){
|
|
||||||
System.out.println("-------------> "+orgDanger.getContent());
|
|
||||||
|
|
||||||
OrgBatch orgBatch = orgBatchMapper.findById(orgDanger.getBatchId());
|
|
||||||
if(null == orgBatch){
|
|
||||||
orgBatch = new OrgBatch();
|
|
||||||
orgBatch.setBatchId(orgDanger.getBatchId());
|
|
||||||
orgBatch.setUserId(orgDanger.getCreated());
|
|
||||||
orgBatch.setEnterpriseId(orgDanger.getEnterpriseId());
|
|
||||||
orgBatch.setOrganizationId(orgDanger.getOrganizationId());
|
|
||||||
orgBatch.setOrgType(1);
|
|
||||||
orgBatch.setCreated(orgDanger.getCreated());
|
|
||||||
orgBatch.setCreateTime(orgDanger.getCreateTime());
|
|
||||||
orgBatch.setModify(orgDanger.getCreated());
|
|
||||||
orgBatch.setModifyTime(orgDanger.getCreateTime());
|
|
||||||
orgBatchMapper.insert(orgBatch);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 导入模板
|
|
||||||
* @version v1.0
|
|
||||||
* @author dong
|
|
||||||
* @date 2022/8/5 13:36
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "导入模板", notes = "导入模板")
|
|
||||||
@RequestMapping(value = "/addTemp", method = RequestMethod.GET)
|
|
||||||
@ResponseBody
|
|
||||||
public SingleResult<String> addTemp()throws Exception{
|
|
||||||
SingleResult<String> result = new SingleResult<>();
|
|
||||||
String path = "C:\\mnt\\resource\\citysafexc\\documenttemp";
|
|
||||||
File file = new File(path);
|
|
||||||
File[] tempList = file.listFiles();
|
|
||||||
for (int i = 0; i < tempList.length; i++) {
|
|
||||||
if (tempList[i].isFile()) {
|
|
||||||
|
|
||||||
|
|
||||||
String name = tempList[i].getName();
|
|
||||||
String sortStr = name.substring(0,2);
|
|
||||||
SysDocumenttemp temp = new SysDocumenttemp();
|
|
||||||
temp.setTempId(RandomNumber.getUUid());
|
|
||||||
temp.setCreateTime(new Date());
|
|
||||||
temp.setModifyTime(new Date());
|
|
||||||
temp.setCreateBy("excel");
|
|
||||||
temp.setModifyBy("excel");
|
|
||||||
temp.setTempName(name);
|
|
||||||
temp.setSortId(TypeConversion.StringToInteger(sortStr));
|
|
||||||
temp.setTempPath("resource/citysafexc/documenttemp/"+name);
|
|
||||||
sysDocumenttempMapper.insert(temp);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改密码
|
* 修改密码
|
||||||
* @version v1.0
|
* @version v1.0
|
||||||
|
|
@ -1217,4 +679,43 @@ public class DataController extends com.rzyc.controller.BaseController {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 年度履职清单迁移
|
||||||
|
* @version v1.0
|
||||||
|
* @author dong
|
||||||
|
* @date 2023/12/25 14:37
|
||||||
|
*/
|
||||||
|
@ApiOperation(value = "年度履职清单迁移", notes = "年度履职清单迁移")
|
||||||
|
@RequestMapping(value = "/listMigrate", method = RequestMethod.GET)
|
||||||
|
@ResponseBody
|
||||||
|
public SingleResult<String> listMigrate(Integer year)throws Exception{
|
||||||
|
SingleResult<String> result = new SingleResult<>();
|
||||||
|
String userId = "系统自动处理";
|
||||||
|
List<ListFactor> factors = listFactorMapper.findAllByYear(year+"");
|
||||||
|
Integer nowYear = year + 1;
|
||||||
|
for (ListFactor listFactor : factors){
|
||||||
|
System.out.println("履职清单内容 ---> "+listFactor.getFactorcnt());
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
ListFactor factor = new ListFactor();
|
||||||
|
factor = listFactor;
|
||||||
|
|
||||||
|
factor.setListfactorid(RandomNumber.getUUid());
|
||||||
|
factor.setCreatedby(userId);
|
||||||
|
factor.setCreatedon(new Date());
|
||||||
|
factor.setModifiedby(userId);
|
||||||
|
factor.setModifiedon(new Date());
|
||||||
|
factor.setSysyear(nowYear+"");
|
||||||
|
listFactorMapper.insert(factor);
|
||||||
|
|
||||||
|
//添加任务
|
||||||
|
addFactorTask(factor,userId);
|
||||||
|
|
||||||
|
listPerformMapper.changeCompletion(factor.getListperformid(),"0");
|
||||||
|
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,138 +0,0 @@
|
||||||
package com.rzyc.controller;
|
|
||||||
|
|
||||||
import com.common.utils.RandomNumber;
|
|
||||||
import com.common.utils.StringUtils;
|
|
||||||
import com.common.utils.model.MultiResult;
|
|
||||||
import com.common.utils.model.SingleResult;
|
|
||||||
import com.rzyc.bean.task.dto.AddTaskDto;
|
|
||||||
import com.rzyc.bean.task.dto.IdDto;
|
|
||||||
import com.rzyc.bean.task.vo.ThingVo;
|
|
||||||
import com.rzyc.model.OADistribution;
|
|
||||||
import com.rzyc.model.OATask;
|
|
||||||
import com.rzyc.model.task.dto.TaskAddOrUpdateDto;
|
|
||||||
import com.rzyc.model.user.SysUser;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiImplicitParams;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.apache.commons.beanutils.BeanUtils;
|
|
||||||
import org.apache.commons.beanutils.ConvertUtils;
|
|
||||||
import org.apache.commons.beanutils.converters.DateConverter;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName: TaskController
|
|
||||||
* @description:
|
|
||||||
* @author: ZQW
|
|
||||||
* * @create: 2022-09-20 15:21
|
|
||||||
**/
|
|
||||||
|
|
||||||
@Api(tags = "可删除控制层")
|
|
||||||
@CrossOrigin("*")
|
|
||||||
@RequestMapping("delete")
|
|
||||||
@RestController
|
|
||||||
@Validated
|
|
||||||
public class DeleteController extends BaseController{
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return: 新增任务执行情况
|
|
||||||
* @Author: ZQW
|
|
||||||
* @Date: 2022/9/20
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "新增任务执行情况",position = 10)
|
|
||||||
@PostMapping()
|
|
||||||
public SingleResult<String> addTask(@Valid TaskAddOrUpdateDto addTaskDto) throws Exception{
|
|
||||||
SingleResult<String> result = new SingleResult<>();
|
|
||||||
OADistribution oaDistribution = new OADistribution();
|
|
||||||
BeanUtils.copyProperties(oaDistribution,addTaskDto);
|
|
||||||
//日期格式转换
|
|
||||||
ConvertUtils.register(new DateConverter(null), Date.class);
|
|
||||||
|
|
||||||
SysUser sysUser = sysUserMapper.selectByPrimaryKey(addTaskDto.getSysuserid());
|
|
||||||
if(null == sysUser){
|
|
||||||
result.setCode(0);
|
|
||||||
result.setMessage("用户不存在");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(StringUtils.isBlank(addTaskDto.getOadistributionid())){
|
|
||||||
oaDistribution.setOadistributionid(RandomNumber.getUUid());
|
|
||||||
oaDistribution.setSyschinaname(sysUser.getChinaname());
|
|
||||||
oaDistribution.setSystelephone(sysUser.getMobiletel());
|
|
||||||
oaDistribution.setCreatedby(getChinaName());
|
|
||||||
oaDistribution.setCreatedon(new Date());
|
|
||||||
oaDistributionMapper.insert(oaDistribution);
|
|
||||||
}else {
|
|
||||||
oaDistribution.setModifiedby(getChinaName());
|
|
||||||
oaDistribution.setModifiedon(new Date());
|
|
||||||
oaDistributionMapper.updateById(oaDistribution);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return: 查询任务
|
|
||||||
* @Author: ZQW
|
|
||||||
* @Date: 2022/9/20
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "查询我发布的任务",position = 2)
|
|
||||||
@ApiImplicitParams(value = {
|
|
||||||
@ApiImplicitParam(name = "id",value = "指派用户id")
|
|
||||||
})
|
|
||||||
@GetMapping("deliverTaskList")
|
|
||||||
public MultiResult<OADistribution> deliverTaskList(@Valid IdDto idDto){
|
|
||||||
MultiResult<OADistribution> result = new MultiResult<>();
|
|
||||||
List<OADistribution> oaTasks = oaDistributionMapper.deliverTaskList("%%",idDto.getId());
|
|
||||||
if(oaTasks != null){
|
|
||||||
result.setData(oaTasks);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @Description: 查询我收到的任务
|
|
||||||
* @Author ZQW
|
|
||||||
* @CreateTime 2022/9/26 9:34
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "查询我收到的任务",position = 3)
|
|
||||||
@ApiImplicitParams(value = {
|
|
||||||
@ApiImplicitParam(name = "id",value = "接收用户id")
|
|
||||||
})
|
|
||||||
@GetMapping("getTaskList")
|
|
||||||
public MultiResult<OADistribution> getTaskList(@Valid IdDto idDto){
|
|
||||||
MultiResult<OADistribution> result = new MultiResult<>();
|
|
||||||
List<OADistribution> oaTasks = oaDistributionMapper.getTaskList("%%",idDto.getId());
|
|
||||||
if(oaTasks != null){
|
|
||||||
result.setData(oaTasks);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return: 查询任务
|
|
||||||
* @Author: ZQW
|
|
||||||
* @Date: 2022/9/20
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "查询任务",position = 10)
|
|
||||||
@GetMapping("taskList")
|
|
||||||
public MultiResult<OATask> taskList(){
|
|
||||||
MultiResult<OATask> result = new MultiResult<>();
|
|
||||||
List<OATask> oaTasks = oaTaskMapper.taskList("%%");
|
|
||||||
result.setData(oaTasks);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -1,181 +0,0 @@
|
||||||
package com.rzyc.controller;
|
|
||||||
|
|
||||||
import com.common.utils.DateUtils;
|
|
||||||
import com.common.utils.TypeConversion;
|
|
||||||
import com.common.utils.model.*;
|
|
||||||
import com.github.pagehelper.Page;
|
|
||||||
import com.github.pagehelper.PageHelper;
|
|
||||||
import com.rzyc.advice.LoginAuth;
|
|
||||||
import com.rzyc.bean.dynamic.DynamicPageDto;
|
|
||||||
import com.rzyc.bean.dynamic.dto.ChangeDynamicDto;
|
|
||||||
import com.rzyc.enums.DelState;
|
|
||||||
import com.rzyc.model.Dynamic;
|
|
||||||
import com.rzyc.model.NewsClass;
|
|
||||||
import com.rzyc.model.NewsCnt;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.apache.commons.beanutils.BeanUtils;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Api(tags = "动态")
|
|
||||||
@CrossOrigin("*")
|
|
||||||
@RequestMapping("dynamic")
|
|
||||||
@Controller
|
|
||||||
@Validated
|
|
||||||
public class DynamicController extends com.rzyc.controller.BaseController {
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 动态分页
|
|
||||||
* @return<
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "动态分页", notes = "动态分页")
|
|
||||||
@PostMapping("/dynamicPage")
|
|
||||||
@ResponseBody
|
|
||||||
@LoginAuth
|
|
||||||
public SingleResult<Pager<Dynamic>> dynamicPage(@Valid DynamicPageDto dynamicPageDto)throws Exception{
|
|
||||||
SingleResult<Pager<Dynamic>> result = new SingleResult<>();
|
|
||||||
String condition = TypeConversion.getCondition(dynamicPageDto.getCondition());
|
|
||||||
PageHelper.startPage(dynamicPageDto.getPage(), dynamicPageDto.getPageSize());
|
|
||||||
Page<Dynamic> page = (Page<Dynamic>)newsCntMapper.newsCntList(dynamicPageDto.getNewsClassId(),condition);
|
|
||||||
Pager<Dynamic> pager = new Pager<>();
|
|
||||||
getDatePage(pager,page);
|
|
||||||
if(pager.getRows().size() > 0){
|
|
||||||
for (Dynamic dynamic : pager.getRows()){
|
|
||||||
handleDynamic(dynamic);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
result.setData(pager);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 动态分类列表
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "动态分类列表", notes = "动态分类列表")
|
|
||||||
@PostMapping("/newsClassList")
|
|
||||||
@ResponseBody
|
|
||||||
@LoginAuth
|
|
||||||
public MultiResult<NewsClass> newsClassList()throws Exception{
|
|
||||||
MultiResult<NewsClass> result = new MultiResult<>();
|
|
||||||
List<NewsClass> newsClasses = newsClassMapper.findAll();
|
|
||||||
if(newsClasses.size() > 0){
|
|
||||||
result.setData(newsClasses);
|
|
||||||
}else{
|
|
||||||
result.setCode(Code.NO_DATA.getCode());
|
|
||||||
result.setMessage(Message.NO_DATA);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 动态详情
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "动态详情", notes = "动态详情")
|
|
||||||
@ApiImplicitParam(name = "dynamicId",value = "动态id")
|
|
||||||
@PostMapping("/dynamicDetail/{dynamicId}")
|
|
||||||
@ResponseBody
|
|
||||||
@LoginAuth
|
|
||||||
public SingleResult<NewsCnt> dynamicDetail(@PathVariable String dynamicId)throws Exception{
|
|
||||||
SingleResult<NewsCnt> result = new SingleResult<>();
|
|
||||||
|
|
||||||
NewsCnt newsCnt = newsCntMapper.findById(dynamicId);
|
|
||||||
if(null != newsCnt){
|
|
||||||
// newsCnt.setCoverImage(setServiceFile(newsCnt.getCoverImage()));
|
|
||||||
result.setData(newsCnt);
|
|
||||||
}else{
|
|
||||||
result.setCode(Code.NO_DATA.getCode());
|
|
||||||
result.setMessage(Message.NO_DATA);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*Dynamic dynamic = newsCntMapper.newCntDetail(dynamicId);
|
|
||||||
if(null != dynamic){
|
|
||||||
handleDynamic(dynamic);
|
|
||||||
result.setData(dynamic);
|
|
||||||
}else{
|
|
||||||
result.setCode(Code.NO_DATA.getCode());
|
|
||||||
result.setMessage(Message.NO_DATA);
|
|
||||||
}*/
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改新增动态
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "修改新增动态", notes = "修改新增动态")
|
|
||||||
@PostMapping("changeDynamic")
|
|
||||||
@ResponseBody
|
|
||||||
@LoginAuth
|
|
||||||
public SingleResult<String> changeDynamic(@Valid @RequestBody ChangeDynamicDto changeDynamicDto)throws Exception{
|
|
||||||
SingleResult<String> result = new SingleResult<>();
|
|
||||||
NewsCnt newsCnt = new NewsCnt();
|
|
||||||
BeanUtils.copyProperties(newsCnt,changeDynamicDto);
|
|
||||||
|
|
||||||
//操作人
|
|
||||||
String chinaName = getChinaName();
|
|
||||||
newsCnt.setModifiedby(chinaName);
|
|
||||||
newsCnt.setCreatedby(chinaName);
|
|
||||||
newsCnt.setModifiedon(new Date());
|
|
||||||
newsCnt.setCreatedon(new Date());
|
|
||||||
newsCnt.setDelState(DelState.NOT_DEL.getState());
|
|
||||||
|
|
||||||
//封面图
|
|
||||||
// newsCnt.setCoverImage(delServiceFile(changeDynamicDto.getShowImageUrl()));
|
|
||||||
newsCnt.setCoverImage(changeDynamicDto.getShowImageUrl());
|
|
||||||
|
|
||||||
newsCnt.setPublictime(DateUtils.parseString2Date(changeDynamicDto.getPublicTime(),"yyyy-MM-dd HH:mm"));
|
|
||||||
|
|
||||||
Dynamic dynamic = newsCntMapper.newCntDetail(newsCnt.getNewscntid());
|
|
||||||
if(null != dynamic){
|
|
||||||
//修改
|
|
||||||
newsCntMapper.changeNews(newsCnt);
|
|
||||||
}else{
|
|
||||||
//新增
|
|
||||||
newsCntMapper.insert(newsCnt);
|
|
||||||
}
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除动态
|
|
||||||
* @param dynamicId
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "删除动态", notes = "删除动态")
|
|
||||||
@ApiImplicitParam(name = "dynamicId",value = "动态id 多个逗号隔开",required = true)
|
|
||||||
@PostMapping("delNewsCnt")
|
|
||||||
@ResponseBody
|
|
||||||
@LoginAuth
|
|
||||||
public SingleResult<String> delNewsCnt(String dynamicId)throws Exception{
|
|
||||||
SingleResult<String> result = new SingleResult<>();
|
|
||||||
String[] strs = dynamicId.split(",");
|
|
||||||
//操作人
|
|
||||||
String chinaName = getChinaName();
|
|
||||||
if(strs.length > 0){
|
|
||||||
for (String str : strs){
|
|
||||||
NewsCnt newsCnt = newsCntMapper.findById(str);
|
|
||||||
if(null != newsCnt){
|
|
||||||
newsCntMapper.delNewsCnt(newsCnt.getNewscntid(),chinaName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,419 +0,0 @@
|
||||||
package com.rzyc.controller;
|
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
|
||||||
import com.alibaba.fastjson.JSONArray;
|
|
||||||
import com.common.utils.RandomNumber;
|
|
||||||
import com.common.utils.StringUtils;
|
|
||||||
import com.common.utils.TypeConversion;
|
|
||||||
import com.common.utils.model.MultiResult;
|
|
||||||
import com.common.utils.model.Pager;
|
|
||||||
import com.common.utils.model.SingleResult;
|
|
||||||
import com.github.pagehelper.Page;
|
|
||||||
import com.github.pagehelper.PageHelper;
|
|
||||||
import com.rzyc.bean.emergency.*;
|
|
||||||
import com.rzyc.bean.emergency.dto.*;
|
|
||||||
import com.rzyc.enums.ManualLableType;
|
|
||||||
import com.rzyc.model.oth.*;
|
|
||||||
import io.swagger.annotations.Api;
|
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.apache.commons.beanutils.BeanUtils;
|
|
||||||
import org.springframework.stereotype.Controller;
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 电子工作手册
|
|
||||||
*/
|
|
||||||
@Api(tags = "电子工作手册")
|
|
||||||
@CrossOrigin("*")
|
|
||||||
@RequestMapping("manual")
|
|
||||||
@Controller
|
|
||||||
@Validated
|
|
||||||
public class ManualController extends BaseController{
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "预案树形", notes = "预案树形")
|
|
||||||
@GetMapping("/planTree")
|
|
||||||
@ResponseBody
|
|
||||||
public MultiResult<PlanList> planTree()throws Exception{
|
|
||||||
MultiResult<PlanList> result = new MultiResult<>();
|
|
||||||
List<PlanList> planLists = new ArrayList<>();
|
|
||||||
|
|
||||||
//预案分类
|
|
||||||
List<OthType> othTypes = othTypeMapper.selectList();
|
|
||||||
if(null != othTypes && othTypes.size() > 0){
|
|
||||||
for (OthType othType :othTypes){
|
|
||||||
PlanList planList = new PlanList();
|
|
||||||
planList.setOthplanid(othType.getOthtypeid());
|
|
||||||
planList.setPlanname(othType.getOthtypename());
|
|
||||||
planLists.add(planList);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//预案列表
|
|
||||||
List<PlanList> plans = othPlanMapper.planList();
|
|
||||||
if(null != plans && plans.size() > 0){
|
|
||||||
planLists.addAll(plans);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(planLists.size() > 0){
|
|
||||||
//处理树形结构
|
|
||||||
JSONArray jsonArray = handleAreaTree(planLists);
|
|
||||||
List<PlanList> parseArray = JSONArray.parseArray(JSONArray.toJSONString(jsonArray),PlanList.class);
|
|
||||||
result.setData(parseArray);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 预案树形结构
|
|
||||||
* @param planLists
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
private JSONArray handleAreaTree(List<PlanList> planLists)throws Exception{
|
|
||||||
List<Map<String,Object>> data = new ArrayList<>();
|
|
||||||
for(PlanList planList : planLists){
|
|
||||||
if(StringUtils.isBlank(planList.getParentId())){
|
|
||||||
planList.setParentId("");
|
|
||||||
}
|
|
||||||
Map<String,Object> entUserMap = new HashMap<String,Object>();
|
|
||||||
entUserMap.put("othplanid",planList.getOthplanid());
|
|
||||||
entUserMap.put("planname",planList.getPlanname());
|
|
||||||
entUserMap.put("parentId",planList.getParentId());
|
|
||||||
|
|
||||||
data.add(entUserMap);
|
|
||||||
}
|
|
||||||
JSONArray result = TypeConversion.listToTree(JSONArray.parseArray(JSON.toJSONString(data)),"othplanid","parentId","children");
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工作手册修改或新增
|
|
||||||
* @param manualChangeDto
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "工作手册修改或新增", notes = "工作手册修改或新增")
|
|
||||||
@PostMapping("/manualChange")
|
|
||||||
@ResponseBody
|
|
||||||
public SingleResult<String> manualChange(@Valid @RequestBody ManualChangeDto manualChangeDto)throws Exception{
|
|
||||||
SingleResult<String> result = new SingleResult<>();
|
|
||||||
Manual manual = new Manual();
|
|
||||||
String userId = getUserId();
|
|
||||||
BeanUtils.copyProperties(manual,manualChangeDto);
|
|
||||||
manual.setModifyTime(new Date());
|
|
||||||
manual.setModified(userId);
|
|
||||||
Manual oldmanual = manualMapper.selectById(manualChangeDto.getManualId());
|
|
||||||
if(null != oldmanual){
|
|
||||||
manualMapper.updateById(manual);
|
|
||||||
}else{
|
|
||||||
manual.setCreated(userId);
|
|
||||||
manual.setCreateTime(new Date());
|
|
||||||
manualMapper.insert(manual);
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工作手册分页
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "工作手册分页", notes = "工作手册分页")
|
|
||||||
@GetMapping("/manualPage")
|
|
||||||
@ResponseBody
|
|
||||||
public SingleResult<Pager<Manual>> manualPage(@Valid ManualPageDto manualPageDto)throws Exception{
|
|
||||||
SingleResult<Pager<Manual>> result = new SingleResult<>();
|
|
||||||
Pager<Manual> pager = new Pager<>();
|
|
||||||
String condition = TypeConversion.getCondition(manualPageDto.getCondition());
|
|
||||||
PageHelper.startPage(manualPageDto.getPage(), manualPageDto.getPageSize());
|
|
||||||
Page<Manual> page = (Page<Manual>) manualMapper.manualList(condition);
|
|
||||||
getDatePage(pager,page);
|
|
||||||
result.setData(pager);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工作手册标签新增
|
|
||||||
* @param manualLableAddDto
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "工作手册标签新增", notes = "工作手册标签新增")
|
|
||||||
@PostMapping("/manualLableAdd")
|
|
||||||
@ResponseBody
|
|
||||||
public SingleResult<String> manualLableAdd(@Valid ManualLableAddDto manualLableAddDto)throws Exception{
|
|
||||||
SingleResult<String> result = new SingleResult<>();
|
|
||||||
String userId = getUserId();
|
|
||||||
ManualLable manualLable = new ManualLable();
|
|
||||||
BeanUtils.copyProperties(manualLable,manualLableAddDto);
|
|
||||||
manualLable.setLableId(RandomNumber.getUUid());
|
|
||||||
manualLable.setCreated(userId);
|
|
||||||
manualLable.setCreateTime(new Date());
|
|
||||||
manualLableMapper.insert(manualLable);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工作手册标签删除
|
|
||||||
* @param lableId
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "工作手册标签删除", notes = "工作手册标签删除")
|
|
||||||
@PostMapping("/manualLableDel/{lableId}")
|
|
||||||
@ApiImplicitParam(name = "lableId",value = "标签id",required = true)
|
|
||||||
@ResponseBody
|
|
||||||
public SingleResult<String> manualLableDel(@PathVariable String lableId)throws Exception{
|
|
||||||
SingleResult<String> result = new SingleResult<>();
|
|
||||||
manualLableMapper.deleteById(lableId);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工作手册标签列表
|
|
||||||
* @param manualLableListDto
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "工作手册标签列表", notes = "工作手册标签列表")
|
|
||||||
@GetMapping("/manualLableList")
|
|
||||||
@ResponseBody
|
|
||||||
public MultiResult<ManualLable> manualLableList(@Valid ManualLableListDto manualLableListDto)throws Exception{
|
|
||||||
MultiResult<ManualLable> result = new MultiResult<>();
|
|
||||||
List<ManualLable> manualLables = manualLableMapper.findByLableType(manualLableListDto.getManualId(),manualLableListDto.getLableType());
|
|
||||||
result.setData(manualLables);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工作手册内容新增
|
|
||||||
* @param contentAddDto
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "工作手册内容新增", notes = "工作手册标签列表")
|
|
||||||
@PostMapping("/manualContentAdd")
|
|
||||||
@ResponseBody
|
|
||||||
@Transactional
|
|
||||||
public SingleResult<String> manualContentAdd(@Valid @RequestBody ContentAddDto contentAddDto)throws Exception{
|
|
||||||
SingleResult<String> result = new SingleResult<>();
|
|
||||||
|
|
||||||
|
|
||||||
String userId = getUserId();
|
|
||||||
|
|
||||||
//工作手册等级列表
|
|
||||||
List<ManualLevel> manualLevels = new ArrayList<>();
|
|
||||||
|
|
||||||
//工作手册时间列表
|
|
||||||
List<ManualTime> manualTimes = new ArrayList<>();
|
|
||||||
|
|
||||||
//工作手册措施
|
|
||||||
List<ManualMeasures> manualMeasures = new ArrayList<>();
|
|
||||||
|
|
||||||
//工作手册措施标签
|
|
||||||
List<MaMeasuresLable> lables = new ArrayList<>();
|
|
||||||
|
|
||||||
//当前时间
|
|
||||||
Date nowDate = new Date();
|
|
||||||
|
|
||||||
//新增工作手册内容
|
|
||||||
String manualId = contentAddDto.getManualId();
|
|
||||||
//响应级别
|
|
||||||
List<ManualLevelDto> levelDtos = contentAddDto.getLevelDtos();
|
|
||||||
for (ManualLevelDto manualLevelDto : levelDtos){
|
|
||||||
|
|
||||||
//响应级别
|
|
||||||
ManualLevel manualLevel = new ManualLevel();
|
|
||||||
manualLevel.setLevelId(RandomNumber.getUUid());
|
|
||||||
manualLevel.setManualId(manualId);
|
|
||||||
manualLevel.setLevelNum(manualLevelDto.getLevelNum());
|
|
||||||
manualLevel.setManualDesc(manualLevelDto.getManualDesc());
|
|
||||||
manualLevel.setCreated(userId);
|
|
||||||
manualLevel.setCreateTime(nowDate);
|
|
||||||
manualLevels.add(manualLevel);
|
|
||||||
|
|
||||||
//响应时间处理
|
|
||||||
List<ManualTimeDto> timeDtos = manualLevelDto.getChildren();
|
|
||||||
if(null != timeDtos){
|
|
||||||
for (ManualTimeDto manualTimeDto : timeDtos){
|
|
||||||
ManualTime manualTime = new ManualTime();
|
|
||||||
manualTime.setTimeId(RandomNumber.getUUid());
|
|
||||||
manualTime.setManualId(manualId);
|
|
||||||
manualTime.setLevelId(manualLevel.getLevelId());
|
|
||||||
manualTime.setTimeDesc(manualTimeDto.getTimeDesc());
|
|
||||||
manualTime.setSortId(manualTimeDto.getSortId());
|
|
||||||
manualTime.setCreateTime(nowDate);
|
|
||||||
manualTime.setCreated(userId);
|
|
||||||
manualTimes.add(manualTime);
|
|
||||||
|
|
||||||
//处置措施
|
|
||||||
List<ManualMeasuresDto> measuresDtos = manualTimeDto.getChildren();
|
|
||||||
if(null != measuresDtos && measuresDtos.size() > 0){
|
|
||||||
for (ManualMeasuresDto measuresDto : measuresDtos){
|
|
||||||
ManualMeasures measures = new ManualMeasures();
|
|
||||||
measures.setMeasuresId(RandomNumber.getUUid());
|
|
||||||
measures.setManualId(manualId);
|
|
||||||
measures.setLevelId(manualLevel.getLevelId());
|
|
||||||
measures.setTimeId(manualTime.getTimeId());
|
|
||||||
measures.setMeasuresDesc(measuresDto.getMeasuresDesc());
|
|
||||||
measures.setSortId(measuresDto.getSortId());
|
|
||||||
measures.setDutyId(measuresDto.getDutyIds());
|
|
||||||
measures.setLeadId(measuresDto.getLeadIds());
|
|
||||||
measures.setWorkId(measuresDto.getWorkIds());
|
|
||||||
measures.setDepartmentId(measuresDto.getDepartmentId());
|
|
||||||
measures.setCreated(userId);
|
|
||||||
measures.setCreateTime(nowDate);
|
|
||||||
manualMeasures.add(measures);
|
|
||||||
|
|
||||||
//责任组
|
|
||||||
lables.addAll(handleIds(measuresDto.getDutyIds(), ManualLableType.DUTY.getType(),
|
|
||||||
manualId,measures.getMeasuresId(),userId,nowDate));
|
|
||||||
|
|
||||||
//牵头部门
|
|
||||||
lables.addAll(handleIds(measuresDto.getLeadIds(), ManualLableType.LEAD.getType(),
|
|
||||||
manualId,measures.getMeasuresId(),userId,nowDate));
|
|
||||||
|
|
||||||
//牵头部门
|
|
||||||
lables.addAll(handleIds(measuresDto.getWorkIds(), ManualLableType.WORK.getType(),
|
|
||||||
manualId,measures.getMeasuresId(),userId,nowDate));
|
|
||||||
|
|
||||||
//牵头部门
|
|
||||||
lables.addAll(handleIds(measuresDto.getDepartmentId(), ManualLableType.DEPARTMENT.getType(),
|
|
||||||
manualId,measures.getMeasuresId(),userId,nowDate));
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//先删除之前的数据
|
|
||||||
//响应级别
|
|
||||||
manualLevelMapper.delByManualId(manualId);
|
|
||||||
//时间
|
|
||||||
manualTimeMapper.delByManualId(manualId);
|
|
||||||
//处置措施
|
|
||||||
manualMeasuresMapper.delByManualId(manualId);
|
|
||||||
//处置措施标签
|
|
||||||
maMeasuresLableMapper.delByManualId(manualId);
|
|
||||||
|
|
||||||
//插入
|
|
||||||
manualLevelMapper.insertList(manualLevels);
|
|
||||||
//插入
|
|
||||||
manualTimeMapper.insertList(manualTimes);
|
|
||||||
//插入
|
|
||||||
manualMeasuresMapper.insertList(manualMeasures);
|
|
||||||
//插入
|
|
||||||
maMeasuresLableMapper.insertList(lables);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param ids
|
|
||||||
* @param type
|
|
||||||
* @param manualId
|
|
||||||
* @param measuresId
|
|
||||||
* @param userId
|
|
||||||
* @param nowDate
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
private List<MaMeasuresLable> handleIds(String ids,Integer type,
|
|
||||||
String manualId,String measuresId,
|
|
||||||
String userId,Date nowDate)throws Exception{
|
|
||||||
|
|
||||||
List<MaMeasuresLable> lables = new ArrayList<>();
|
|
||||||
if(StringUtils.isNotBlank(ids)){
|
|
||||||
String[] strs = ids.split(",");
|
|
||||||
for (String str : strs){
|
|
||||||
MaMeasuresLable maMeasuresLable = new MaMeasuresLable();
|
|
||||||
maMeasuresLable.setRelationId(RandomNumber.getUUid());
|
|
||||||
maMeasuresLable.setManualId(manualId);
|
|
||||||
maMeasuresLable.setMeasuresId(measuresId);
|
|
||||||
maMeasuresLable.setLableId(str);
|
|
||||||
maMeasuresLable.setLableType(type);
|
|
||||||
maMeasuresLable.setCreateTime(nowDate);
|
|
||||||
maMeasuresLable.setCreated(userId);
|
|
||||||
lables.add(maMeasuresLable);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return lables;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation(value = "工作手册内容树形", notes = "工作手册内容树形")
|
|
||||||
@GetMapping("/manualContent")
|
|
||||||
@ResponseBody
|
|
||||||
public MultiResult<ManualLevel> manualContent(@Valid ManualContentDto manualContentDto)throws Exception{
|
|
||||||
MultiResult<ManualLevel> result = new MultiResult<>();
|
|
||||||
|
|
||||||
manualContentDto.setDepartmentId(TypeConversion.getCondition(manualContentDto.getDepartmentId()));
|
|
||||||
manualContentDto.setDutyId(TypeConversion.getCondition(manualContentDto.getDutyId()));
|
|
||||||
manualContentDto.setWorkId(TypeConversion.getCondition(manualContentDto.getWorkId()));
|
|
||||||
manualContentDto.setLeadId(TypeConversion.getCondition(manualContentDto.getLeadId()));
|
|
||||||
|
|
||||||
List<ManualLevel> manualLevels = manualLevelMapper.manualDetail(manualContentDto.getManualId(),manualContentDto);
|
|
||||||
result.setData(manualLevels);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
@ApiOperation(value = "工作手册内容分页", notes = "工作手册内容分页")
|
|
||||||
@GetMapping("/manualContentPage")
|
|
||||||
@ResponseBody
|
|
||||||
public SingleResult<Pager<ManualDetail>> manualContentPage(@Valid ManualContentListDto manualContentListDto)throws Exception{
|
|
||||||
SingleResult<Pager<ManualDetail>> result = new SingleResult<>();
|
|
||||||
manualContentListDto.setDepartmentId(TypeConversion.getCondition(manualContentListDto.getDepartmentId()));
|
|
||||||
manualContentListDto.setDutyId(TypeConversion.getCondition(manualContentListDto.getDutyId()));
|
|
||||||
manualContentListDto.setWorkId(TypeConversion.getCondition(manualContentListDto.getWorkId()));
|
|
||||||
manualContentListDto.setLeadId(TypeConversion.getCondition(manualContentListDto.getLeadId()));
|
|
||||||
Pager<ManualDetail> pager = new Pager<>();
|
|
||||||
PageHelper.startPage(manualContentListDto.getPage(), manualContentListDto.getPageSize());
|
|
||||||
Page<ManualDetail> page = (Page<ManualDetail>) manualLevelMapper.manualLevelList(manualContentListDto.getManualId(),manualContentListDto);
|
|
||||||
getDatePage(pager,page);
|
|
||||||
result.setData(pager);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工作响应级别列表
|
|
||||||
* @param manualId
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "工作响应级别列表", notes = "工作响应级别列表")
|
|
||||||
@GetMapping("/manualLevelList/{manualId}")
|
|
||||||
@ApiImplicitParam(name = "manualId",value = "手册id",required = true)
|
|
||||||
@ResponseBody
|
|
||||||
public MultiResult<ManualLevel> manualLevelList(@PathVariable String manualId)throws Exception{
|
|
||||||
MultiResult<ManualLevel> result = new MultiResult<>();
|
|
||||||
List<ManualLevel> manualLevels = manualLevelMapper.findByManualId(manualId);
|
|
||||||
result.setData(manualLevels);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 工作手册响应级别处置时间列表
|
|
||||||
* @param levelId
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@ApiOperation(value = "工作手册响应级别处置时间列表", notes = "工作手册响应级别处置时间列表")
|
|
||||||
@GetMapping("/manualTimeList/{levelId}")
|
|
||||||
@ApiImplicitParam(name = "levelId",value = "响应级别id",required = true)
|
|
||||||
@ResponseBody
|
|
||||||
public MultiResult<ManualTime> manualTimeList(@PathVariable String levelId)throws Exception{
|
|
||||||
MultiResult<ManualTime> result = new MultiResult<>();
|
|
||||||
List<ManualTime> manualLevels = manualTimeMapper.findByLevelId(levelId);
|
|
||||||
result.setData(manualLevels);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
@ -45,19 +45,6 @@ public class OtherController extends BaseController{
|
||||||
@Autowired
|
@Autowired
|
||||||
private TaskService taskService;
|
private TaskService taskService;
|
||||||
|
|
||||||
/*动态详情*/
|
|
||||||
@GetMapping(value = "/dynamicDetail")
|
|
||||||
public String newsDetail(String dynamicId,Model model){
|
|
||||||
System.out.println("dynamicId --- > "+dynamicId);
|
|
||||||
Dynamic dynamic = newsCntMapper.newCntDetail(dynamicId);
|
|
||||||
if(null != dynamic){
|
|
||||||
dynamic.setTime(DateUtils.parseDate2String(dynamic.getPublictime(), "yyyy-MM-dd"));
|
|
||||||
}else{
|
|
||||||
dynamic = new Dynamic();
|
|
||||||
}
|
|
||||||
model.addAttribute("dynamic",dynamic);
|
|
||||||
return "dynamic/dynamic_detail";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取安全类型
|
* 获取安全类型
|
||||||
|
|
@ -144,164 +131,6 @@ public class OtherController extends BaseController{
|
||||||
return singleResult;
|
return singleResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查帮助
|
|
||||||
* @param model
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GetMapping("/govHelp")
|
|
||||||
public String govHelp(Model model){
|
|
||||||
String type = "GOV";
|
|
||||||
AppHelp appHelp = appHelpMapper.findByType(type);
|
|
||||||
if(null == appHelp){
|
|
||||||
appHelp = new AppHelp();
|
|
||||||
}
|
|
||||||
model.addAttribute("appHelp",appHelp);
|
|
||||||
return "help/gov_help";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查帮助
|
|
||||||
* @param model
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GetMapping("/entHelp")
|
|
||||||
public String entHelp(Model model){
|
|
||||||
String type = "ENT";
|
|
||||||
AppHelp appHelp = appHelpMapper.findByType(type);
|
|
||||||
if(null == appHelp){
|
|
||||||
appHelp = new AppHelp();
|
|
||||||
}
|
|
||||||
model.addAttribute("appHelp",appHelp);
|
|
||||||
return "help/ent_help";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 检查帮助
|
|
||||||
* @param model
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GetMapping("/appGovHelp")
|
|
||||||
public String appGovHelp(Model model){
|
|
||||||
String type = "GOV";
|
|
||||||
AppHelp appHelp = appHelpMapper.findByType(type);
|
|
||||||
if(null == appHelp){
|
|
||||||
appHelp = new AppHelp();
|
|
||||||
}
|
|
||||||
model.addAttribute("appHelp",appHelp);
|
|
||||||
return "help/app_gov_help";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 企业端检查帮助
|
|
||||||
* @param model
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@GetMapping("/appEntHelp")
|
|
||||||
public String appEntHelp(Model model){
|
|
||||||
String type = "ENT";
|
|
||||||
AppHelp appHelp = appHelpMapper.findByType(type);
|
|
||||||
if(null == appHelp){
|
|
||||||
appHelp = new AppHelp();
|
|
||||||
}
|
|
||||||
model.addAttribute("appHelp",appHelp);
|
|
||||||
return "help/app_ent_help";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改
|
|
||||||
* @param appHelp
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = "/changeGovHelp", method = RequestMethod.POST)
|
|
||||||
@ResponseBody
|
|
||||||
public String changeGovHelp(AppHelp appHelp){
|
|
||||||
appHelpMapper.changeAppHelp(appHelp);
|
|
||||||
return "success";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*导入企业清单*/
|
|
||||||
@GetMapping("/importList")
|
|
||||||
public String importList(){
|
|
||||||
return "import_list/import_list";
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 上传企业清单
|
|
||||||
* @param file
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@RequestMapping(value = "/uploadEntList", method = RequestMethod.POST)
|
|
||||||
@ResponseBody
|
|
||||||
public Map<String,Object> uploadEntList(@RequestBody MultipartFile file,String entName) {
|
|
||||||
Map<String,Object> resultMap = new HashMap<String,Object>();
|
|
||||||
resultMap.put("code",1);
|
|
||||||
try {
|
|
||||||
List<String> excelRow = new ArrayList<>();
|
|
||||||
if(StringUtils.isNotBlank(entName)){
|
|
||||||
System.out.println("entName -> "+entName);
|
|
||||||
System.out.println("file -> "+file.getOriginalFilename());
|
|
||||||
Map<String,Object> companyData = this.getCompanyData(file);//错误集合收集 get excelRow
|
|
||||||
//清单数据
|
|
||||||
List<ImportListDetail> listDetails = (List<ImportListDetail>)companyData.get("listDetails");
|
|
||||||
//出错数据
|
|
||||||
excelRow = (List<String>)companyData.get("excelRow");
|
|
||||||
if(null == excelRow ){
|
|
||||||
excelRow = new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
this.handleEntList(listDetails,excelRow,entName);
|
|
||||||
}else{
|
|
||||||
excelRow.add("请输入企业名");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
resultMap.put("excelRow",excelRow);
|
|
||||||
}catch (Exception e){
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return resultMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 处理企业清单
|
|
||||||
* @param listDetails
|
|
||||||
* @param excelRow
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
private void handleEntList(List<ImportListDetail> listDetails,List<String> excelRow,String entName)throws Exception{
|
|
||||||
if(null != listDetails && listDetails.size() > 0){
|
|
||||||
Integer listSort = 1;
|
|
||||||
|
|
||||||
List<SysEntListWithBLOBs> sysEntLists = new ArrayList<>();
|
|
||||||
List<String> sysUserIds = new ArrayList<>();
|
|
||||||
|
|
||||||
for (ImportListDetail listDetail : listDetails){
|
|
||||||
listDetail.setEntName(entName);
|
|
||||||
listDetail.setListSort(listSort);
|
|
||||||
System.out.println("listDetail -> "+JSONArray.toJSONString(listDetail));
|
|
||||||
String errorMsg = this.addEntList(listDetail,sysEntLists,sysUserIds);
|
|
||||||
if(StringUtils.isNotBlank(errorMsg)){
|
|
||||||
excelRow.add(errorMsg);
|
|
||||||
}
|
|
||||||
listSort++ ;
|
|
||||||
}
|
|
||||||
|
|
||||||
//先删除之前上传的企业清单
|
|
||||||
if(null != sysUserIds && sysUserIds.size() > 0 && null != sysEntLists && sysEntLists.size() > 0){
|
|
||||||
//删除企业清单
|
|
||||||
sysEntListMapper.delByListType(sysEntLists.get(0).getSysenterpriseid(),"","");
|
|
||||||
//上传企业清单
|
|
||||||
sysEntListMapper.insertList(sysEntLists);
|
|
||||||
//修改统计数据
|
|
||||||
super.changeEntListNum(sysEntLists.get(0).getSysenterpriseid(),"excel");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导入企业清单
|
* 导入企业清单
|
||||||
|
|
|
||||||
|
|
@ -66,8 +66,6 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "PC政府用户登录", notes = "PC政府用户登录")
|
@ApiOperation(value = "PC政府用户登录", notes = "PC政府用户登录")
|
||||||
@PostMapping(value = "/pclogin")
|
@PostMapping(value = "/pclogin")
|
||||||
/*@PreAuthorize("hasAnyAuthority('pclogin','pclogin:update')")
|
|
||||||
@MethodAnnotation(authorizations = {"pclogin","pclogin:update"},name = "PC政府用户登录")*/
|
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public SingleResult<SysUser> pclogin(@Valid LoginDto loginDto,HttpServletRequest request)throws Exception{
|
public SingleResult<SysUser> pclogin(@Valid LoginDto loginDto,HttpServletRequest request)throws Exception{
|
||||||
SingleResult<SysUser> result = new SingleResult<>();
|
SingleResult<SysUser> result = new SingleResult<>();
|
||||||
|
|
@ -453,6 +451,8 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
||||||
Integer day = DateUtils.getMonthLastDay(year,month);
|
Integer day = DateUtils.getMonthLastDay(year,month);
|
||||||
String startTime = year + "-" + month + "-" + day + " 23:59:59";
|
String startTime = year + "-" + month + "-" + day + " 23:59:59";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//任务完成状态
|
//任务完成状态
|
||||||
String completeState = "";
|
String completeState = "";
|
||||||
if(null != stayMatterDto.getCompleteState()){
|
if(null != stayMatterDto.getCompleteState()){
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user