diff --git a/admin-hanhai-vue/.env.development b/admin-hanhai-vue/.env.development index ce445d0..7456dcc 100644 --- a/admin-hanhai-vue/.env.development +++ b/admin-hanhai-vue/.env.development @@ -1,5 +1,5 @@ NODE_ENV=development -VUE_APP_API_BASE_URL=http://localhost:8002/employ-api/ +VUE_APP_API_BASE_URL=http://localhost:8003/employ-api/ //VUE_APP_API_BASE_URL=http://localhost:8000/employ-api/ VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview diff --git a/admin-hanhai-vue/.env.production b/admin-hanhai-vue/.env.production index e391586..9e7e600 100644 --- a/admin-hanhai-vue/.env.production +++ b/admin-hanhai-vue/.env.production @@ -1,5 +1,5 @@ NODE_ENV=production -VUE_APP_API_BASE_URL=http://localhost:8081/employ-api/ +VUE_APP_API_BASE_URL=/employ-api/ //VUE_APP_API_BASE_URL=http://localhost:8000/employ-api/ VUE_APP_CAS_BASE_URL=http://localhost:8888/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview \ No newline at end of file diff --git a/admin-hanhai-vue/dist.zip b/admin-hanhai-vue/dist.zip new file mode 100644 index 0000000..df8d006 Binary files /dev/null and b/admin-hanhai-vue/dist.zip differ diff --git a/admin-hanhai-vue/src/views/applet/insurance/CommonInsuranceOrderList.vue b/admin-hanhai-vue/src/views/applet/insurance/CommonInsuranceOrderList.vue index 584f1ec..e38acad 100644 --- a/admin-hanhai-vue/src/views/applet/insurance/CommonInsuranceOrderList.vue +++ b/admin-hanhai-vue/src/views/applet/insurance/CommonInsuranceOrderList.vue @@ -126,6 +126,11 @@ align:"center", dataIndex: 'userId_dictText' }, + { + title:'姓名', + align:"center", + dataIndex: 'name' + }, { title:'金额', align:"center", @@ -142,6 +147,18 @@ dataIndex: 'warranty', scopedSlots: {customRender: 'imgSlot'} }, + { + title:'身份证正面', + align:"center", + dataIndex: 'idCardFront', + scopedSlots: {customRender: 'imgSlot'} + }, + { + title:'身份证反面', + align:"center", + dataIndex: 'idCardBack', + scopedSlots: {customRender: 'imgSlot'} + }, { title: '操作', dataIndex: 'action', diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/controller/CommonInsuranceOrderController.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/controller/CommonInsuranceOrderController.java new file mode 100644 index 0000000..7b32c33 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/controller/CommonInsuranceOrderController.java @@ -0,0 +1,191 @@ +package org.jeecg.modules.commonInsuranceOrder.controller; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.commonInsuranceOrder.entity.CommonInsuranceOrder; +import org.jeecg.modules.commonInsuranceOrder.service.ICommonInsuranceOrderService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecg.modules.employAuthenticationPerson.entity.EmployAuthenticationPerson; +import org.jeecg.modules.employAuthenticationPerson.service.IEmployAuthenticationPersonService; +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.jeecg.common.aspect.annotation.AutoLog; + + /** + * @Description: 保险订单 + * @Author: jeecg-boot + * @Date: 2025-09-17 + * @Version: V1.0 + */ +@Api(tags="保险订单") +@RestController +@RequestMapping("/commonInsuranceOrder/commonInsuranceOrder") +@Slf4j +public class CommonInsuranceOrderController extends JeecgController { + @Autowired + private ICommonInsuranceOrderService commonInsuranceOrderService; + @Autowired + private IEmployAuthenticationPersonService employAuthenticationPersonService; + + /** + * 分页列表查询 + * + * @param commonInsuranceOrder + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "保险订单-分页列表查询") + @ApiOperation(value="保险订单-分页列表查询", notes="保险订单-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(CommonInsuranceOrder commonInsuranceOrder, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(commonInsuranceOrder, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + + IPage pageList = commonInsuranceOrderService.page(page, queryWrapper); + + for (CommonInsuranceOrder record : pageList.getRecords()) { + + EmployAuthenticationPerson p = employAuthenticationPersonService.lambdaQuery() + .eq(EmployAuthenticationPerson::getUserId, record.getUserId()) + .one(); + + if (p != null){ + record.setIdCardBack(p.getCerImageBack()); + record.setIdCardFront(p.getCerImageFront()); + record.setName(p.getName()); + } + + } + + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param commonInsuranceOrder + * @return + */ + @AutoLog(value = "保险订单-添加") + @ApiOperation(value="保险订单-添加", notes="保险订单-添加") + @PostMapping(value = "/add") + public Result add(@RequestBody CommonInsuranceOrder commonInsuranceOrder) { + commonInsuranceOrderService.save(commonInsuranceOrder); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param commonInsuranceOrder + * @return + */ + @AutoLog(value = "保险订单-编辑") + @ApiOperation(value="保险订单-编辑", notes="保险订单-编辑") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody CommonInsuranceOrder commonInsuranceOrder) { + commonInsuranceOrderService.updateById(commonInsuranceOrder); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "保险订单-通过id删除") + @ApiOperation(value="保险订单-通过id删除", notes="保险订单-通过id删除") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + commonInsuranceOrderService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "保险订单-批量删除") + @ApiOperation(value="保险订单-批量删除", notes="保险订单-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.commonInsuranceOrderService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "保险订单-通过id查询") + @ApiOperation(value="保险订单-通过id查询", notes="保险订单-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + CommonInsuranceOrder commonInsuranceOrder = commonInsuranceOrderService.getById(id); + if(commonInsuranceOrder==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(commonInsuranceOrder); + } + + /** + * 导出excel + * + * @param request + * @param commonInsuranceOrder + */ + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, CommonInsuranceOrder commonInsuranceOrder) { + return super.exportXls(request, commonInsuranceOrder, CommonInsuranceOrder.class, "保险订单"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, CommonInsuranceOrder.class); + } + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/entity/CommonInsuranceOrder.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/entity/CommonInsuranceOrder.java new file mode 100644 index 0000000..753da73 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/entity/CommonInsuranceOrder.java @@ -0,0 +1,77 @@ +package org.jeecg.modules.commonInsuranceOrder.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 保险订单 + * @Author: jeecg-boot + * @Date: 2025-09-17 + * @Version: V1.0 + */ +@Data +@TableName("common_insurance_order") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="common_insurance_order对象", description="保险订单") +public class CommonInsuranceOrder implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**所属部门*/ + @ApiModelProperty(value = "所属部门") + private java.lang.String sysOrgCode; + /**用户*/ + @Excel(name = "用户", width = 15) + @ApiModelProperty(value = "用户") + private java.lang.String userId; + /**金额*/ + @Excel(name = "金额", width = 15) + @ApiModelProperty(value = "金额") + private java.math.BigDecimal price; + /**订单*/ + @Excel(name = "订单", width = 15) + @ApiModelProperty(value = "订单") + private java.lang.String orderId; + /**保单*/ + @Excel(name = "保单", width = 15) + @ApiModelProperty(value = "保单") + private java.lang.String warranty; + + @TableField(exist = false) + private String idCardFront; + @TableField(exist = false) + private String idCardBack; + @TableField(exist = false) + private String name; +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/mapper/CommonInsuranceOrderMapper.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/mapper/CommonInsuranceOrderMapper.java new file mode 100644 index 0000000..987d320 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/mapper/CommonInsuranceOrderMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.commonInsuranceOrder.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.commonInsuranceOrder.entity.CommonInsuranceOrder; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 保险订单 + * @Author: jeecg-boot + * @Date: 2025-09-17 + * @Version: V1.0 + */ +public interface CommonInsuranceOrderMapper extends BaseMapper { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/mapper/xml/CommonInsuranceOrderMapper.xml b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/mapper/xml/CommonInsuranceOrderMapper.xml new file mode 100644 index 0000000..2088f60 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/mapper/xml/CommonInsuranceOrderMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/service/ICommonInsuranceOrderService.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/service/ICommonInsuranceOrderService.java new file mode 100644 index 0000000..beb4958 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/service/ICommonInsuranceOrderService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.commonInsuranceOrder.service; + +import org.jeecg.modules.commonInsuranceOrder.entity.CommonInsuranceOrder; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 保险订单 + * @Author: jeecg-boot + * @Date: 2025-09-17 + * @Version: V1.0 + */ +public interface ICommonInsuranceOrderService extends IService { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/service/impl/CommonInsuranceOrderServiceImpl.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/service/impl/CommonInsuranceOrderServiceImpl.java new file mode 100644 index 0000000..3cb8722 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/service/impl/CommonInsuranceOrderServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.commonInsuranceOrder.service.impl; + +import org.jeecg.modules.commonInsuranceOrder.entity.CommonInsuranceOrder; +import org.jeecg.modules.commonInsuranceOrder.mapper.CommonInsuranceOrderMapper; +import org.jeecg.modules.commonInsuranceOrder.service.ICommonInsuranceOrderService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 保险订单 + * @Author: jeecg-boot + * @Date: 2025-09-17 + * @Version: V1.0 + */ +@Service +public class CommonInsuranceOrderServiceImpl extends ServiceImpl implements ICommonInsuranceOrderService { + +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue/CommonInsuranceOrderList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue/CommonInsuranceOrderList.vue new file mode 100644 index 0000000..584f1ec --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue/CommonInsuranceOrderList.vue @@ -0,0 +1,190 @@ + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue/modules/CommonInsuranceOrderForm.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue/modules/CommonInsuranceOrderForm.vue new file mode 100644 index 0000000..96c4067 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue/modules/CommonInsuranceOrderForm.vue @@ -0,0 +1,119 @@ + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue/modules/CommonInsuranceOrderModal.Style#Drawer.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue/modules/CommonInsuranceOrderModal.Style#Drawer.vue new file mode 100644 index 0000000..48e3ea1 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue/modules/CommonInsuranceOrderModal.Style#Drawer.vue @@ -0,0 +1,84 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue/modules/CommonInsuranceOrderModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue/modules/CommonInsuranceOrderModal.vue new file mode 100644 index 0000000..cf52b64 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue/modules/CommonInsuranceOrderModal.vue @@ -0,0 +1,60 @@ + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue3/CommonInsuranceOrder.api.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue3/CommonInsuranceOrder.api.ts new file mode 100644 index 0000000..9e6e4e7 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue3/CommonInsuranceOrder.api.ts @@ -0,0 +1,61 @@ +import {defHttp} from '/@/utils/http/axios'; +import {Modal} from 'ant-design-vue'; + +enum Api { + list = '/commonInsuranceOrder/commonInsuranceOrder/list', + save='/commonInsuranceOrder/commonInsuranceOrder/add', + edit='/commonInsuranceOrder/commonInsuranceOrder/edit', + deleteOne = '/commonInsuranceOrder/commonInsuranceOrder/delete', + deleteBatch = '/commonInsuranceOrder/commonInsuranceOrder/deleteBatch', + importExcel = '/commonInsuranceOrder/commonInsuranceOrder/importExcel', + exportXls = '/commonInsuranceOrder/commonInsuranceOrder/exportXls', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + Modal.confirm({ + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue3/CommonInsuranceOrder.data.ts b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue3/CommonInsuranceOrder.data.ts new file mode 100644 index 0000000..603a44c --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue3/CommonInsuranceOrder.data.ts @@ -0,0 +1,62 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '用户', + align:"center", + dataIndex: 'userId_dictText' + }, + { + title: '金额', + align:"center", + dataIndex: 'price' + }, + { + title: '订单', + align:"center", + dataIndex: 'orderId_dictText' + }, + { + title: '保单', + align:"center", + dataIndex: 'warranty', + customRender:render.renderAvatar, + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '用户', + field: 'userId', + component: 'JSearchSelect', + componentProps:{ + dict:"" + }, + }, + { + label: '金额', + field: 'price', + component: 'InputNumber', + }, + { + label: '订单', + field: 'orderId', + component: 'JSearchSelect', + componentProps:{ + dict:"" + }, + }, + { + label: '保单', + field: 'warranty', + component: 'JImageUpload', + componentProps:{ + }, + }, +]; diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue3/CommonInsuranceOrderList.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue3/CommonInsuranceOrderList.vue new file mode 100644 index 0000000..0c5e6b5 --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue3/CommonInsuranceOrderList.vue @@ -0,0 +1,162 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue3/components/CommonInsuranceOrderModal.vue b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue3/components/CommonInsuranceOrderModal.vue new file mode 100644 index 0000000..d6e20ca --- /dev/null +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/commonInsuranceOrder/vue3/components/CommonInsuranceOrderModal.vue @@ -0,0 +1,58 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employAmountLog/entity/EmployAmountLog.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employAmountLog/entity/EmployAmountLog.java index b46c006..f4c950c 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employAmountLog/entity/EmployAmountLog.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employAmountLog/entity/EmployAmountLog.java @@ -65,4 +65,7 @@ public class EmployAmountLog implements Serializable { @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") @ApiModelProperty(value = "关联用户id") private java.lang.String userId; + /**关联用户id*/ + @ApiModelProperty(value = "平台佣金") + private java.lang.String isPlatform; } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employJob/entity/EmployJob.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employJob/entity/EmployJob.java index d9f7932..5f0514e 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employJob/entity/EmployJob.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/employJob/entity/EmployJob.java @@ -127,6 +127,11 @@ public class EmployJob implements Serializable { @ApiModelProperty(value = "工作结束时间") private java.lang.String endTime; + /**招聘状态*/ + @Excel(name = "招聘状态", width = 15) + @ApiModelProperty(value = "招聘状态 0进行 1停止") + private java.lang.String status; + //实名信息 @TableField(exist = false) private EmployAuthenticationPerson employAuthenticationPerson; diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/employController/JobController.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/employController/JobController.java index 27e0eda..afb5aa9 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/employController/JobController.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/employController/JobController.java @@ -61,6 +61,13 @@ public class JobController { return jobService.updateJob(token, employJob); } + //工作信息-停止招聘 + @ApiOperation(value="工作信息-停止招聘", notes="工作信息-停止招聘") + @RequestMapping(value = "/stopJob", method = {RequestMethod.POST}) + public Result stop(@RequestHeader("X-Access-Token")String token, String id){ + return jobService.stop(token, id); + } + //工作信息-删除工作信息 @ApiOperation(value="工作信息-删除工作信息", notes="工作信息-删除工作信息") @RequestMapping(value = "/deleteJob", method = {RequestMethod.POST}) diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/JobService.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/JobService.java index 7067594..43f87da 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/JobService.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/JobService.java @@ -16,6 +16,9 @@ public interface JobService { //工作信息-根据Id查看工作详情 public Result queryJobById(String token, String jobId); + public Result stop(String token, String jobId); + + //工作信息-我的发布 public Result queryJobListByUserId(String token, PageBean pageBean); diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/AmountServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/AmountServiceImpl.java index dded799..266785b 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/AmountServiceImpl.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/AmountServiceImpl.java @@ -117,7 +117,7 @@ public class AmountServiceImpl implements AmountService { int i1 = Double.valueOf(s).intValue(); Object appOrder = mpWxPayService.createOrder( - "购买"+ productName , + "购买"+ productName, "127.0.0.1", employTrade.getId(), i1, @@ -192,6 +192,7 @@ public class AmountServiceImpl implements AmountService { //分页 page = new Page(pageBean.getPageNo(), pageBean.getPageSize()); LambdaQueryChainWrapper query = employAmountLogService.lambdaQuery() + .ne(EmployAmountLog::getIsPlatform, "Y") .eq(EmployAmountLog::getUserId, hanHaiMember.getId()); //金额明细关联用户 diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/JobServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/JobServiceImpl.java index a2dea76..481ab61 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/JobServiceImpl.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/JobServiceImpl.java @@ -74,7 +74,8 @@ public class JobServiceImpl implements JobService { try{ //分页 page = new Page(pageBean.getPageNo(), pageBean.getPageSize()); - LambdaQueryChainWrapper query = employJobService.lambdaQuery(); + LambdaQueryChainWrapper query = employJobService.lambdaQuery() + .eq(EmployJob::getStatus, "0"); //组装查询条件 if(null != employJob.getCategoryOne()){ @@ -127,6 +128,32 @@ public class JobServiceImpl implements JobService { } } + @Override + public Result stop(String token, String jobId) { + // 权限验证 + HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); + + try { + EmployJob job = employJobService.getById(jobId); + if (job == null) { + return Result.error("未找到对应的工作信息"); + } + + // 假设“停止”操作是将状态设置为“1” + job.setStatus("1"); + boolean result = employJobService.updateById(job); + + if (result) { + return Result.OK("工作信息已停止"); + } else { + return Result.error("停止失败"); + } + } catch (Exception e) { + e.printStackTrace(); + return Result.error("系统异常,停止失败"); + } + } + //工作信息-根据Id查看工作详情 @Override @@ -256,6 +283,7 @@ public class JobServiceImpl implements JobService { if(null == authenticationPerson){ return Result.error("未进行个人实名认证或个人实名认证审核未通过,请先去进行个人实名认证"); } + employJob.setStatus("0"); employJobService.save(employJob); return Result.OK("工作信息添加成功"); // employJob.setUserId(hanHaiMember.getId()); diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/OrderServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/OrderServiceImpl.java index f49da85..42c4214 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/OrderServiceImpl.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/apiService/impl/OrderServiceImpl.java @@ -10,6 +10,8 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.config.shiro.ShiroRealm; import org.jeecg.modules.apiBean.PageBean; import org.jeecg.modules.apiService.OrderService; +import org.jeecg.modules.commonInsuranceOrder.entity.CommonInsuranceOrder; +import org.jeecg.modules.commonInsuranceOrder.service.ICommonInsuranceOrderService; import org.jeecg.modules.employAmountLog.entity.EmployAmountLog; import org.jeecg.modules.employAmountLog.service.IEmployAmountLogService; import org.jeecg.modules.employAuthenticationCompany.entity.EmployAuthenticationCompany; @@ -83,11 +85,36 @@ public class OrderServiceImpl implements OrderService { private IEmployConfigService employConfigService; + @Autowired + private ICommonInsuranceOrderService commonInsuranceOrderService; + + //支付接口 @Autowired private MpWxPayService mpWxPayService; /******************************************************************************************************************/ + /** + * 创建保险记录 + * @param userId 用户ID + * @param price 保险费用 + * @param orderId 订单ID + */ + private void createInsuranceRecord(String userId, BigDecimal price, String orderId) { + try { + CommonInsuranceOrder insuranceOrder = new CommonInsuranceOrder(); + insuranceOrder.setUserId(userId); + insuranceOrder.setPrice(price); + insuranceOrder.setOrderId(orderId); + insuranceOrder.setCreateTime(new Date()); + + commonInsuranceOrderService.save(insuranceOrder); + log.info("保险记录创建成功,用户ID:{},订单ID:{},保险费用:{}", userId, orderId, price); + } catch (Exception e) { + log.error("创建保险记录失败,用户ID:{},订单ID:{},保险费用:{}", userId, orderId, price, e); + } + } + //订单信息-查看订单列表 @Override public Result queryOrderList(String token, String status, String role, PageBean pageBean) { @@ -290,6 +317,12 @@ public class OrderServiceImpl implements OrderService { order.setOrderStatusSeek("Y"); employOrderService.updateById(order); + // 创建保险记录,使用getJobSeekerFromOrder确保获取的是求职者 + HanHaiMember jobSeeker = getJobSeekerFromOrder(order); + if (jobSeeker != null) { + createInsuranceRecord(jobSeeker.getId(), payPrice, order.getId()); + } + return Result.OK("余额支付成功",order); }else{ @@ -698,6 +731,8 @@ public class OrderServiceImpl implements OrderService { //试工费用 public void addMemberAmount(HanHaiMember hanHaiMember, BigDecimal payPrice, String title){ + BigDecimal oldPrice = payPrice; + List commission = employConfigService.lambdaQuery() .eq(EmployConfig::getParamCode, "commission") .list(); @@ -706,7 +741,16 @@ public class OrderServiceImpl implements OrderService { EmployConfig employConfig = commission.get(0); try { String val = employConfig.getParamValueText(); - payPrice = payPrice.divide(new BigDecimal(val)); + payPrice = payPrice.multiply(new BigDecimal(val)); + + EmployAmountLog log = new EmployAmountLog(); + log.setTitle("平台佣金"); + log.setUserId(hanHaiMember.getId()); + log.setAmount(oldPrice.subtract(payPrice)); + log.setType("1"); + log.setIsPlatform("Y"); + employAmountLogService.save(log); + }catch (Exception e){ log.error(e.getMessage()); } @@ -719,6 +763,7 @@ public class OrderServiceImpl implements OrderService { amountLog.setTitle(title); amountLog.setAmount(payPrice); amountLog.setType("1"); + amountLog.setIsPlatform("N"); amountLog.setUserId(hanHaiMember.getId()); employAmountLogService.save(amountLog); } @@ -731,6 +776,7 @@ public class OrderServiceImpl implements OrderService { amountLog.setTitle(title); amountLog.setAmount(payPrice); amountLog.setType("0"); + amountLog.setIsPlatform("N"); amountLog.setUserId(hanHaiMember.getId()); employAmountLogService.save(amountLog); } @@ -749,6 +795,12 @@ public class OrderServiceImpl implements OrderService { order.setOrderStatusSeek("Y"); employOrderService.updateById(order); + // 微信支付成功后创建保险记录,使用getJobSeekerFromOrder确保获取的是求职者 + HanHaiMember jobSeeker = getJobSeekerFromOrder(order); + if (jobSeeker != null) { + createInsuranceRecord(jobSeeker.getId(), order.getPremium(), order.getId()); + } + return "" + " " + " " + @@ -837,4 +889,5 @@ public class OrderServiceImpl implements OrderService { return null; } + } diff --git a/jeecg-boot-module-system/src/main/resources/application-dev.yml b/jeecg-boot-module-system/src/main/resources/application-dev.yml index a9f05b3..fa85f8b 100644 --- a/jeecg-boot-module-system/src/main/resources/application-dev.yml +++ b/jeecg-boot-module-system/src/main/resources/application-dev.yml @@ -1,5 +1,5 @@ server: - port: 8002 + port: 8003 tomcat: max-swallow-size: -1 error: