Commit be3def01 by 翁国栋

修改为可选择产品

parent 84a4067a
......@@ -962,13 +962,16 @@ public class InsureContorll {
@PostMapping(value = "/importPolicy")
@ApiOperation(value = "导入保单--运营后台", httpMethod = "POST", notes = "导入用户")
public Result<Object> importPolicy(@RequestParam("file") MultipartFile file) {
public Result<Object> importPolicy(@RequestParam("file") MultipartFile file,@RequestParam("productId") String productId) {
SimpleDateFormat dtf = new SimpleDateFormat("yyyyMMdd");
if (file.getSize() <= 0) {
return ResultUtil.error("请上传文件");
}
InsureProduct insureProduct = InsureProduct.builder().id(Integer.parseInt(productId)).build().selectById();
if(insureProduct == null){
return ResultUtil.error("产品不存在");
}
try {
XSSFWorkbook xw = new XSSFWorkbook(file.getInputStream());
XSSFSheet sheetAt = xw.getSheetAt(0);
......@@ -1082,6 +1085,7 @@ public class InsureContorll {
Map returnMap = JSONObject.parseObject(data,Map.class);
if(returnMap.get("errcode").toString().equals("suc")){
Map dataMap = JSONObject.parseObject(JSONObject.toJSONString(returnMap.get("data")), Map.class);
policy.setProductId(insureProduct.getId());
policy.setPolicyFile(dataMap.get("policy_file").toString());
policy.setStatus("1");
}else{
......
......@@ -39,5 +39,6 @@ public class PolicyDto {
private Integer insureStatus;
private String planId;
private String categoryId;
private String productId;
}
......@@ -249,6 +249,9 @@
LEFT JOIN insure_user iu ON iu.policy_id = ip.id
LEFT JOIN qyzx_ent_info_m qy on qy.id=ip.org_code
<where>
<if test="policy.productId!=null and policy.productId!=''">
and ip.product_id = #{policy.productId}
</if>
<if test="policy.status!=null and policy.status!=''">
and ip.status = #{policy.status}
</if>
......@@ -307,12 +310,13 @@
<select id="policyTotalList" resultType="cn.timer.api.dto.insure.PolicyDto">
SELECT
ip.id as id,
ip.name AS schemeName,
ip.type AS type,
(select count(id) from insure_policy) AS totaPolicy,
(select count(org_code) from insure_policy) AS totalCompany,
count(ipp.id) AS totaPolicy,
count(ipp.org_code) AS totalCompany,
count( iu.id ) AS totalUser,
IFNULL((select sum(price) from insure_user),0) as totalPremium,
sum(iu.price) as totalPremium,
ipp.update_time AS updateTime
FROM
insure_product ip
......
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