Commit f6dbdec1 by 吴迪

Merge remote-tracking branch 'origin/master'

parents 32998fb7 80884866
......@@ -34,6 +34,8 @@ import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import static com.baomidou.mybatisplus.core.toolkit.IdWorker.getId;
......@@ -107,43 +109,9 @@ public class TycpdmFirmController extends AbstractController {
@RequestMapping("/authApi/save")
// @RequiresPermissions("manage:tycpdmfirm:save")
public R save(@RequestBody Map body) 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("企业名称已经存在");
}
//第一步不存储状态 第二部存储
//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("请选择业务类型");
}
MemberEntity memberUser = getMemberUser();
Integer id= tycpdmFirmService.saveTycpdmFirmInfo(body,memberUser.getUsername());
return R.ok().put("data",id);
}
......@@ -161,10 +129,13 @@ public class TycpdmFirmController extends AbstractController {
@RequestMapping("/authApi/findUserName")
// @RequiresPermissions("manage:tycpdmfirm:save")
public R findUserName(@RequestParam("userName") String userName){
TycpdmFirmEntity tycpdmFirmEntity=tycpdmFirmService.findUserName(userName);
return R.ok().put("data",tycpdmFirmEntity);
//查询 业务类型 1.首次 2.变更
int logoutFlag=tycpdmFirmService.findLogoutFlag(userName);
JSONObject tycpdmFirmEntity=tycpdmFirmService.findUserName(logoutFlag,userName);
R ok = R.ok();
tycpdmFirmEntity.put("status",logoutFlag);
ok.put("data",tycpdmFirmEntity);
return ok;
}
/**
......@@ -251,8 +222,9 @@ public class TycpdmFirmController extends AbstractController {
@RequestMapping("/authApi/audit")
// @RequiresPermissions("manage:tycpdmfirm:delete")
public R audit(@RequestBody Map map){
Integer memberUserId = getMemberUserId();
try {
tycpdmFirmService.audit(map);
tycpdmFirmService.audit(map,memberUserId);
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
......@@ -261,4 +233,23 @@ public class TycpdmFirmController extends AbstractController {
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> {
@Update("UPDATE member SET phone = #{phone} WHERE id = #{id}")
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}")
MemberEntity selectByNameAndSn(@Param("userName") String userName);*/
......
......@@ -31,7 +31,10 @@ public interface TycpdmFirmChangeDao extends BaseMapper<TycpdmFirmChangeEntity>
List<TycpdmFirmChangeEntity> selectTycpdmFirmList(Map<String, Object> params, Page page);
@Select("select * from tycpdm_firm_change where base_user=#{userName}")
TycpdmFirmChangeEntity findUserName(@Param("userName") String userName);
@Select("select * from tycpdm_firm_change where base_user=#{userName} ORDER BY id DESC")
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,7 +20,7 @@ import java.util.Map;
*/
@Mapper
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);
Integer findTycpdmFirmLogoutFlagCountALL(@Param("levels")Integer levels,@Param("logout_flag")Integer logout_flag);
......@@ -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}")
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 {
private Integer classId;
private String type;
private List list;
}
package io.office.modules.manage.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
......@@ -9,6 +10,8 @@ import io.office.modules.manage.entity.TycpdmFirmEntity;
import io.office.modules.sys.entity.SysUserEntity;
import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
......@@ -25,7 +28,7 @@ public interface TycpdmFirmService extends IService<TycpdmFirmEntity> {
PageUtils queryPage(Map<String, Object> params);
TycpdmFirmEntity findUserName(String userName);
JSONObject findUserName(Integer logoutFlag, String userName);
Map<String, Integer> findTycpdmFirmLogoutFlagCount(MemberEntity userEntity);
......@@ -35,6 +38,14 @@ public interface TycpdmFirmService extends IService<TycpdmFirmEntity> {
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
if (levels==null){
if (userType==3){
//判断是否通过企业认证
if ("通过审核".equals(applystate)){
if ("通过审核".equals(applystate.substring(0,4))){
isQY=1;
}
//判断是否是系统成员
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
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.entity.NewsEntity;
import io.office.modules.manage.entity.PictureEntity;
......@@ -108,8 +109,12 @@ public class PictureServiceImpl extends ServiceImpl<PictureDao, PictureEntity> i
return page;
}
@Autowired
NewsDao newsDao;
@Override
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);
page.setRecords(newsList);
return page;
......
......@@ -96,7 +96,7 @@ public class TycpdmFirmChangeServiceImpl extends ServiceImpl<TycpdmFirmChangeDao
@Override
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 @@
ORDER BY
pictureID DESC
</select>
<select id="selectPictureNewList" resultMap="pictureMap" parameterType="io.office.modules.manage.entity.dto.PictureParams">
SELECT
*
FROM
picture
WHERE
status = 1
AND PicLevel > 0
AND pictureid NOT IN (
SELECT
TOP 4 pictureid
FROM
picture
ORDER BY
PicLevel DESC,
pictureid DESC
)
ORDER BY
PicLevel DESC,
<select id="selectPictureNewList" resultMap="pictureMap" parameterType="io.office.modules.manage.entity.dto.NewsParams">
SELECT *
FROM picture
WHERE status = 1
AND PicLevel > 0
AND pictureid NOT IN
<foreach collection="params.list" index="index" item="item" open="(" separator="," close=")">
#{item.pictureid}
</foreach>
ORDER BY PicLevel DESC,
pictureid DESC
</select>
</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