保险管理、总平台保险、保险关系
This commit is contained in:
parent
aac5ba8b20
commit
02683fcfeb
|
|
@ -1,5 +1,6 @@
|
|||
package com.ghy.web.controller.goods;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.ghy.common.annotation.Log;
|
||||
import com.ghy.common.core.controller.BaseController;
|
||||
import com.ghy.common.core.domain.AjaxResult;
|
||||
|
|
@ -10,10 +11,14 @@ import com.ghy.common.enums.ImgType;
|
|||
import com.ghy.common.utils.ExceptionUtil;
|
||||
import com.ghy.common.utils.ShiroUtils;
|
||||
import com.ghy.common.utils.StringUtils;
|
||||
import com.ghy.goods.domain.CategoryInsuranceRelation;
|
||||
import com.ghy.goods.domain.DeptGoodsCategory;
|
||||
import com.ghy.goods.domain.GoodsImgs;
|
||||
import com.ghy.goods.domain.InsuranceManager;
|
||||
import com.ghy.goods.service.DeptGoodsCategoryService;
|
||||
import com.ghy.goods.service.GoodsImgsService;
|
||||
import com.ghy.goods.service.ICategoryInsuranceRelationService;
|
||||
import com.ghy.goods.service.IInsuranceManagerService;
|
||||
import com.ghy.web.pojo.vo.AppCategoryRequest;
|
||||
import com.ghy.web.pojo.vo.HotCategoryResponse;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
|
@ -38,6 +43,12 @@ public class GoodsDeptCategoryController extends BaseController {
|
|||
@Resource
|
||||
DeptGoodsCategoryService deptGoodsCategoryService;
|
||||
|
||||
@Resource
|
||||
ICategoryInsuranceRelationService categoryInsuranceRelationService;
|
||||
|
||||
@Resource
|
||||
IInsuranceManagerService insuranceManagerService;
|
||||
|
||||
@Autowired
|
||||
private GoodsImgsService goodsImgsService;
|
||||
|
||||
|
|
@ -145,6 +156,17 @@ public class GoodsDeptCategoryController extends BaseController {
|
|||
@GetMapping("/edit/{id}")
|
||||
public String edit(@PathVariable("id") Long id, ModelMap mmap) {
|
||||
DeptGoodsCategory deptGoodsCategory = deptGoodsCategoryService.get(id);
|
||||
CategoryInsuranceRelation relation = new CategoryInsuranceRelation();
|
||||
relation.setGoodsCategoryId(deptGoodsCategory.getGoodsCategoryId());
|
||||
List<CategoryInsuranceRelation> relations = categoryInsuranceRelationService.selectCategoryInsuranceRelationList(relation);
|
||||
List<InsuranceManager> list = null;
|
||||
if(CollectionUtil.isNotEmpty(relations)){
|
||||
list = insuranceManagerService.selectByIds(relations.stream().map(CategoryInsuranceRelation::getInsuranceId).collect(Collectors.toList()));
|
||||
list.forEach(model->{
|
||||
model.setInsuranceName(model.getCompanyName() + "||" + model.getInsuranceName() + "||" + model.getInsuranceAmount() + "元");
|
||||
});
|
||||
}
|
||||
mmap.put("insurances", list);
|
||||
mmap.put("deptGoodsCategory", deptGoodsCategory);
|
||||
return PREFIX + "/edit";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -238,14 +238,31 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-6 control-label">是否需要保险:</label>
|
||||
<div class="col-sm-6">
|
||||
<select name="isSure" class="form-control m-b" th:field="*{isSure}" th:with="type=${@dict.getType('sys_user_sex')}">
|
||||
<option th:text="否" th:value="0"/>
|
||||
<option th:text="是" th:value="1"/>
|
||||
</select>
|
||||
<label class="col-xs-3 control-label">PC保险设定:</label>
|
||||
<div class="col-xs-9">
|
||||
<label th:each="insurance:${insurances}" class="check-box">
|
||||
<input name="pcInsurance" type="checkbox" th:value="${insurance.id}" th:text="${insurance.insuranceName}" th:checked="${insurance.flag}">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group">
|
||||
<label class="col-xs-3 control-label">商城保险设定:</label>
|
||||
<div class="col-xs-9">
|
||||
<label th:each="insurance:${insurances}" class="check-box">
|
||||
<input name="shopInsurance" type="checkbox" th:value="${insurance.id}" th:text="${insurance.insuranceName}" th:checked="${insurance.flag}">
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ghy.goods.mapper;
|
||||
import java.util.List;
|
||||
import com.ghy.goods.domain.InsuranceManager;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 保险管理Mapper接口
|
||||
|
|
@ -57,4 +58,7 @@ public interface InsuranceManagerMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteInsuranceManagerByIds(String[] ids);
|
||||
|
||||
List<InsuranceManager> selectByIds(@Param("ids") List<Long> ids);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,6 +27,8 @@ public interface IInsuranceManagerService
|
|||
*/
|
||||
public List<InsuranceManager> selectInsuranceManagerList(InsuranceManager insuranceManager);
|
||||
|
||||
public List<InsuranceManager> selectByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 新增保险管理
|
||||
*
|
||||
|
|
|
|||
|
|
@ -45,6 +45,11 @@ public class InsuranceManagerServiceImpl implements IInsuranceManagerService
|
|||
return insuranceManagerMapper.selectInsuranceManagerList(insuranceManager);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InsuranceManager> selectByIds(List<Long> ids) {
|
||||
return insuranceManagerMapper.selectByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保险管理
|
||||
*
|
||||
|
|
|
|||
|
|
@ -89,4 +89,11 @@
|
|||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectByIds" resultMap="InsuranceManagerResult">
|
||||
<include refid="selectInsuranceManagerVo"/>
|
||||
where id in
|
||||
<foreach collection="ids" item="name" open="(" separator="," close=")">
|
||||
#{name}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue