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
...@@ -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