From 481ced58bbbf785df75c0daff561739f2bd56867 Mon Sep 17 00:00:00 2001 From: yangjun <1173114630@qq.com> Date: Fri, 27 Feb 2026 13:42:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E5=85=A5=E9=A9=BB=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../nu/modules/suppliers/ISuppliersApi.java | 4 +- .../NuBizSuppliersApplyController.java | 62 ++- .../NuBizSuppliersInfoController.java | 180 ++++++ .../entity/NuBizSuppliersApply.java | 18 +- .../entity/NuBizSuppliersInfo.java | 104 ++++ .../mapper/NuBizSuppliersApplyMapper.java | 5 + .../mapper/NuBizSuppliersInfoMapper.java | 17 + .../mapper/xml/NuBizSuppliersApplyMapper.xml | 52 ++ .../mapper/xml/NuBizSuppliersInfoMapper.xml | 5 + .../service/INuBizSuppliersApplyService.java | 15 + .../service/INuBizSuppliersInfoService.java | 14 + .../impl/NuBizSuppliersApplyServiceImpl.java | 523 +++++++++++++----- .../impl/NuBizSuppliersInfoServiceImpl.java | 19 + .../wechat/suppliers/SuppliersApi.java | 31 +- .../com/nu/entity/SuppliersApplyEntity.java | 3 + 15 files changed, 895 insertions(+), 157 deletions(-) create mode 100644 nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/controller/NuBizSuppliersInfoController.java create mode 100644 nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/entity/NuBizSuppliersInfo.java create mode 100644 nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/mapper/NuBizSuppliersInfoMapper.java create mode 100644 nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/mapper/xml/NuBizSuppliersInfoMapper.xml create mode 100644 nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/service/INuBizSuppliersInfoService.java create mode 100644 nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/service/impl/NuBizSuppliersInfoServiceImpl.java diff --git a/nursing-unit-admin/nu-admin-api/nu-admin-local-api/src/main/java/com/nu/modules/suppliers/ISuppliersApi.java b/nursing-unit-admin/nu-admin-api/nu-admin-local-api/src/main/java/com/nu/modules/suppliers/ISuppliersApi.java index ceb2ee1..2f5e2b3 100644 --- a/nursing-unit-admin/nu-admin-api/nu-admin-local-api/src/main/java/com/nu/modules/suppliers/ISuppliersApi.java +++ b/nursing-unit-admin/nu-admin-api/nu-admin-local-api/src/main/java/com/nu/modules/suppliers/ISuppliersApi.java @@ -21,9 +21,11 @@ public interface ISuppliersApi { SuppliersApplyEntity editSuppliers(SuppliersApplyEntity suppliersApplyEntity); - SuppliersApplyEntity getSupInfoByOpenId(String openId, String orgCode,String id); + SuppliersApplyEntity getSupInfoByOpenId(String openId,String id); IPage getSuppliersAuditLog(Integer pageNo, Integer pageSize, String openId); boolean nameDuplicateChecked(SuppliersApplyEntity suppliersApplyEntity); + + SuppliersApplyEntity getSuppliersApplyInfo(String openId); } diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/controller/NuBizSuppliersApplyController.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/controller/NuBizSuppliersApplyController.java index b4ec138..8ca602d 100644 --- a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/controller/NuBizSuppliersApplyController.java +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/controller/NuBizSuppliersApplyController.java @@ -10,6 +10,9 @@ import java.io.UnsupportedEncodingException; import java.net.URLDecoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + +import com.nu.dto.SuppliersInfoMQDto; +import org.apache.commons.lang.StringUtils; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; import org.jeecg.common.system.query.QueryRuleEnum; @@ -28,6 +31,7 @@ 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.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; @@ -74,6 +78,19 @@ public class NuBizSuppliersApplyController extends JeecgController pageList = nuBizSuppliersApplyService.page(page, queryWrapper); return Result.OK(pageList); } + + + @ApiOperation(value="供应商入驻申请-分页列表查询", notes="供应商入驻申请-分页列表查询") + @GetMapping(value = "/listPage") + public Result> listPage(NuBizSuppliersApply nuBizSuppliersApply, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(nuBizSuppliersApply, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = nuBizSuppliersApplyService.listPage(page, queryWrapper); + return Result.OK(pageList); + } /** * 添加 @@ -98,9 +115,11 @@ public class NuBizSuppliersApplyController extends JeecgController edit(@RequestBody NuBizSuppliersApply nuBizSuppliersApply) { + if(StringUtils.equals("3",nuBizSuppliersApply.getApplyStatus())){ + nuBizSuppliersApply.setIzRejected("N"); + } nuBizSuppliersApplyService.updateById(nuBizSuppliersApply); return Result.OK("编辑成功!"); } @@ -177,4 +196,45 @@ public class NuBizSuppliersApplyController extends JeecgController audit(@RequestBody NuBizSuppliersApply nuConfigSuppliersApply) { + String orgCode = nuBizSuppliersApplyService.audit(nuConfigSuppliersApply); + return Result.OK("审核成功!"); + } + @AutoLog(value = "供应商入驻申请-变更审核") + @ApiOperation(value="供应商入驻申请-变更审核", notes="供应商入驻申请-变更审核") + @RequestMapping(value = "/bgAudit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result bgAudit(@RequestBody NuBizSuppliersApply nuConfigSuppliersApply) { + String orgCode = nuBizSuppliersApplyService.bgAudit(nuConfigSuppliersApply); + return Result.OK("审核成功!"); + } + + + /** + * 获取变更信息 + * + * @param suppliersApply + * @return + */ + @ApiOperation(value = "供应商信息变更申请-获取变更信息", notes = "供应商信息变更申请-获取变更信息") + @PostMapping(value = "/getModifyInfo") + public Result>> getModifyInfo(@RequestBody NuBizSuppliersApply suppliersApply) { + return Result.OK(nuBizSuppliersApplyService.getModifyInfo(suppliersApply)); + } + + @ApiOperation(value = "供应商变更历史比对信息", notes = "供应商变更历史比对信息") + @PostMapping(value = "/getModifyHistoryInfo") + public Result>> getModifyHistoryInfo(@RequestBody NuBizSuppliersApply suppliersApply) { + return Result.OK(nuBizSuppliersApplyService.getModifyHistoryInfo(suppliersApply)); + } + } diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/controller/NuBizSuppliersInfoController.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/controller/NuBizSuppliersInfoController.java new file mode 100644 index 0000000..71fef19 --- /dev/null +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/controller/NuBizSuppliersInfoController.java @@ -0,0 +1,180 @@ +package com.nu.modules.bizSuppliers.controller; + +import java.util.Arrays; +import java.util.HashMap; +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.system.query.QueryRuleEnum; +import org.jeecg.common.util.oConvertUtils; +import com.nu.modules.bizSuppliers.entity.NuBizSuppliersInfo; +import com.nu.modules.bizSuppliers.service.INuBizSuppliersInfoService; + +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.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; +import org.apache.shiro.authz.annotation.RequiresPermissions; + + /** + * @Description: 供应商信息 + * @Author: jeecg-boot + * @Date: 2026-02-26 + * @Version: V1.0 + */ +@Api(tags="供应商信息") +@RestController +@RequestMapping("/bizSuppliers/nuBizSuppliersInfo") +@Slf4j +public class NuBizSuppliersInfoController extends JeecgController { + @Autowired + private INuBizSuppliersInfoService nuBizSuppliersInfoService; + + /** + * 分页列表查询 + * + * @param nuBizSuppliersInfo + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "供应商信息-分页列表查询") + @ApiOperation(value="供应商信息-分页列表查询", notes="供应商信息-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(NuBizSuppliersInfo nuBizSuppliersInfo, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(nuBizSuppliersInfo, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = nuBizSuppliersInfoService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param nuBizSuppliersInfo + * @return + */ + @AutoLog(value = "供应商信息-添加") + @ApiOperation(value="供应商信息-添加", notes="供应商信息-添加") + @RequiresPermissions("bizSuppliers:nu_biz_suppliers_info:add") + @PostMapping(value = "/add") + public Result add(@RequestBody NuBizSuppliersInfo nuBizSuppliersInfo) { + nuBizSuppliersInfoService.save(nuBizSuppliersInfo); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param nuBizSuppliersInfo + * @return + */ + @AutoLog(value = "供应商信息-编辑") + @ApiOperation(value="供应商信息-编辑", notes="供应商信息-编辑") + @RequiresPermissions("bizSuppliers:nu_biz_suppliers_info:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody NuBizSuppliersInfo nuBizSuppliersInfo) { + nuBizSuppliersInfoService.updateById(nuBizSuppliersInfo); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "供应商信息-通过id删除") + @ApiOperation(value="供应商信息-通过id删除", notes="供应商信息-通过id删除") + @RequiresPermissions("bizSuppliers:nu_biz_suppliers_info:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + nuBizSuppliersInfoService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "供应商信息-批量删除") + @ApiOperation(value="供应商信息-批量删除", notes="供应商信息-批量删除") + @RequiresPermissions("bizSuppliers:nu_biz_suppliers_info:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.nuBizSuppliersInfoService.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) { + NuBizSuppliersInfo nuBizSuppliersInfo = nuBizSuppliersInfoService.getById(id); + if(nuBizSuppliersInfo==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(nuBizSuppliersInfo); + } + + /** + * 导出excel + * + * @param request + * @param nuBizSuppliersInfo + */ + @RequiresPermissions("bizSuppliers:nu_biz_suppliers_info:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, NuBizSuppliersInfo nuBizSuppliersInfo) { + return super.exportXls(request, nuBizSuppliersInfo, NuBizSuppliersInfo.class, "供应商信息"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("bizSuppliers:nu_biz_suppliers_info:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, NuBizSuppliersInfo.class); + } + +} diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/entity/NuBizSuppliersApply.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/entity/NuBizSuppliersApply.java index 4b10128..abc3d97 100644 --- a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/entity/NuBizSuppliersApply.java +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/entity/NuBizSuppliersApply.java @@ -4,10 +4,8 @@ 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.TableId; -import com.baomidou.mybatisplus.annotation.TableName; -import com.baomidou.mybatisplus.annotation.TableLogic; + +import com.baomidou.mybatisplus.annotation.*; import org.jeecg.common.constant.ProvinceCityArea; import org.jeecg.common.util.SpringContextUtils; import lombok.Data; @@ -45,6 +43,7 @@ public class NuBizSuppliersApply implements Serializable { /**供应商性质 1代理商 2批发商 3制造商*/ @Excel(name = "供应商性质 1代理商 2批发商 3制造商", width = 15) @ApiModelProperty(value = "供应商性质 1代理商 2批发商 3制造商") + @Dict(dicCode = "suppliers_nature") private java.lang.String suppliersNature; /**供应商地址*/ @Excel(name = "供应商地址", width = 15) @@ -61,6 +60,7 @@ public class NuBizSuppliersApply implements Serializable { /**供应状态 1正常供应 2暂停供应*/ @Excel(name = "供应状态 1正常供应 2暂停供应", width = 15) @ApiModelProperty(value = "供应状态 1正常供应 2暂停供应") + @Dict(dicCode = "supply_state") private java.lang.String supplyState; /**开户行*/ @Excel(name = "开户行", width = 15) @@ -114,4 +114,14 @@ public class NuBizSuppliersApply implements Serializable { @Excel(name = "是否被拒 Y被拒绝(申请审核驳回) N除了申请被驳回以外的所有情况", width = 15) @ApiModelProperty(value = "是否被拒 Y被拒绝(申请审核驳回) N除了申请被驳回以外的所有情况") private java.lang.String izRejected; + + private String applyContent; + private String applyStatus; + private String optType; + private String suppliersId; + private String izHistory; + + @TableField(exist = false) + private String status; + } diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/entity/NuBizSuppliersInfo.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/entity/NuBizSuppliersInfo.java new file mode 100644 index 0000000..dc7132b --- /dev/null +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/entity/NuBizSuppliersInfo.java @@ -0,0 +1,104 @@ +package com.nu.modules.bizSuppliers.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.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import org.jeecg.common.constant.ProvinceCityArea; +import org.jeecg.common.util.SpringContextUtils; +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: 2026-02-26 + * @Version: V1.0 + */ +@Data +@TableName("nu_biz_suppliers_info") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="nu_biz_suppliers_info对象", description="供应商信息") +public class NuBizSuppliersInfo implements Serializable { + private static final long serialVersionUID = 1L; + + /**id*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "id") + private java.lang.String id; + /**供应商名称*/ + @Excel(name = "供应商名称", width = 15) + @ApiModelProperty(value = "供应商名称") + private java.lang.String suppliersName; + /**供应商性质 1代理商 2批发商 3制造商*/ + @Excel(name = "供应商性质 1代理商 2批发商 3制造商", width = 15, dicCode = "suppliers_nature") + @Dict(dicCode = "suppliers_nature") + @ApiModelProperty(value = "供应商性质 1代理商 2批发商 3制造商") + private java.lang.String suppliersNature; + /**供应商地址*/ + @Excel(name = "供应商地址", width = 15) + @ApiModelProperty(value = "供应商地址") + private java.lang.String suppliersAddress; + /**负责人*/ + @Excel(name = "负责人", width = 15) + @ApiModelProperty(value = "负责人") + private java.lang.String personInCharge; + /**联系电话*/ + @Excel(name = "联系电话", width = 15) + @ApiModelProperty(value = "联系电话") + private java.lang.String contactNumber; + /**供应状态 1正常供应 2暂停供应*/ + @Excel(name = "供应状态 1正常供应 2暂停供应", width = 15, dicCode = "supply_status") + @Dict(dicCode = "supply_status") + @ApiModelProperty(value = "供应状态 1正常供应 2暂停供应") + private java.lang.String supplyState; + /**开户行*/ + @Excel(name = "开户行", width = 15) + @ApiModelProperty(value = "开户行") + private java.lang.String openingBank; + /**开户行账号*/ + @Excel(name = "开户行账号", width = 15) + @ApiModelProperty(value = "开户行账号") + private java.lang.String openingBankNo; + /**openId*/ + @Excel(name = "openId", width = 15) + @ApiModelProperty(value = "openId") + private java.lang.String openId; + /**资质照片*/ + @Excel(name = "资质照片", width = 15) + @ApiModelProperty(value = "资质照片") + private java.lang.String imgPath; + /**是否删除 0未删除 1删除*/ + @Excel(name = "是否删除 0未删除 1删除", width = 15) + @ApiModelProperty(value = "是否删除 0未删除 1删除") + @TableLogic + private java.lang.String delFlag; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; +} diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/mapper/NuBizSuppliersApplyMapper.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/mapper/NuBizSuppliersApplyMapper.java index 2d75b85..2faeb73 100644 --- a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/mapper/NuBizSuppliersApplyMapper.java +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/mapper/NuBizSuppliersApplyMapper.java @@ -2,7 +2,10 @@ package com.nu.modules.bizSuppliers.mapper; import java.util.List; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.nu.entity.SuppliersOrgAllEntity; import com.nu.modules.orgapplyinfo.entity.OrgAllInfoApiEntity; import org.apache.ibatis.annotations.Param; @@ -22,4 +25,6 @@ public interface NuBizSuppliersApplyMapper extends BaseMapper getApplySuppliersOrgInfo(IPage page,@Param("orgCode") String orgCode,@Param("title") String title,@Param("openId") String openId); IPage getSuppliersAuditLog(IPage page,@Param("openId") String openId); + + IPage listPage(Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper); } diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/mapper/NuBizSuppliersInfoMapper.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/mapper/NuBizSuppliersInfoMapper.java new file mode 100644 index 0000000..466d000 --- /dev/null +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/mapper/NuBizSuppliersInfoMapper.java @@ -0,0 +1,17 @@ +package com.nu.modules.bizSuppliers.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import com.nu.modules.bizSuppliers.entity.NuBizSuppliersInfo; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 供应商信息 + * @Author: jeecg-boot + * @Date: 2026-02-26 + * @Version: V1.0 + */ +public interface NuBizSuppliersInfoMapper extends BaseMapper { + +} diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/mapper/xml/NuBizSuppliersApplyMapper.xml b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/mapper/xml/NuBizSuppliersApplyMapper.xml index 7f0b67c..2e7a683 100644 --- a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/mapper/xml/NuBizSuppliersApplyMapper.xml +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/mapper/xml/NuBizSuppliersApplyMapper.xml @@ -72,4 +72,56 @@ and s.open_id = #{openId} order by s.create_time desc + + diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/mapper/xml/NuBizSuppliersInfoMapper.xml b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/mapper/xml/NuBizSuppliersInfoMapper.xml new file mode 100644 index 0000000..828333a --- /dev/null +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/mapper/xml/NuBizSuppliersInfoMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/service/INuBizSuppliersApplyService.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/service/INuBizSuppliersApplyService.java index 7a6e79e..3682f82 100644 --- a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/service/INuBizSuppliersApplyService.java +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/service/INuBizSuppliersApplyService.java @@ -1,8 +1,14 @@ package com.nu.modules.bizSuppliers.service; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.nu.modules.bizSuppliers.entity.NuBizSuppliersApply; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; +import java.util.Map; + /** * @Description: 供应商信息 * @Author: jeecg-boot @@ -11,4 +17,13 @@ import com.baomidou.mybatisplus.extension.service.IService; */ public interface INuBizSuppliersApplyService extends IService { + IPage listPage(Page page, QueryWrapper queryWrapper); + + String audit(NuBizSuppliersApply nuConfigSuppliersApply); + + List> getModifyHistoryInfo(NuBizSuppliersApply suppliersApply); + + List> getModifyInfo(NuBizSuppliersApply suppliersApply); + + String bgAudit(NuBizSuppliersApply nuConfigSuppliersApply); } diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/service/INuBizSuppliersInfoService.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/service/INuBizSuppliersInfoService.java new file mode 100644 index 0000000..8d0d793 --- /dev/null +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/service/INuBizSuppliersInfoService.java @@ -0,0 +1,14 @@ +package com.nu.modules.bizSuppliers.service; + +import com.nu.modules.bizSuppliers.entity.NuBizSuppliersInfo; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 供应商信息 + * @Author: jeecg-boot + * @Date: 2026-02-26 + * @Version: V1.0 + */ +public interface INuBizSuppliersInfoService extends IService { + +} diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/service/impl/NuBizSuppliersApplyServiceImpl.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/service/impl/NuBizSuppliersApplyServiceImpl.java index bd500d3..92c345f 100644 --- a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/service/impl/NuBizSuppliersApplyServiceImpl.java +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/service/impl/NuBizSuppliersApplyServiceImpl.java @@ -1,22 +1,28 @@ package com.nu.modules.bizSuppliers.service.impl; +import cn.hutool.core.util.IdUtil; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.Maps; import com.nu.dto.SuppliersInfoMQDto; -import com.nu.entity.EmployeesAdvisoryInfoEntity; -import com.nu.entity.SuppliersApplyEntity; -import com.nu.entity.SuppliersOrgAllEntity; -import com.nu.entity.SuppliersOrgEntity; +import com.nu.entity.*; +import com.nu.enums.WxClientType; import com.nu.modules.EmployeesInfo.api.IEmployeesAdvisioryInfoApi; import com.nu.modules.bizSuppliers.entity.NuBizSuppliersApply; +import com.nu.modules.bizSuppliers.entity.NuBizSuppliersInfo; import com.nu.modules.bizSuppliers.entity.NuBizSuppliersOrg; import com.nu.modules.bizSuppliers.mapper.NuBizSuppliersApplyMapper; +import com.nu.modules.bizSuppliers.mapper.NuBizSuppliersInfoMapper; import com.nu.modules.bizSuppliers.mapper.NuBizSuppliersOrgMapper; import com.nu.modules.bizSuppliers.service.INuBizSuppliersApplyService; import com.nu.modules.bizSuppliers.service.INuBizSuppliersOrgService; import com.nu.modules.suppliers.ISuppliersApi; +import com.nu.modules.wxnotice.IWxNoticeApi; +import com.nu.utils.DictUtils; import com.nu.utils.RabbitMQUtil; import org.apache.commons.lang.StringUtils; import org.springframework.beans.BeanUtils; @@ -26,7 +32,9 @@ import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.springframework.util.CollectionUtils; -import java.util.List; +import java.lang.reflect.Field; +import java.text.SimpleDateFormat; +import java.util.*; /** * @Description: 供应商信息 @@ -44,32 +52,37 @@ public class NuBizSuppliersApplyServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); -// queryWrapper.eq("open_id", suppliersApplyEntity.getOpenId()); -// List list = baseMapper.selectList(queryWrapper); -// if (list.size() > 0) { -// BeanUtils.copyProperties(list.get(0), suppliersApplyEntity); -// return suppliersApplyEntity; -// } - NuBizSuppliersApply nuBizSuppliersApply = new NuBizSuppliersApply(); - if (StringUtils.isNotBlank(suppliersApplyEntity.getId())) { - //上次申请被拒绝 - BeanUtils.copyProperties(suppliersApplyEntity, nuBizSuppliersApply); - nuBizSuppliersApply.setIzRejected("N"); - baseMapper.updateById(nuBizSuppliersApply); - } else { - //第一次申请 - BeanUtils.copyProperties(suppliersApplyEntity, nuBizSuppliersApply); - nuBizSuppliersApply.setIzRejected("N"); - baseMapper.insert(nuBizSuppliersApply); - } + //修改原来的数据都改为历史数据 + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.eq("open_id", suppliersApplyEntity.getOpenId()); + updateWrapper.eq("iz_history","N"); + NuBizSuppliersApply nuBizSuppliersApply1 = new NuBizSuppliersApply(); + nuBizSuppliersApply1.setIzHistory("Y"); + baseMapper.update(nuBizSuppliersApply1, updateWrapper); + NuBizSuppliersApply nuBizSuppliersApply = new NuBizSuppliersApply(); + //第一次申请 + BeanUtils.copyProperties(suppliersApplyEntity, nuBizSuppliersApply); + nuBizSuppliersApply.setIzRejected("N"); + nuBizSuppliersApply.setIzHistory("N"); + nuBizSuppliersApply.setOptType("入驻"); + nuBizSuppliersApply.setApplyStatus("1"); + nuBizSuppliersApply.setSuppliersId(nuBizSuppliersApply.getId()); + nuBizSuppliersApply.setCreateTime(new Date()); + baseMapper.insert(nuBizSuppliersApply); //修改此用户信息咨询表iz_gys(是否供应商)置为Y EmployeesAdvisoryInfoEntity edEntity = new EmployeesAdvisoryInfoEntity(); @@ -83,6 +96,38 @@ public class NuBizSuppliersApplyServiceImpl extends ServiceImpl uw = new UpdateWrapper<>(); + uw.eq("suppliers_id", suppliersApplyEntity.getSuppliersId()); + uw.eq("iz_history","N"); + NuBizSuppliersApply soDto = new NuBizSuppliersApply(); + soDto.setIzHistory("Y"); + soDto.setUpdateTime(new Date()); + baseMapper.update(soDto, uw); + + //插入新的数据 + NuBizSuppliersApply addDto = new NuBizSuppliersApply(); + addDto.setOpenId(suppliersApplyEntity.getOpenId()); + addDto.setSuppliersId(suppliersApplyEntity.getSuppliersId()); + addDto.setApplyStatus("4");//变更申请 + addDto.setIzHistory("N"); + addDto.setOptType("变更"); + addDto.setSuppliersName(suppliersApplyEntity.getSuppliersName()); + addDto.setSuppliersNature(suppliersApplyEntity.getSuppliersNature()); + addDto.setSuppliersAddress(suppliersApplyEntity.getSuppliersAddress()); + addDto.setPersonInCharge(suppliersApplyEntity.getPersonInCharge()); + addDto.setContactNumber(suppliersApplyEntity.getContactNumber()); + addDto.setOpeningBank(suppliersApplyEntity.getOpeningBank()); + addDto.setOpeningBankNo(suppliersApplyEntity.getOpeningBankNo()); + addDto.setImgPath(suppliersApplyEntity.getImgPath()); + baseMapper.insert(addDto); + + return null; + } + @Override public IPage getSuppliersOrgInfo(Integer pageNo, Integer pageSize, String orgCode, String title, String openId) { IPage page = new Page<>(pageNo, pageSize); @@ -162,127 +207,20 @@ public class NuBizSuppliersApplyServiceImpl extends ServiceImpl uw = new UpdateWrapper<>(); - uw.eq("suppliers_id", suppliersApplyEntity.getId()); - uw.eq("org_code", suppliersApplyEntity.getOrgCode()); - NuBizSuppliersOrg soDto = new NuBizSuppliersOrg(); - soDto.setIzHistory("Y"); - suppliersOrgService.update(soDto, uw); - - //插入新的数据 - NuBizSuppliersOrg addDto = new NuBizSuppliersOrg(); - addDto.setOpenId(suppliersApplyEntity.getOpenId()); - addDto.setSuppliersId(suppliersApplyEntity.getId()); - addDto.setOrgCode(suppliersApplyEntity.getOrgCode()); - addDto.setStatus("4");//变更申请 - addDto.setApplyOrg(suppliersApplyEntity.getOrgCode()); - addDto.setIzHistory("N"); - addDto.setSuppliersName(suppliersApplyEntity.getSuppliersName()); - addDto.setSuppliersNature(suppliersApplyEntity.getSuppliersNature()); - addDto.setSuppliersAddress(suppliersApplyEntity.getSuppliersAddress()); - addDto.setPersonInCharge(suppliersApplyEntity.getPersonInCharge()); - addDto.setContactNumber(suppliersApplyEntity.getContactNumber()); - addDto.setOpeningBank(suppliersApplyEntity.getOpeningBank()); - addDto.setOpeningBankNo(suppliersApplyEntity.getOpeningBankNo()); - addDto.setImgPath(suppliersApplyEntity.getImgPath()); - suppliersOrgService.save(addDto); - - //通知业务平台去审核 - SuppliersInfoMQDto suppliersInfoMQDto = new SuppliersInfoMQDto(); - suppliersInfoMQDto.setSuppliersName(suppliersApplyEntity.getSuppliersName()); - suppliersInfoMQDto.setSuppliersNature(suppliersApplyEntity.getSuppliersNature()); - suppliersInfoMQDto.setSuppliersAddress(suppliersApplyEntity.getSuppliersAddress()); - suppliersInfoMQDto.setPersonInCharge(suppliersApplyEntity.getPersonInCharge()); - suppliersInfoMQDto.setContactNumber(suppliersApplyEntity.getContactNumber()); - suppliersInfoMQDto.setSupplyState(suppliersApplyEntity.getSupplyState()); - suppliersInfoMQDto.setOpeningBank(suppliersApplyEntity.getOpeningBank()); - suppliersInfoMQDto.setOpeningBankNo(suppliersApplyEntity.getOpeningBankNo()); - suppliersInfoMQDto.setImgPath(suppliersApplyEntity.getImgPath()); - suppliersInfoMQDto.setSysOrgCode(suppliersApplyEntity.getOrgCode()); - suppliersInfoMQDto.setSuppliersId(suppliersApplyEntity.getId()); - suppliersInfoMQDto.setApplyId(addDto.getId()); - suppliersInfoMQDto.setOptType("变更"); - rabbitMQUtil.sendToExchange("nu.suppliers.editSuppliersApply", suppliersApplyEntity.getOrgCode() + ".suppliers.editSuppliersApply", suppliersInfoMQDto); -// rabbitMQUtil.sendToExchange("nu.suppliers.editSuppliersApply", suppliersApplyEntity.getApplyOrg() + ".suppliers.editSuppliersApply", suppliersInfoMQDto); - return null; - -// baseMapper.updateById(nuBizSuppliersApply); - - -// QueryWrapper queryWrapper = new QueryWrapper<>(); -// queryWrapper.eq("status", "2"); -// queryWrapper.eq("iz_history", "N"); -// List list = nuBizSuppliersOrgMapper.selectList(queryWrapper); -// for (NuBizSuppliersOrg nuBizSuppliersOrg : list) { -// //todo 修改对应机构的供应商数据 -// SuppliersInfoMQDto suppliersInfoMQDto = new SuppliersInfoMQDto(); -// suppliersInfoMQDto.setSuppliersName(nuBizSuppliersApply.getSuppliersName()); -// suppliersInfoMQDto.setSuppliersNature(nuBizSuppliersApply.getSuppliersNature()); -// suppliersInfoMQDto.setSuppliersAddress(nuBizSuppliersApply.getSuppliersAddress()); -// suppliersInfoMQDto.setPersonInCharge(nuBizSuppliersApply.getPersonInCharge()); -// suppliersInfoMQDto.setContactNumber(nuBizSuppliersApply.getContactNumber()); -// suppliersInfoMQDto.setSupplyState(nuBizSuppliersApply.getSupplyState()); -// suppliersInfoMQDto.setOpeningBank(nuBizSuppliersApply.getOpeningBank()); -// suppliersInfoMQDto.setOpeningBankNo(nuBizSuppliersApply.getOpeningBankNo()); -// suppliersInfoMQDto.setImgPath(nuBizSuppliersApply.getImgPath()); -//// suppliersInfoMQDto.setApplyStatus("1"); -// suppliersInfoMQDto.setSysOrgCode(nuBizSuppliersOrg.getOrgCode()); -// suppliersInfoMQDto.setSuppliersId(nuBizSuppliersApply.getId()); -// rabbitMQUtil.sendToExchange("nu.suppliers.editSuppliersApply", nuBizSuppliersOrg.getOrgCode() + ".suppliers.editSuppliersApply", suppliersInfoMQDto); -// } -// -// -// BeanUtils.copyProperties(nuBizSuppliersApply, suppliersApplyEntity); -// return suppliersApplyEntity; - } @Override - public SuppliersApplyEntity getSupInfoByOpenId(String openId, String orgCode,String id) { + public SuppliersApplyEntity getSupInfoByOpenId(String openId,String id) { QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("open_id", openId); queryWrapper.orderByDesc("create_time"); + if(StringUtils.isNotBlank(id) && !StringUtils.equals("null",id)){ + queryWrapper.eq("suppliers_id",id); + } List list = baseMapper.selectList(queryWrapper); if (list.size() > 0) { SuppliersApplyEntity suppliersApplyEntity = new SuppliersApplyEntity(); BeanUtils.copyProperties(list.get(0), suppliersApplyEntity); - QueryWrapper qw = new QueryWrapper<>(); - qw.eq("suppliers_id", list.get(0).getId()); - qw.eq("iz_history", "N"); -// qw.eq("org_code", orgCode); - List soList = suppliersOrgService.list(qw); System.out.println("id-------------------------------------------------------"+id); - if(StringUtils.isNotEmpty(id) && !StringUtils.equals("undefined",id)){ - NuBizSuppliersOrg NuBizSuppliersOrgA = suppliersOrgService.getById(id); - suppliersApplyEntity = new SuppliersApplyEntity(); - suppliersApplyEntity.setSuppliersName(NuBizSuppliersOrgA.getSuppliersName()); - suppliersApplyEntity.setSuppliersNature(NuBizSuppliersOrgA.getSuppliersNature()); - suppliersApplyEntity.setSuppliersAddress(NuBizSuppliersOrgA.getSuppliersAddress()); - suppliersApplyEntity.setPersonInCharge(NuBizSuppliersOrgA.getPersonInCharge()); - suppliersApplyEntity.setContactNumber(NuBizSuppliersOrgA.getContactNumber()); - suppliersApplyEntity.setOpeningBank(NuBizSuppliersOrgA.getOpeningBank()); - suppliersApplyEntity.setOpeningBankNo(NuBizSuppliersOrgA.getOpeningBankNo()); - suppliersApplyEntity.setImgPath(NuBizSuppliersOrgA.getImgPath()); - suppliersApplyEntity.setSuppliersStatus(NuBizSuppliersOrgA.getStatus()); - suppliersApplyEntity.setAuditContent(NuBizSuppliersOrgA.getAuditContent()); - if("4".equals(NuBizSuppliersOrgA.getStatus())){ - suppliersApplyEntity.setIzModify(true); - } - }else if (!CollectionUtils.isEmpty(soList)) { - for (int i = 0; i < soList.size(); i++) { - NuBizSuppliersOrg so = soList.get(i); - if (so.getOrgCode().equals(orgCode)) { - suppliersApplyEntity.setSuppliersStatus(so.getStatus()); - suppliersApplyEntity.setAuditContent(so.getAuditContent()); - suppliersApplyEntity.setOrgCode(orgCode); - } - if("4".equals(so.getStatus())){ - suppliersApplyEntity.setIzModify(true); - } - } - } return suppliersApplyEntity; } @@ -303,6 +241,7 @@ public class NuBizSuppliersApplyServiceImpl extends ServiceImpl nuBizSuppliersApplies = baseMapper.selectList(queryWrapper); @@ -313,4 +252,318 @@ public class NuBizSuppliersApplyServiceImpl extends ServiceImpl queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("open_id", openId); + queryWrapper.eq("iz_history", "N"); + queryWrapper.orderByDesc("create_time"); + queryWrapper.last("limit 1"); + NuBizSuppliersApply nuBizSuppliersApply = baseMapper.selectOne(queryWrapper); + if (nuBizSuppliersApply == null) { + return null; + } + SuppliersApplyEntity suppliersApplyEntity = new SuppliersApplyEntity(); + BeanUtils.copyProperties(nuBizSuppliersApply, suppliersApplyEntity); + return suppliersApplyEntity; + } + + @Override + public IPage listPage(Page page, QueryWrapper queryWrapper) { + return baseMapper.listPage(page, queryWrapper); + } + + @Override + public String audit(NuBizSuppliersApply nuBizSuppliersApply) { + //变更后数据 + NuBizSuppliersApply one = baseMapper.selectById(nuBizSuppliersApply.getId()); + + //变更审核通过 + NuBizSuppliersApply apply = new NuBizSuppliersApply(); + apply.setId(nuBizSuppliersApply.getId()); + if ("modifyPass".equals(nuBizSuppliersApply.getStatus())) { + //修改apply状态 + apply.setApplyStatus("2"); + + //修改info表 + NuBizSuppliersInfo info = new NuBizSuppliersInfo(); + info.setId(one.getSuppliersId()); + info.setSuppliersName(one.getSuppliersName());//供应商名称 + info.setSuppliersNature(one.getSuppliersNature());//供应商性质 + info.setSuppliersAddress(one.getSuppliersAddress());//供应商地址 + info.setPersonInCharge(one.getPersonInCharge());//负责人 + info.setContactNumber(one.getContactNumber());//联系电话 + info.setOpeningBank(one.getOpeningBank());//开户行 + info.setOpeningBankNo(one.getOpeningBankNo());//开户行账号 + info.setImgPath(one.getImgPath());//资质照片 + nuBizSuppliersInfoMapper.insert(info); + apply.setSuppliersId(info.getId()); + } + //变更审核未通过 + if ("modifyFail".equals(nuBizSuppliersApply.getStatus())) { + //修改apply本身状态即可 + apply.setApplyStatus("3"); + apply.setApplyContent(nuBizSuppliersApply.getApplyContent()); + } + baseMapper.updateById(apply); + + + String content1 = ""; + String content2 = ""; + //审核通过 + if (StringUtils.equals("modifyPass", nuBizSuppliersApply.getStatus())) { + content1 = "您好,您提交的供应商入驻申请已通过审核,欢迎加入护理单元大家庭,期待携手同行!"; + content2 = "审核通过"; + } else if (StringUtils.equals("modifyFail", nuBizSuppliersApply.getStatus())) { + content1 = "您好,您提交的供应商入驻申请审核暂未通过,期待您的再次申请。"; + content2 = "审核驳回"; + } + NuWxNoticeEntity nuWxNotice = new NuWxNoticeEntity(); + nuWxNotice.setOpenId(one.getOpenId()); + nuWxNotice.setIzRead("N"); + nuWxNotice.setTitle("入驻机构审批"); + nuWxNotice.setContent(content1); + nuWxNotice.setType("suppliers_status"); + Map extend = Maps.newHashMap(); + extend.put("suppliersId", nuBizSuppliersApply.getSuppliersId()); + nuWxNotice.setExtend(JSONObject.toJSONString(extend)); + nuWxNotice.setClientType(WxClientType.SUPPLIERS.getCode()); + wxNoticeApi.addNotice(nuWxNotice); + WxNoticeEntity wxNotice = new WxNoticeEntity(); + wxNotice.setPageRoute("pages/supplierindex/index"); + wxNotice.setThing2("供应商入驻审核"); + wxNotice.setPhrase1(content2); + wxNotice.setLogMainInfo("供应商入驻审核"); + wxNoticeApi.sendWechartMessage_SHENHE(wxNotice, nuWxNotice); + + return one.getSysOrgCode(); + } + + @Override + public List> getModifyHistoryInfo(NuBizSuppliersApply suppliersApply) { + // 1. 查询变更后数据 + NuBizSuppliersApply modifyData = baseMapper.selectById(suppliersApply.getId()); + + // 2. 查询当前使用中数据 + QueryWrapper usingQW = new QueryWrapper<>(); + usingQW.eq("suppliers_id", modifyData.getSuppliersId()); + usingQW.eq("apply_status", "2"); + usingQW.lt("create_time", modifyData.getCreateTime()); + usingQW.last("limit 1"); + NuBizSuppliersApply usingData = baseMapper.selectOne(usingQW); + if(usingData == null || usingData.getId() == null){ + usingData = modifyData; + } + + // 3. 准备结果列表 + List> result = new ArrayList<>(); + + // 4. 获取 ConfigSuppliersInfo 所有字段(用于遍历) + Field[] infoFields = NuBizSuppliersApply.class.getDeclaredFields(); + + // 5. 遍历每个字段,从两个对象中分别取值比较 + for (Field usingField : infoFields) { + try { + String fieldName = usingField.getName(); + + // 跳过序列化ID 和 @TableField(exist = false) 的字段 + if ("serialVersionUID".equals(fieldName)) { + continue; + } + TableField tableField = usingField.getAnnotation(TableField.class); + if (tableField != null && !tableField.exist()) { + continue; + } + + // 设置可访问 + usingField.setAccessible(true); + + // 获取 ElderInfo 中对应的字段(必须同名) + Field modifyField = null; + try { + modifyField = NuBizSuppliersApply.class.getDeclaredField(fieldName); + modifyField.setAccessible(true); + } catch (NoSuchFieldException e) { + // 如果员工信息表中没有这个字段,跳过 + continue; + } + + // 获取两个对象中该字段的值 + Object modifyValue = modifyField.get(modifyData); + Object usingValue = usingField.get(usingData); + + // 处理日期类型 + if (usingField.getType() == Date.class) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + modifyValue = modifyValue != null ? sdf.format((Date) modifyValue) : null; + usingValue = usingValue != null ? sdf.format((Date) usingValue) : null; + } + + if(StringUtils.equals(fieldName,"suppliersNature")){ + usingValue = usingValue != null ? dictUtils.translateDictValue("suppliers_nature", usingValue.toString()) : null; + modifyValue = modifyValue != null ? dictUtils.translateDictValue("suppliers_nature", modifyValue.toString()) : null; + } + // 创建结果项 + Map fieldMap = new HashMap<>(); + fieldMap.put("id", IdUtil.simpleUUID()); + fieldMap.put("d1", fieldName); // 字段名 + fieldMap.put("d2", usingValue); // 原始值 + fieldMap.put("d3", modifyValue); // 修改值 + fieldMap.put("d4", Objects.equals(usingValue, modifyValue) ? "相同" : "不同"); // 比较结果 + + result.add(fieldMap); + + } catch (IllegalAccessException e) { + // 忽略访问失败或字段不存在的情况 + continue; + } + } + + return result; + } + + @Override + public List> getModifyInfo(NuBizSuppliersApply suppliersApply) { + // 1. 查询变更后数据 + NuBizSuppliersApply modifyData = baseMapper.selectById(suppliersApply.getId()); + + // 2. 查询当前使用中数据 + QueryWrapper usingQW = new QueryWrapper<>(); + usingQW.eq("id", modifyData.getSuppliersId()); + NuBizSuppliersInfo usingData = nuBizSuppliersInfoMapper.selectOne(usingQW); + + // 3. 准备结果列表 + List> result = new ArrayList<>(); + + // 4. 获取 ConfigSuppliersInfo 所有字段(用于遍历) + Field[] infoFields = NuBizSuppliersInfo.class.getDeclaredFields(); + + // 5. 遍历每个字段,从两个对象中分别取值比较 + for (Field usingField : infoFields) { + try { + String fieldName = usingField.getName(); + + // 跳过序列化ID 和 @TableField(exist = false) 的字段 + if ("serialVersionUID".equals(fieldName)) { + continue; + } + TableField tableField = usingField.getAnnotation(TableField.class); + if (tableField != null && !tableField.exist()) { + continue; + } + + // 设置可访问 + usingField.setAccessible(true); + + // 获取 ElderInfo 中对应的字段(必须同名) + Field modifyField = null; + try { + modifyField = NuBizSuppliersApply.class.getDeclaredField(fieldName); + modifyField.setAccessible(true); + } catch (NoSuchFieldException e) { + // 如果员工信息表中没有这个字段,跳过 + continue; + } + + // 获取两个对象中该字段的值 + Object modifyValue = modifyField.get(modifyData); + Object usingValue = usingField.get(usingData); + + // 处理日期类型 + if (usingField.getType() == Date.class) { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + modifyValue = modifyValue != null ? sdf.format((Date) modifyValue) : null; + usingValue = usingValue != null ? sdf.format((Date) usingValue) : null; + } + + if(StringUtils.equals(fieldName,"suppliersNature")){ + usingValue = usingValue != null ? dictUtils.translateDictValue("suppliers_nature", usingValue.toString()) : null; + modifyValue = modifyValue != null ? dictUtils.translateDictValue("suppliers_nature", modifyValue.toString()) : null; + } + // 创建结果项 + Map fieldMap = new HashMap<>(); + fieldMap.put("id", IdUtil.simpleUUID()); + fieldMap.put("d1", fieldName); // 字段名 + fieldMap.put("d2", usingValue); // 原始值 + fieldMap.put("d3", modifyValue); // 修改值 + fieldMap.put("d4", Objects.equals(usingValue, modifyValue) ? "相同" : "不同"); // 比较结果 + + result.add(fieldMap); + + } catch (IllegalAccessException e) { + // 忽略访问失败或字段不存在的情况 + continue; + } + } + + return result; + } + + @Override + public String bgAudit(NuBizSuppliersApply nuBizSuppliersApply) { + //变更后数据 + NuBizSuppliersApply one = baseMapper.selectById(nuBizSuppliersApply.getId()); + + //变更审核通过 + NuBizSuppliersApply apply = new NuBizSuppliersApply(); + apply.setId(nuBizSuppliersApply.getId()); + if ("modifyPass".equals(nuBizSuppliersApply.getStatus())) { + //修改apply状态 + apply.setApplyStatus("2"); + + //修改info表 + NuBizSuppliersInfo info = new NuBizSuppliersInfo(); + info.setId(one.getSuppliersId()); + info.setSuppliersName(one.getSuppliersName());//供应商名称 + info.setSuppliersNature(one.getSuppliersNature());//供应商性质 + info.setSuppliersAddress(one.getSuppliersAddress());//供应商地址 + info.setPersonInCharge(one.getPersonInCharge());//负责人 + info.setContactNumber(one.getContactNumber());//联系电话 + info.setOpeningBank(one.getOpeningBank());//开户行 + info.setOpeningBankNo(one.getOpeningBankNo());//开户行账号 + info.setImgPath(one.getImgPath());//资质照片 + nuBizSuppliersInfoMapper.updateById(info); + } + //变更审核未通过 + if ("modifyFail".equals(nuBizSuppliersApply.getStatus())) { + //修改apply本身状态即可 + apply.setApplyStatus("5"); + apply.setApplyContent(nuBizSuppliersApply.getApplyContent()); + } + baseMapper.updateById(apply); + + String content1 = ""; + String content2 = ""; +// QueryWrapper queryWrapper = new QueryWrapper<>(); +// queryWrapper.eq("org_code", nuBizSuppliersOrg.getOrgCode()); +// SysDepart dto = sysDepartService.getOne(queryWrapper); + //审核通过 + if (StringUtils.equals("modifyPass", nuBizSuppliersApply.getStatus())) { + content1 = "您好,您提交的信息变更已通过"; + content2 = "审核通过"; + } else if (StringUtils.equals("modifyFail", nuBizSuppliersApply.getStatus())) { + content1 = "您好,您提交的信息变更未通过,驳回原因:"+nuBizSuppliersApply.getApplyContent(); + content2 = "审核未通过"; + } + NuWxNoticeEntity nuWxNotice = new NuWxNoticeEntity(); + nuWxNotice.setOpenId(one.getOpenId()); + nuWxNotice.setIzRead("N"); + nuWxNotice.setTitle("供应商信息变更审核"); + nuWxNotice.setContent(content1); + nuWxNotice.setType("suppliers_ausit_status"); + Map extend = Maps.newHashMap(); + extend.put("suppliersId", nuBizSuppliersApply.getSuppliersId()); + nuWxNotice.setExtend(JSONObject.toJSONString(extend)); + nuWxNotice.setClientType(WxClientType.SUPPLIERS.getCode()); + wxNoticeApi.addNotice(nuWxNotice); + WxNoticeEntity wxNotice = new WxNoticeEntity(); + wxNotice.setPageRoute("pages/supplierindex/index"); + wxNotice.setThing2("供应商变更审核"); + wxNotice.setPhrase1(content2); + wxNotice.setLogMainInfo("供应商变更审核"); + wxNoticeApi.sendWechartMessage_SHENHE(wxNotice, nuWxNotice); + + + return one.getSysOrgCode(); + } } diff --git a/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/service/impl/NuBizSuppliersInfoServiceImpl.java b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/service/impl/NuBizSuppliersInfoServiceImpl.java new file mode 100644 index 0000000..a980b97 --- /dev/null +++ b/nursing-unit-admin/nu-admin-biz/src/main/java/com/nu/modules/bizSuppliers/service/impl/NuBizSuppliersInfoServiceImpl.java @@ -0,0 +1,19 @@ +package com.nu.modules.bizSuppliers.service.impl; + +import com.nu.modules.bizSuppliers.entity.NuBizSuppliersInfo; +import com.nu.modules.bizSuppliers.mapper.NuBizSuppliersInfoMapper; +import com.nu.modules.bizSuppliers.service.INuBizSuppliersInfoService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 供应商信息 + * @Author: jeecg-boot + * @Date: 2026-02-26 + * @Version: V1.0 + */ +@Service +public class NuBizSuppliersInfoServiceImpl extends ServiceImpl implements INuBizSuppliersInfoService { + +} diff --git a/nursing-unit-api/src/main/java/com/nu/modules/wechat/suppliers/SuppliersApi.java b/nursing-unit-api/src/main/java/com/nu/modules/wechat/suppliers/SuppliersApi.java index 51bb355..8bb74c0 100644 --- a/nursing-unit-api/src/main/java/com/nu/modules/wechat/suppliers/SuppliersApi.java +++ b/nursing-unit-api/src/main/java/com/nu/modules/wechat/suppliers/SuppliersApi.java @@ -14,6 +14,7 @@ import org.jeecg.common.api.vo.Result; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import java.util.Date; import java.util.List; import java.util.Map; @@ -33,6 +34,10 @@ public class SuppliersApi { */ @PostMapping(value = "/addSuppliers") public Result addSuppliers(@RequestBody SuppliersApplyEntity suppliersApplyEntity) { + suppliersApplyEntity.setId(null); + suppliersApplyEntity.setApplyContent(null); + suppliersApplyEntity.setCreateBy(null); + suppliersApplyEntity.setCreateTime(new Date()); if (suppliersApi.nameDuplicateChecked(suppliersApplyEntity)) { return Result.error("供应商名称重复"); } @@ -81,20 +86,7 @@ public class SuppliersApi { return Result.OK(result); } - /** - * 供应商入驻机构 - * - * @param suppliersOrgEntity - * @return - */ - @PostMapping(value = "/applySupOrg") - public Result applySupOrg(@RequestBody SuppliersOrgEntity suppliersOrgEntity) { - if(StringUtils.isEmpty(suppliersOrgEntity.getOrgCode())){ - return Result.error("请选择入驻机构"); - } - suppliersApi.applySupOrg(suppliersOrgEntity); - return Result.OK(suppliersOrgEntity); - } + /** @@ -130,8 +122,8 @@ public class SuppliersApi { */ @GetMapping(value = "/getSupInfoByOpenId") public Result getSupInfoByOpenId( - @RequestParam(value = "openId") String openId, @RequestParam(value = "orgCode") String orgCode, @RequestParam(value = "id",required = false) String id) { - SuppliersApplyEntity result = suppliersApi.getSupInfoByOpenId(openId, orgCode,id); + @RequestParam(value = "openId") String openId, @RequestParam(value = "id",required = false) String id) { + SuppliersApplyEntity result = suppliersApi.getSupInfoByOpenId(openId,id); return Result.OK(result); } @@ -145,4 +137,11 @@ public class SuppliersApi { return Result.OK(result); } + + @GetMapping(value = "/getSuppliersApplyInfo") + public Result getSuppliersApplyInfo(@RequestParam(value = "openId") String openId) { + SuppliersApplyEntity result = suppliersApi.getSuppliersApplyInfo(openId); + return Result.OK(result); + } + } diff --git a/nursing-unit-common/src/main/java/com/nu/entity/SuppliersApplyEntity.java b/nursing-unit-common/src/main/java/com/nu/entity/SuppliersApplyEntity.java index a8dc6f6..4df729d 100644 --- a/nursing-unit-common/src/main/java/com/nu/entity/SuppliersApplyEntity.java +++ b/nursing-unit-common/src/main/java/com/nu/entity/SuppliersApplyEntity.java @@ -75,4 +75,7 @@ public class SuppliersApplyEntity implements Serializable { private String orgCode; public Boolean izModify; + private String applyContent; + private String applyStatus; + private String suppliersId; }