Commit f6dbdec1 by 吴迪

Merge remote-tracking branch 'origin/master'

parents 32998fb7 80884866
...@@ -34,6 +34,8 @@ import io.office.common.utils.PageUtils; ...@@ -34,6 +34,8 @@ import io.office.common.utils.PageUtils;
import io.office.common.utils.R; import io.office.common.utils.R;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import static com.baomidou.mybatisplus.core.toolkit.IdWorker.getId; import static com.baomidou.mybatisplus.core.toolkit.IdWorker.getId;
...@@ -107,43 +109,9 @@ public class TycpdmFirmController extends AbstractController { ...@@ -107,43 +109,9 @@ public class TycpdmFirmController extends AbstractController {
@RequestMapping("/authApi/save") @RequestMapping("/authApi/save")
// @RequiresPermissions("manage:tycpdmfirm:save") // @RequiresPermissions("manage:tycpdmfirm:save")
public R save(@RequestBody Map body) throws InvocationTargetException, IllegalAccessException { public R save(@RequestBody Map body) throws InvocationTargetException, IllegalAccessException {
TycpdmFirmEntity tycpdmFirm = new TycpdmFirmEntity();
TycpdmFirmChangeEntity tycpdmFirmChangeEntity = new TycpdmFirmChangeEntity(); MemberEntity memberUser = getMemberUser();
Integer status = body.get("status")==null?0:Integer.valueOf(String.valueOf(body.get("status"))); Integer id= tycpdmFirmService.saveTycpdmFirmInfo(body,memberUser.getUsername());
Integer id=0;
if (status==1){
BeanUtils.populate(tycpdmFirm, body);
String baseUser = tycpdmFirm.getBaseUser();
if (baseUser==null){
throw new RRException("用户名不能为空");
}
String firmname = tycpdmFirm.getFirmname();
if (firmname==null||"".equals(tycpdmFirm)){
throw new RRException("企业名称不能为空");
}
int count=tycpdmFirmDao.selectByIdFirmName(firmname,1);
if (count>0){
throw new RRException("企业名称已经存在");
}
//第一步不存储状态 第二部存储
//tycpdmFirm.setLogoutFlag(0); //审核状态 0待审核 1审核成功 2审核失败
tycpdmFirmService.save(tycpdmFirm);
id = tycpdmFirm.getFId();
}else if (status==2){
Integer fId = Integer.valueOf(String.valueOf(body.get("fId")));
BeanUtils.populate(tycpdmFirmChangeEntity, body);
String baseUser = tycpdmFirmChangeEntity.getBaseUser();
if (baseUser==null){
throw new RRException("用户名不能为空");
}
tycpdmFirmChangeEntity.setFId(fId);
tycpdmFirmChangeService.save(tycpdmFirmChangeEntity);
id = tycpdmFirmChangeEntity.getId();
}else {
return R.error("请选择业务类型");
}
return R.ok().put("data",id); return R.ok().put("data",id);
} }
...@@ -161,10 +129,13 @@ public class TycpdmFirmController extends AbstractController { ...@@ -161,10 +129,13 @@ public class TycpdmFirmController extends AbstractController {
@RequestMapping("/authApi/findUserName") @RequestMapping("/authApi/findUserName")
// @RequiresPermissions("manage:tycpdmfirm:save") // @RequiresPermissions("manage:tycpdmfirm:save")
public R findUserName(@RequestParam("userName") String userName){ public R findUserName(@RequestParam("userName") String userName){
//查询 业务类型 1.首次 2.变更
TycpdmFirmEntity tycpdmFirmEntity=tycpdmFirmService.findUserName(userName); int logoutFlag=tycpdmFirmService.findLogoutFlag(userName);
JSONObject tycpdmFirmEntity=tycpdmFirmService.findUserName(logoutFlag,userName);
return R.ok().put("data",tycpdmFirmEntity); R ok = R.ok();
tycpdmFirmEntity.put("status",logoutFlag);
ok.put("data",tycpdmFirmEntity);
return ok;
} }
/** /**
...@@ -251,8 +222,9 @@ public class TycpdmFirmController extends AbstractController { ...@@ -251,8 +222,9 @@ public class TycpdmFirmController extends AbstractController {
@RequestMapping("/authApi/audit") @RequestMapping("/authApi/audit")
// @RequiresPermissions("manage:tycpdmfirm:delete") // @RequiresPermissions("manage:tycpdmfirm:delete")
public R audit(@RequestBody Map map){ public R audit(@RequestBody Map map){
Integer memberUserId = getMemberUserId();
try { try {
tycpdmFirmService.audit(map); tycpdmFirmService.audit(map,memberUserId);
} catch (InvocationTargetException e) { } catch (InvocationTargetException e) {
e.printStackTrace(); e.printStackTrace();
} catch (IllegalAccessException e) { } catch (IllegalAccessException e) {
...@@ -261,4 +233,23 @@ public class TycpdmFirmController extends AbstractController { ...@@ -261,4 +233,23 @@ public class TycpdmFirmController extends AbstractController {
return R.ok(); return R.ok();
} }
/**
* 根据文件地址返回文件
*/
@RequestMapping("/authApi/returnFile")
public R returnFile(@RequestBody Map<String, Object> params, HttpServletResponse response){
tycpdmFirmService.returnFile(params,response);
return R.ok();
}
/**
* 切换分中心管理员
*/
@RequestMapping("/authApi/updateSystem")
public R updateSystem(@RequestBody Map<String, Object> params){
tycpdmFirmService.updateSystem(params);
return R.ok();
}
} }
...@@ -42,6 +42,9 @@ public interface MemberDao extends BaseMapper<MemberEntity> { ...@@ -42,6 +42,9 @@ public interface MemberDao extends BaseMapper<MemberEntity> {
@Update("UPDATE member SET phone = #{phone} WHERE id = #{id}") @Update("UPDATE member SET phone = #{phone} WHERE id = #{id}")
void updateByIDPhone(@Param("id") Integer id,@Param("phone") String phone); void updateByIDPhone(@Param("id") Integer id,@Param("phone") String phone);
@Update("UPDATE member SET Applystate = #{applystate} WHERE username = #{userName}")
void updateByIdApplystate(@Param("applystate") String applystate,@Param("userName")String userName);
/*@Select("select * from member where username=#{userName} or firmcode=#{userName}") /*@Select("select * from member where username=#{userName} or firmcode=#{userName}")
MemberEntity selectByNameAndSn(@Param("userName") String userName);*/ MemberEntity selectByNameAndSn(@Param("userName") String userName);*/
......
...@@ -31,7 +31,10 @@ public interface TycpdmFirmChangeDao extends BaseMapper<TycpdmFirmChangeEntity> ...@@ -31,7 +31,10 @@ public interface TycpdmFirmChangeDao extends BaseMapper<TycpdmFirmChangeEntity>
List<TycpdmFirmChangeEntity> selectTycpdmFirmList(Map<String, Object> params, Page page); List<TycpdmFirmChangeEntity> selectTycpdmFirmList(Map<String, Object> params, Page page);
@Select("select * from tycpdm_firm_change where base_user=#{userName}") @Select("select * from tycpdm_firm_change where base_user=#{userName} ORDER BY id DESC")
TycpdmFirmChangeEntity findUserName(@Param("userName") String userName); List<TycpdmFirmChangeEntity> findUserName(@Param("userName") String userName);
@Update("UPDATE tycpdm_firm_change SET branchCode = #{branchCode} WHERE id = #{id}")
void updateByIdBranchCode(@Param("id") Integer id,@Param("branchCode") Integer branchCode);
} }
...@@ -20,8 +20,8 @@ import java.util.Map; ...@@ -20,8 +20,8 @@ import java.util.Map;
*/ */
@Mapper @Mapper
public interface TycpdmFirmDao extends BaseMapper<TycpdmFirmEntity> { public interface TycpdmFirmDao extends BaseMapper<TycpdmFirmEntity> {
@Select("select * from tycpdm_firm where base_user=#{userName}") @Select("select * from tycpdm_firm where base_user=#{userName} ")
TycpdmFirmEntity findUserName(@Param("userName") String userName); TycpdmFirmEntity findUserName(@Param("userName") String userName);
Integer findTycpdmFirmLogoutFlagCountALL(@Param("levels")Integer levels,@Param("logout_flag")Integer logout_flag); Integer findTycpdmFirmLogoutFlagCountALL(@Param("levels")Integer levels,@Param("logout_flag")Integer logout_flag);
...@@ -38,4 +38,8 @@ public interface TycpdmFirmDao extends BaseMapper<TycpdmFirmEntity> { ...@@ -38,4 +38,8 @@ public interface TycpdmFirmDao extends BaseMapper<TycpdmFirmEntity> {
@Select("select count(1) from tycpdm_firm where firmName=#{firmname} and logout_flag=#{logout_flag}") @Select("select count(1) from tycpdm_firm where firmName=#{firmname} and logout_flag=#{logout_flag}")
int selectByIdFirmName(@Param("firmname")String firmname, @Param("logout_flag")int logout_flag); int selectByIdFirmName(@Param("firmname")String firmname, @Param("logout_flag")int logout_flag);
@Update("UPDATE tycpdm_firm SET branchCode = #{branchCode} WHERE f_id = #{id}")
void updateByIdBranchCode(@Param("id") Integer id,@Param("branchCode") Integer branchCode);
} }
...@@ -32,4 +32,6 @@ public class NewsParams extends PageParams { ...@@ -32,4 +32,6 @@ public class NewsParams extends PageParams {
private Integer classId; private Integer classId;
private String type; private String type;
private List list;
} }
package io.office.modules.manage.service; package io.office.modules.manage.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils; import io.office.common.utils.PageUtils;
...@@ -9,6 +10,8 @@ import io.office.modules.manage.entity.TycpdmFirmEntity; ...@@ -9,6 +10,8 @@ import io.office.modules.manage.entity.TycpdmFirmEntity;
import io.office.modules.sys.entity.SysUserEntity; import io.office.modules.sys.entity.SysUserEntity;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.util.List; import java.util.List;
...@@ -25,7 +28,7 @@ public interface TycpdmFirmService extends IService<TycpdmFirmEntity> { ...@@ -25,7 +28,7 @@ public interface TycpdmFirmService extends IService<TycpdmFirmEntity> {
PageUtils queryPage(Map<String, Object> params); PageUtils queryPage(Map<String, Object> params);
TycpdmFirmEntity findUserName(String userName); JSONObject findUserName(Integer logoutFlag, String userName);
Map<String, Integer> findTycpdmFirmLogoutFlagCount(MemberEntity userEntity); Map<String, Integer> findTycpdmFirmLogoutFlagCount(MemberEntity userEntity);
...@@ -35,6 +38,14 @@ public interface TycpdmFirmService extends IService<TycpdmFirmEntity> { ...@@ -35,6 +38,14 @@ public interface TycpdmFirmService extends IService<TycpdmFirmEntity> {
Page<TycpdmFirmEntity> findlist(Map<String, Object> params, Page page); Page<TycpdmFirmEntity> findlist(Map<String, Object> params, Page page);
void audit(Map map) throws InvocationTargetException, IllegalAccessException; void audit(Map map,Integer memberUserId) throws InvocationTargetException, IllegalAccessException;
int findLogoutFlag(String userName);
Integer saveTycpdmFirmInfo(Map body,String userName) throws InvocationTargetException, IllegalAccessException;
void returnFile(Map<String, Object> params, HttpServletResponse response) ;
void updateSystem(Map<String, Object> params);
} }
...@@ -93,7 +93,7 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity ...@@ -93,7 +93,7 @@ public class LogLoginServiceImpl extends ServiceImpl<LogLoginDao, LogLoginEntity
if (levels==null){ if (levels==null){
if (userType==3){ if (userType==3){
//判断是否通过企业认证 //判断是否通过企业认证
if ("通过审核".equals(applystate)){ if ("通过审核".equals(applystate.substring(0,4))){
isQY=1; isQY=1;
} }
//判断是否是系统成员 //判断是否是系统成员
......
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.utils.PageUtils; import io.office.common.utils.PageUtils;
import io.office.common.utils.Query; import io.office.common.utils.Query;
import io.office.common.utils.R; import io.office.common.utils.R;
import io.office.modules.manage.dao.NewsDao;
import io.office.modules.manage.dao.PictureDao; import io.office.modules.manage.dao.PictureDao;
import io.office.modules.manage.entity.NewsEntity; import io.office.modules.manage.entity.NewsEntity;
import io.office.modules.manage.entity.PictureEntity; import io.office.modules.manage.entity.PictureEntity;
...@@ -108,8 +109,12 @@ public class PictureServiceImpl extends ServiceImpl<PictureDao, PictureEntity> i ...@@ -108,8 +109,12 @@ public class PictureServiceImpl extends ServiceImpl<PictureDao, PictureEntity> i
return page; return page;
} }
@Autowired
NewsDao newsDao;
@Override @Override
public Page<PictureEntity> selectPictureNewList(NewsParams params, Page page) { public Page<PictureEntity> selectPictureNewList(NewsParams params, Page page) {
List<PictureEntity> list = this.newsDao.pictureTop4();
params.setList(list);
List<PictureEntity> newsList = this.pictureDao.selectPictureNewList(params, page); List<PictureEntity> newsList = this.pictureDao.selectPictureNewList(params, page);
page.setRecords(newsList); page.setRecords(newsList);
return page; return page;
......
...@@ -96,7 +96,7 @@ public class TycpdmFirmChangeServiceImpl extends ServiceImpl<TycpdmFirmChangeDao ...@@ -96,7 +96,7 @@ public class TycpdmFirmChangeServiceImpl extends ServiceImpl<TycpdmFirmChangeDao
@Override @Override
public TycpdmFirmChangeEntity findUserName(String userName) { public TycpdmFirmChangeEntity findUserName(String userName) {
return tycpdmFirmChangeDao.findUserName(userName); return tycpdmFirmChangeDao.findUserName(userName).get(0);
} }
} }
\ No newline at end of file
package io.office.modules.manage.service.impl; package io.office.modules.manage.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sun.org.apache.xml.internal.security.Init;
import io.office.common.exception.RRException; import io.office.common.exception.RRException;
import io.office.common.utils.R;
import io.office.modules.manage.dao.MemberDao; import io.office.modules.manage.dao.MemberDao;
import io.office.modules.manage.dao.TycpdmFirmChangeDao; import io.office.modules.manage.dao.TycpdmFirmChangeDao;
import io.office.modules.manage.dao.TycpdmVipUserDao; import io.office.modules.manage.dao.TycpdmVipUserDao;
import io.office.modules.manage.entity.*; import io.office.modules.manage.entity.*;
import io.office.modules.manage.service.TycpdmFirmChangeService;
import io.office.modules.sys.entity.SysUserEntity; import io.office.modules.sys.entity.SysUserEntity;
import org.apache.commons.beanutils.BeanMap; import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.beanutils.BeanUtils; import org.apache.commons.beanutils.BeanUtils;
...@@ -15,6 +19,8 @@ import org.springframework.data.annotation.Id; ...@@ -15,6 +19,8 @@ import org.springframework.data.annotation.Id;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.File; import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException; import java.io.IOException;
import java.lang.reflect.InvocationTargetException; import java.lang.reflect.InvocationTargetException;
import java.util.HashMap; import java.util.HashMap;
...@@ -31,9 +37,12 @@ import io.office.common.utils.Query; ...@@ -31,9 +37,12 @@ import io.office.common.utils.Query;
import io.office.modules.manage.dao.TycpdmFirmDao; import io.office.modules.manage.dao.TycpdmFirmDao;
import io.office.modules.manage.service.TycpdmFirmService; import io.office.modules.manage.service.TycpdmFirmService;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.FileCopyUtils;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
@Service("tycpdmFirmService") @Service("tycpdmFirmService")
public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirmEntity> implements TycpdmFirmService { public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirmEntity> implements TycpdmFirmService {
...@@ -50,6 +59,9 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm ...@@ -50,6 +59,9 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
@Autowired @Autowired
private MemberDao memberDao; private MemberDao memberDao;
@Autowired
private TycpdmFirmChangeService tycpdmFirmChangeService;
@Value("${uploadFileQY}") @Value("${uploadFileQY}")
String uploadFileQY; String uploadFileQY;
...@@ -66,8 +78,38 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm ...@@ -66,8 +78,38 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
} }
@Override @Override
public TycpdmFirmEntity findUserName(String userName) { public JSONObject findUserName(Integer logoutFlag, String userName) {
return tycpdmFirmDao.findUserName(userName); JSONObject jsonObject = new JSONObject();
if (logoutFlag==1){
//首次
TycpdmFirmEntity tycpdmFirm = tycpdmFirmDao.findUserName(userName);
jsonObject.put("data",tycpdmFirm);
}else if (logoutFlag==2){
//变更
List<TycpdmFirmChangeEntity> tycpdmFirmChange = tycpdmFirmChangeDao.findUserName(userName);
if (tycpdmFirmChange==null||tycpdmFirmChange.size()==0){
TycpdmFirmEntity tycpdmFirm = tycpdmFirmDao.findUserName(userName);
jsonObject.put("data",tycpdmFirm);
return jsonObject;
}else{
Integer logoutFlag1 = tycpdmFirmChange.get(0).getLogoutFlag();
if (logoutFlag1==null){
jsonObject.put("data",tycpdmFirmChange.get(0));
return jsonObject;
}
if (tycpdmFirmChange.get(0).getLogoutFlag()==1){
TycpdmFirmEntity tycpdmFirm = tycpdmFirmDao.findUserName(userName);
jsonObject.put("data",tycpdmFirm);
}else if (tycpdmFirmChange.get(0).getLogoutFlag()==0||tycpdmFirmChange.get(0).getLogoutFlag()==2){
jsonObject.put("data",tycpdmFirmChange.get(0));
}else {
throw new RRException("业务类型错误!");
}
}
}else {
throw new RRException("业务类型错误!");
}
return jsonObject;
} }
@Override @Override
...@@ -190,7 +232,7 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm ...@@ -190,7 +232,7 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
@Override @Override
@Transactional @Transactional
public void audit(Map map) throws InvocationTargetException, IllegalAccessException { public void audit(Map map,Integer memberUserId) throws InvocationTargetException, IllegalAccessException {
Integer status= map.get("status")==null?0: Integer.valueOf(String.valueOf(map.get("status")));//1.新增(新增时id为fId) 2.变更(id为fId) Integer status= map.get("status")==null?0: Integer.valueOf(String.valueOf(map.get("status")));//1.新增(新增时id为fId) 2.变更(id为fId)
String id= map.get("id")==null?"": String.valueOf(map.get("id"));//id String id= map.get("id")==null?"": String.valueOf(map.get("id"));//id
String auditStatus= map.get("auditStatus")==null?"": String.valueOf(map.get("auditStatus"));//审核状态 1.通过 2.不通过 String auditStatus= map.get("auditStatus")==null?"": String.valueOf(map.get("auditStatus"));//审核状态 1.通过 2.不通过
...@@ -206,6 +248,12 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm ...@@ -206,6 +248,12 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
String firmname = tycpdmFirmEntity.getFirmname(); String firmname = tycpdmFirmEntity.getFirmname();
tycpdmVipUserDao.insert(new TycpdmVipUserEntity(null,id+"",firmname,baseUser)); tycpdmVipUserDao.insert(new TycpdmVipUserEntity(null,id+"",firmname,baseUser));
} }
TycpdmFirmEntity tycpdmFirmEntity = tycpdmFirmDao.selectById(id);
String baseUser = tycpdmFirmEntity.getBaseUser();
if (auditStatus.equals("1")){
memberDao.updateByIdApplystate("通过审核",baseUser);
}
}else if (status==2){ }else if (status==2){
//变更 //变更
...@@ -228,4 +276,172 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm ...@@ -228,4 +276,172 @@ public class TycpdmFirmServiceImpl extends ServiceImpl<TycpdmFirmDao, TycpdmFirm
} }
@Override
public int findLogoutFlag(String userName) {
//查询tycpdm_firm表
int findLogoutFlag=0; //业务类型 1.首次 2.变更
TycpdmFirmEntity tycpdmFirm = tycpdmFirmDao.findUserName(userName);
if (tycpdmFirm==null){
findLogoutFlag=1;
return findLogoutFlag;
}else {
Integer logoutFlag = tycpdmFirm.getLogoutFlag();
if (logoutFlag==null){
findLogoutFlag=1;
}else if (logoutFlag==1){
findLogoutFlag=2;
}else {
findLogoutFlag=1;
}
}
return findLogoutFlag;
}
@Override
public Integer saveTycpdmFirmInfo(Map body,String userName) throws InvocationTargetException, IllegalAccessException {
TycpdmFirmEntity tycpdmFirm = new TycpdmFirmEntity();
TycpdmFirmChangeEntity tycpdmFirmChangeEntity = new TycpdmFirmChangeEntity();
Integer status = body.get("status")==null?0:Integer.valueOf(String.valueOf(body.get("status")));
Integer id=0;
if (status==1){ //首次
BeanUtils.populate(tycpdmFirm, body);
String baseUser = tycpdmFirm.getBaseUser();
if (baseUser==null){
throw new RRException("用户名不能为空");
}
String firmname = tycpdmFirm.getFirmname();
if (firmname==null||"".equals(tycpdmFirm)){
throw new RRException("企业名称不能为空");
}
int count=tycpdmFirmDao.selectByIdFirmName(firmname,1);
if (count>0){
throw new RRException("企业名称已经存在");
}
Integer fid = body.get("fid")==null?0:Integer.valueOf(String.valueOf(body.get("fid")));
tycpdmFirm.setFId(fid);
Integer fId = tycpdmFirm.getFId();
if (fId==0){//新增数据
save(tycpdmFirm);
id = tycpdmFirm.getFId();
return id;
}else {//修改数据
//查询旧数据审核状态
TycpdmFirmEntity userName1 = tycpdmFirmDao.findUserName(userName);
Integer logoutFlag = userName1.getLogoutFlag();
if (logoutFlag==null){
updateById(tycpdmFirm);
id=fId;
}else if (logoutFlag==0){
throw new RRException("信息已提交,等待管理员审核!");
}else if (logoutFlag==1){
throw new RRException("审核状态异常");
}else if (logoutFlag==2){
updateById(tycpdmFirm);
id=fId;
}
return id;
}
}else if (status==2){ //变更
Integer fId =0;
Integer type=0; //1.新增 2.修改
if (body.get("fid")==null){//获取 主表的fId
TycpdmFirmEntity userName1 = tycpdmFirmDao.findUserName(userName);
fId=userName1.getFId();
type=1;
}else {
fId=Integer.valueOf(String.valueOf(body.get("fid")));
type=2;
}
BeanUtils.populate(tycpdmFirmChangeEntity, body);
String baseUser = tycpdmFirmChangeEntity.getBaseUser();
if (baseUser==null){
throw new RRException("用户名不能为空");
}
String firmname = tycpdmFirmChangeEntity.getFirmname();
if (firmname==null||"".equals(tycpdmFirm)){
throw new RRException("企业名称不能为空");
}
int count=tycpdmFirmDao.selectByIdFirmName(firmname,1);
if (count>0){
throw new RRException("企业名称已经存在");
}
tycpdmFirmChangeEntity.setFId(fId);
if (type==1){
tycpdmFirmChangeService.save(tycpdmFirmChangeEntity);
id = tycpdmFirmChangeEntity.getId();
}else if (type==2){
if (tycpdmFirmChangeEntity.getId()==null){
tycpdmFirmChangeService.save(tycpdmFirmChangeEntity);
id = tycpdmFirmChangeEntity.getId();
}
TycpdmFirmChangeEntity tycpdmFirmChangeEntity1 = tycpdmFirmChangeDao.selectById(tycpdmFirmChangeEntity.getId());
Integer logoutFlag = tycpdmFirmChangeEntity1.getLogoutFlag();
if (logoutFlag==null){
tycpdmFirmChangeService.updateById(tycpdmFirmChangeEntity);
id= tycpdmFirmChangeEntity.getId();
}else if (logoutFlag==0){
throw new RRException("信息已提交,等待管理员审核!");
}else if (logoutFlag==1){
tycpdmFirmChangeService.save(tycpdmFirmChangeEntity);
id = tycpdmFirmChangeEntity.getId();
}else if (logoutFlag==2){
tycpdmFirmChangeService.updateById(tycpdmFirmChangeEntity);
id= tycpdmFirmChangeEntity.getId();
}
}
}else {
throw new RRException("请选择业务类型");
}
return id;
}
@Override
public void returnFile(Map<String, Object> params, HttpServletResponse response){
Integer status =Integer.valueOf(String.valueOf(params.get("status"))); //1.首次 2.变更
Integer fileType = Integer.valueOf(String.valueOf(params.get("fileType")));//1.第一步文件 2.第二步文件
String id =String.valueOf(params.get("id"));//各个表的主键
String filePath="";
if (status==1){
TycpdmFirmEntity tycpdmFirmEntity = tycpdmFirmDao.selectById(id);
if (fileType==1){
filePath = tycpdmFirmEntity.getFirmbusinesslicensefile();
}else if (fileType==2){
filePath = tycpdmFirmEntity.getFirmArchivesfile();
}
}else if (status==2){
TycpdmFirmChangeEntity tycpdmFirmChangeEntity = tycpdmFirmChangeDao.selectById(id);
if (fileType==1){
filePath = tycpdmFirmChangeEntity.getFirmbusinesslicensefile();
}else if (fileType==2){
filePath = tycpdmFirmChangeEntity.getFirmArchivesfile();
}
}
File file = new File(filePath);
if (!file.exists()){
throw new RRException("文件不存在");
}
try {
FileCopyUtils.copy(new FileInputStream(filePath), response.getOutputStream());
} catch (IOException e) {
e.printStackTrace();
}
}
@Override
public void updateSystem(Map<String, Object> params) {
Integer id = Integer.valueOf(String.valueOf(params.get("id")));//id为 各个表得ID 变更表和主表
Integer status = Integer.valueOf(String.valueOf(params.get("status")));//申请状态 1.首次 2.变更
Integer branchCode = Integer.valueOf(String.valueOf(params.get("branchCode")));//分中心管理员编码
if (status==1){
tycpdmFirmDao.updateByIdBranchCode(id,branchCode);
}else if (status==2){
tycpdmFirmChangeDao.updateByIdBranchCode(id,branchCode);
}
}
} }
\ No newline at end of file
...@@ -68,25 +68,17 @@ ...@@ -68,25 +68,17 @@
ORDER BY ORDER BY
pictureID DESC pictureID DESC
</select> </select>
<select id="selectPictureNewList" resultMap="pictureMap" parameterType="io.office.modules.manage.entity.dto.PictureParams"> <select id="selectPictureNewList" resultMap="pictureMap" parameterType="io.office.modules.manage.entity.dto.NewsParams">
SELECT SELECT *
* FROM picture
FROM WHERE status = 1
picture AND PicLevel > 0
WHERE
status = 1 AND pictureid NOT IN
AND PicLevel > 0 <foreach collection="params.list" index="index" item="item" open="(" separator="," close=")">
AND pictureid NOT IN ( #{item.pictureid}
SELECT </foreach>
TOP 4 pictureid ORDER BY PicLevel DESC,
FROM pictureid DESC
picture
ORDER BY
PicLevel DESC,
pictureid DESC
)
ORDER BY
PicLevel DESC,
pictureid DESC
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment