Commit 14c73f6c by 翁国栋 Committed by 284718418@qq.com

运营后台--

企业用户列表,增删改
用户批量投保
parent 976322ac
......@@ -48,7 +48,7 @@ public class InsureApplicant extends Model<InsureApplicant> {
/**
* 企业/网点名称
*/
@ApiModelProperty(value = "目录名称")
@ApiModelProperty(value = "企业/网点名称")
private String applicantEName;
/**
* 企业/网点地址
......@@ -132,6 +132,8 @@ public class InsureApplicant extends Model<InsureApplicant> {
private String applicantInvoicedAmount;
@ApiModelProperty(value = "企业id", example = "")
private Integer orgCode;
@ApiModelProperty(value="银行账号")
private String applicantCorporateBankAccount;
/**
* 设置:id
......
......@@ -44,88 +44,28 @@ import org.springframework.web.multipart.MultipartFile;
@Transactional
@RequestMapping(value = "/insureApplicant", produces = {"application/json"})
public class InsureApplicantController {
private static final Logger log = LoggerFactory.getLogger(InsureApplicantController.class);
@Autowired
private InsureApplicantMapper insureApplicantMapper;
@Value("insure.type.test.appid")
private String appid;
@Value("insure.type.test.secret")
private String secret;
@Value("insure.type.test.appidq")
private String appidq;
@Value("insure.type.test.secretq")
private String secretq;
@Value("insure.type.test.uploadUrl")
private String uploadUrl;
@Value("insure.type.test.insuredUrl")
private String insuredUrl;
@Value("insure.type.test.uploadUrlq")
private String uploadUrl2;
@PostMapping("/insureApplicationSetting")
@ApiOperation(value = "设置投保人", httpMethod = "POST", notes = "投保申请")
private Result<Object> insureApplicationSetting(@CurrentUser UserBean userBean, @RequestBody InsureApplicant params) {
InsureApplicant insureApplicant = InsureApplicant.builder().build().selectOne(new QueryWrapper<InsureApplicant>().lambda().eq(InsureApplicant::getOrgCode,userBean.getOrgCode()));
if(insureApplicant==null){
private Result<Object> insureApplicationSetting(@RequestBody InsureApplicant params) {
InsureApplicant insureApplicant = InsureApplicant.builder().id(1).build().selectById();if(insureApplicant==null){
params.insert();
return ResultUtil.data(params);
}
BeanUtils.copyProperties(params,insureApplicant);
insureApplicant.updateById();
return ResultUtil.data(insureApplicant);
params.setId(insureApplicant.getId());
params.updateById();
return ResultUtil.data(params);
}
@PostMapping("/getApplicant")
@ApiOperation(value = "获取投保人", httpMethod = "POST", notes = "获取投保人")
private Result<Object> getApplicant(@CurrentUser UserBean userBean) {
InsureApplicant insureApplicant = InsureApplicant.builder().build().selectOne(new QueryWrapper<InsureApplicant>().lambda().eq(InsureApplicant::getOrgCode,userBean.getOrgCode()));
@GetMapping("/getApplicant")
@ApiOperation(value = "获取投保人", httpMethod = "Get", notes = "获取投保人")
private Result<Object> getApplicant() {
InsureApplicant insureApplicant = InsureApplicant.builder().id(1).build().selectById();
if(insureApplicant==null){
return ResultUtil.data(null);
}
return ResultUtil.data(insureApplicant);
}
/**
* 设置链接参数
*
* @param sign
* @return
*/
private Map setParams(String sign) {
/*当前时间戳*/
long timestamp = System.currentTimeMillis()/1000;
log.info("时间戳" + timestamp);
Map paramsMap = Maps.newHashMap();
paramsMap.put("pid", appidq);
paramsMap.put("timestamp", String.valueOf(timestamp));
paramsMap.put("trace_id", appidq + timestamp + new Random().nextInt((9999 - 100) + 1) + 10);
// paramsMap.put("sign",Md5.md5(appid+secret+timestamp+sign.trim()));
String value = appidq + secretq + timestamp + sign;
log.info("body参数======" + sign);
paramsMap.put("sign", DigestUtils.md5Hex(value));
log.info("params参数======" + JSONObject.toJSONString(paramsMap));
return paramsMap;
}
/**
* 设置返回信息
*
* @param data
* @return
*/
private Object message(String data) {
Map<String, Object> dataMap = JSONObject.parseObject(data);
if (dataMap.get("errcode").toString().equals("suc")) {
return dataMap.get("data");
}
return dataMap.get("errmsg");
}
}
package cn.timer.api.controller.qyzx;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.servlet.http.HttpSession;
import cn.timer.api.dto.qyzx.*;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -57,12 +52,6 @@ import cn.timer.api.dao.qyzx.QyzxOperLogMapper;
import cn.timer.api.dao.qyzx.QyzxPayServeMapper;
import cn.timer.api.dao.zzgl.ZzglBmgwMMapper;
import cn.timer.api.dto.login.QysDto;
import cn.timer.api.dto.qyzx.AdminListDto;
import cn.timer.api.dto.qyzx.AttaFpglQueryDto;
import cn.timer.api.dto.qyzx.EntauthDto;
import cn.timer.api.dto.qyzx.LogBuyDto;
import cn.timer.api.dto.qyzx.MenuStructureDto;
import cn.timer.api.dto.qyzx.QyzxOperLogQuaryDto;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.Api;
......@@ -617,4 +606,44 @@ public class QyzxController {
return ResultUtil.data(delCount, "操作成功!");
}
/**
* 运营后台---企业信息列表
* @param
* @param cdys
* @return
*/
@PostMapping(value = "/companyAdminList")
@ApiOperation(value = "运营后台---企业信息列表", httpMethod = "POST", notes = "")
public Result<Object> companyAdminList(@RequestBody cn.timer.api.utils.Page page) {
Map map = Maps.newHashMap();
List<EntInfoDto> list = Optional.ofNullable(qyzxEntInfoMMapper.companyAdminList(page)).orElse(Lists.newArrayList());
Integer count = qyzxEntInfoMMapper.companyAdminCount();
map.put("list",list);
map.put("count",count);
return ResultUtil.data(map);
}
@GetMapping(value = "/selectentbyId")
@ApiOperation(value = "运营后台---获取企业信息", httpMethod = "GET", notes = "接口发布说明")
public Result<Object> selectentbyId(@RequestParam("id") String id) {
QyzxEntInfoM qyzxEntInfoM = QyzxEntInfoM.builder().id(Integer.parseInt(id)).build().selectById();
return ResultUtil.data(qyzxEntInfoM, "获取企业信息成功");
}
@PostMapping(value = "/aeCompamy")
@ApiOperation(value = "运营后台---添加/修改企业信息", httpMethod = "POST", notes = "接口发布说明")
@Log(title = "运营后台---添加/修改-企业信息", businessType = BusinessType.UPDATE)
public Result<QyzxEntInfoM> aeCompamy(@RequestBody QyzxEntInfoM qyzxEntInfoM) {
QyzxEntInfoM q = new LambdaQueryChainWrapper<QyzxEntInfoM>(qyzxEntInfoMMapper)
.eq(QyzxEntInfoM::getId, qyzxEntInfoM.getId()).one();
if(q!=null){
qyzxEntInfoM.setRegisterTime(q.getRegisterTime());
}
qyzxEntInfoM.insertOrUpdate();
return ResultUtil.data(qyzxEntInfoM, "添加/修改企业");
}
@GetMapping(value = "/getCompanySelect")
@ApiOperation(value = "运营后台---获取选择框下的企业信息", httpMethod = "POST", notes = "接口发布说明")
public Result<Object> getCompanySelect() {
return ResultUtil.data(qyzxEntInfoMMapper.getCompanyList(), "获取成功");
}
}
......@@ -35,7 +35,7 @@ public class SuperLoginController {
private HttpSession session;
@PostMapping(value = "/adminLogin")
@ApiOperation(value = "运营后台登录", httpMethod = "POST", notes = "接口发布说明")
public Result<AdminAccount> adminLogin(@RequestBody EntRegisterDto entRegisterDto, HttpServletRequest request){
public Result<Object> adminLogin(@RequestBody EntRegisterDto entRegisterDto, HttpServletRequest request){
String ip = UserIp.getIpAddr(request);
AdminAccount adminAccount = AdminAccount.builder().build().selectOne(new QueryWrapper<AdminAccount>().lambda()
.eq(AdminAccount::getAccount,entRegisterDto.getPhone())
......
package cn.timer.api.dao.qyzx;
import cn.timer.api.dto.qyzx.EntInfoDto;
import cn.timer.api.utils.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.timer.api.bean.qyzx.QyzxEntInfoM;
import java.util.List;
import java.util.Map;
/**
......@@ -14,6 +18,11 @@ import cn.timer.api.bean.qyzx.QyzxEntInfoM;
*/
@Repository
public interface QyzxEntInfoMMapper extends BaseMapper<QyzxEntInfoM> {
public List<EntInfoDto> companyAdminList(@Param("page")Page page);
public Integer companyAdminCount();
public List<Map<String,String>> getCompanyList();
......
......@@ -49,7 +49,7 @@ public interface YgglMainEmpMapper extends BaseMapper<YgglMainEmp> {
* @param userBean
* @return
*/
List<YgQueryDto> queryEmpMessage(@Param("orgCode") Integer orgCode);
List<YgQueryDto> queryEmpMessage(@Param("orgCode") Integer orgCode,@Param("isInsure")Integer isInsure);
/**
......
package cn.timer.api.dto.qyzx;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
/**
* @Description TODO
* @Author wgd
* @Date 2022/3/17 10:09
*/
@Data
public class EntInfoDto {
private Integer id;
private String name;
private String linkMan;
private String linkManPhone;
private String areaName;
private String totalNum;
private String logoUrl;
private String registerTime;
private String endTime;
private Integer totlaSpmk;
private Integer totlaCc;
}
......@@ -27,6 +27,8 @@ import lombok.NoArgsConstructor;
public class YgQueryDto extends Page {
// private static final long serialVersionUID = -1230023773946170942L;
@ApiModelProperty
private Integer id;
@ApiModelProperty(value = "员工姓名", example = "华仔")
private String empName;
......
......@@ -291,11 +291,11 @@ public class ExcelUtils {
* @param out 输出流
* @throws Exception
*/
public static void exportExcel(String title, String[] rowName, List<Object[]> dataList, OutputStream out) {
public static XSSFWorkbook exportExcel(String title, String[] rowName, List<Object[]> dataList) {
logger.info("========================= ExcelUtils.java ->> exportExcel()导出数据到Excel中 ->> 开始 =========================");
XSSFWorkbook workbook = null;
try {
/*
1,创建工作簿对象,然后创建大标题行,并设置标题
*/
......@@ -417,22 +417,7 @@ public class ExcelUtils {
sheet.setColumnWidth(colNum, (columnWidth + 4) * 256);
}
}
workbook.write(out);
} catch (Exception e) {
logger.info("ExcelUtils.java ->> exportExcel() ->> 异常信息:" + e);
throw new RuntimeException(e);
} finally {
try {
if (workbook != null) {
workbook.close();
logger.info("ExcelUtils.java ->> exportExcel() ->> 关闭Workbook资源");
}
} catch (Exception e) {
e.printStackTrace();
}
logger.info("========================= ExcelUtils.java ->> exportExcel()导出数据到Excel中 ->> 结束 =========================");
}
return workbook;
}
/**
......
......@@ -23,6 +23,7 @@
<result property="transId" column="trans_id"/>
<result property="currency" column="currency"/>
<result property="applicantInvoicedAmount" column="applicant_invoiced_amount"/>
<result property="applicantCorporateBankAccount" column="applicant_corporate_bank_account"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.insure.InsureApplicant">
......@@ -145,7 +146,8 @@
`applicant_type`,
`trans_id`,
`currency`,
`applicant_invoiced_amount`)
`applicant_invoiced_amount`,
`applicant_corporate_bank_account`)
values (#{applicantEName},
#{applicantEAddress},
#{applicantEmployeeList},
......@@ -162,7 +164,7 @@
#{applicantType},
#{transId},
#{currency},
#{applicantInvoicedAmount})
#{applicantCorporateBankAccount})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.insure.InsureApplicant" useGeneratedKeys="true"
......@@ -186,6 +188,7 @@
<if test="transId != null">,`trans_id`</if>
<if test="currency != null">,`currency`</if>
<if test="applicantInvoicedAmount != null">,`applicant_invoiced_amount`</if>
<if test="applicantCorporateBankAccount != null">,`applicant_corporate_bank_account`</if>
)
values
(
......@@ -205,7 +208,7 @@
<if test="applicantType != null">,#{applicantType}</if>
<if test="transId != null">,#{transId}</if>
<if test="currency != null">,#{currency}</if>
<if test="applicantInvoicedAmount != null">,#{applicantInvoicedAmount}</if>
<if test="applicantCorporateBankAccount != null">,#{applicantCorporateBankAccount}</if>
)
</insert>
......@@ -283,6 +286,7 @@
<if test="transId != null">`trans_id` = #{transId},</if>
<if test="currency != null">`currency` = #{currency},</if>
<if test="applicantInvoicedAmount != null">`applicant_invoiced_amount` = #{applicantInvoicedAmount}</if>
<if test="applicantCorporateBankAccount != null">`applicant_corporate_bank_account` = #{applicantCorporateBankAccount}</if>
</set>
where id = #{id}
</update>
......
......@@ -199,5 +199,37 @@
</select>
-->
<select id="companyAdminList" resultType="cn.timer.api.dto.qyzx.EntInfoDto">
SELECT
qeim.id AS id,
qeim.logo_url AS logoUrl,
qeim.NAME AS NAME,
qeim.link_man AS linkMan,
qeim.phone AS linkManPhone,
qeim.area_name AS areaName,
count( yme.id ) AS totalNum,
qeim.register_time AS registerTime,
qeim.end_time AS endTime,
IFNULL(a.totlaSpmk,0) as totlaSpmk,
IFNULL(b.totlaCc,0) as totlaCc
FROM
qyzx_ent_info_m qeim
LEFT JOIN yggl_main_emp yme ON yme.org_code = qeim.id
LEFT JOIN ( SELECT sas.org_code AS oid, count( sas.id ) AS totlaSpmk FROM spmk_approve_summary sas GROUP BY sas.org_code ) AS a ON a.oid = qeim.id
LEFT JOIN ( SELECT cc.organization_id AS oid, count( cc.id ) AS totlaCc FROM cms_content cc GROUP BY cc.organization_id ) AS b ON b.oid = qeim.id
GROUP BY
qeim.id
<if test="page.offset != null and page.totalPage !=null">
limit #{page.offset},#{page.totalPage}
</if>
</select>
<select id="companyAdminCount" resultType="java.lang.Integer">
select count(qeim.id) from qyzx_ent_info_m qeim
</select>
<select id ="getCompanyList" resultType="java.util.HashMap">
select id as value , name as label from qyzx_ent_info_m
</select>
</mapper>
......@@ -231,6 +231,7 @@
<!-- 查询员工信息 搜索 分页 -->
<select id="queryEmpMessage" resultType="cn.timer.api.dto.yggl.YgQueryDto">
SELECT
a.id,
a.name empName,
a.emp_num empNum,
b.name deptName,
......@@ -247,6 +248,9 @@
a.org_code = #{orgCode}
AND
a.job_status in (0,1,2)
<if test="isInsure!=null and isInsure != ''">
AND a.is_insure=#{isInsure}
</if>
ORDER BY
emp_num DESC
</select>
......
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