海报模块代码移植、资讯分类代码移植

This commit is contained in:
纪寒 2023-09-20 17:07:11 +08:00
parent 3aefe96234
commit 7133550f7e
23 changed files with 3352 additions and 57 deletions

View File

@ -5,7 +5,7 @@ import io.jsonwebtoken.Claims;
/** /**
* 通用常量信息 * 通用常量信息
* *
* @author xinelu * @author xinyilu
*/ */
public class Constants { public class Constants {
/** /**
@ -108,6 +108,16 @@ public class Constants {
*/ */
public static final String RESOURCE_PREFIX = "/profile"; public static final String RESOURCE_PREFIX = "/profile";
/**
* 数据库路径 前缀
*/
public static final String D_RESOURCE_PREFIX = "/profile";
/**
* 查找本地文件 前缀
*/
public static final String D_UPLOAD_PREFIX = "D:/xinyilu/uploadPath";
/** /**
* RMI 远程方法调用 * RMI 远程方法调用
*/ */
@ -126,54 +136,89 @@ public class Constants {
/** /**
* 定时任务白名单配置仅允许访问的包名如其他需要可以自行添加 * 定时任务白名单配置仅允许访问的包名如其他需要可以自行添加
*/ */
public static final String[] JOB_WHITELIST_STR = {"com.xinelu"}; public static final String[] JOB_WHITELIST_STR = {"com.xinyilu"};
/** /**
* 定时任务违规的字符 * 定时任务违规的字符
*/ */
public static final String[] JOB_ERROR_STR = {"java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", public static final String[] JOB_ERROR_STR = {"java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml",
"org.springframework", "org.apache", "com.xinelu.common.utils.file"}; "org.springframework", "org.apache", "com.xinyilu.common.utils.file"};
/**
* Excel文件格式后缀
*/
public static final String XLSX = "xlsx";
/**
* Excel文件格式后缀
*/
public static final String XLS = "xls";
/**
* 护理站模板信息下载
*/
public static final String NURSE_STATION = "nurseStation";
/**
* 护理站人员模板信息下载
*/
public static final String NURSE_STATION_PERSON = "nurseStationPerson";
/**
* 字符串空格标识
*/
public static final String EMPTY = " ";
/**
* 图片上传文件带.
*/
public static final String FILE_NAME_SPOT = ".";
/** /**
* 护理编码前缀 * 护理编码前缀
*/ */
public static final String PATIENT_PREFIX = "HL"; public static final String PATIENT_PREFIX = "HL";
/**
* 预约订单编号前缀
*/
public static final String RESERVATION_ORDER_PREFIX = "RO";
/**
* 区域编码
*/
public static final String COMMUNITY_CODE = "CI";
/**
* 疾病信息字典编码
*/
public static final String DISEASE_INFO = "DI";
/**
* 护理类型编码前缀
*/
public static final String NURSE_ITEM_CODE = "XM";
/** /**
* 护理站标签编码前缀 * 护理站标签编码前缀
*/ */
public static final String LABEL_CODE = "BQ"; public static final String LABEL_CODE = "BQ";
/**
* 护理站人员编码前缀
*/
public static final String NURSE_PERSON_CODE = "RY";
/**
* 科室编码
*/
public static final String NURSE_STATION_DEPARTMENT = "D";
/**
* 科室编码前缀
*/
public static final String NURSE_STATION_DEPARTMENT_PREFIX = "NSD_";
/**
* 护理站耗材信息
*/
public static final String STATION_CONSUMABLE = "HC";
/**
* 护理项目信息
*/
public static final String STATION_ITEM = "XM";
/**
* 护理站项目基本信息导入模板
*/
public static final String NURSE_STATION_ITEM_TEMPLATE = "1";
/**
* 护理耗材基本信息导入模板
*/
public static final String NURSE_STATION_CONSUMABLE = "2";
/**
* 微信小程序ACCESS_TOKEN前缀
*/
public static final String NURSE_STATION_APPLET_ACCESS_TOKEN = "NURSE_STATION_APPLET_ACCESS_TOKEN";
/**
* 护理员微信小程序ACCESS_TOKEN前缀
*/
public static final String NURSE_STATION_PERSON_APPLET_ACCESS_TOKEN = "NURSE_STATION_PERSON_APPLET_ACCESS_TOKEN_";
/** /**
* 护理站图片路径上传 * 护理站图片路径上传
*/ */
@ -182,7 +227,7 @@ public class Constants {
/** /**
* 护理站简介附近图片路径上传 * 护理站简介附近图片路径上传
*/ */
public static final String NURSE_STATION_INTRODUCE_TYPE = "stationIntroducePictureUrl"; public static final String NURSE_STATION_INTRODUCE_TYPE = "stationIntroducePcitureUrl";
/** /**
* 护理站项目图片路径上传 * 护理站项目图片路径上传
@ -204,10 +249,216 @@ public class Constants {
*/ */
public static final String GOODS_CATEGORY_PICTURE = "goodsCategoryPicture"; public static final String GOODS_CATEGORY_PICTURE = "goodsCategoryPicture";
/**
* 任务完成上传图片
*/
public static final String APPOINTMENT_ORDER_DETAILS_URL = "appointmentOrderDetailsUrl";
/** /**
* 商品属性图片地址 * 商品属性图片地址
*/ */
public static final String ATTRIBUTE_PICTURE_URL = "attributePictureUrl"; public static final String ATTRIBUTE_PICTURE_URL = "attributePitureUrl";
/**
* 护理站模板信息下载
*/
public static final String NURSE_STATION = "nurseStation";
/**
* 护理站人员模板信息下载
*/
public static final String NURSE_STATION_PERSON = "nurseStationPerson";
/**
* 护理类型编码前缀
*/
public static final String NURSE_TYPE_CODE = "LX";
/**
* 商品编码前缀
*/
public static final String GOODS_CODE = "GC";
/**
* 商品分类编码前缀
*/
public static final String GOODS_CATEGORY_CODE = "GF";
/**
* 商品分类编码前缀
*/
public static final String ATTRIBUTE_CODE = "AT";
/**
* 护理项目redis键值前缀
*/
public static final String NURSE_STATION_ITEM_KEY = "NURSE_STATION_ITEM_KEY";
/**
* 护理站产品redis键值前缀
*/
public static final String NURSE_STATION_PRODUCT_KEY = "NURSE_STATION_PRODUCT_KEY";
/**
* 微信小程序支付prepay_id前缀
*/
public static final String PREPAY_ID_KEY = "PREPAY_ID_KEY_";
/**
* 微信支付回调通知订单锁前缀
*/
public static final String WE_CHAT_NOTIFY_KEY = "WE_CHAT_NOTIFY_KEY_";
/**
* 修改预约服务订单状态Redis键
*/
public static final String UPDATE_APPOINTMENT_ORDER_STATUS_KEY = "UPDATE_APPOINTMENT_ORDER_STATUS_KEY_";
/**
* 修改商品订单状态Redis键
*/
public static final String UPDATE_GOODS_ORDER_STATUS_KEY = "UPDATE_GOODS_ORDER_STATUS_KEY_";
/**
* 新增库存数量Redis键
*/
public static final String ADD_GOODS_STOCK_KEY = "ADD_GOODS_STOCK_KEY_";
/**
* 减少库存数量Redis键
*/
public static final String REDUCE_GOODS_STOCK_KEY = "REDUCE_GOODS_STOCK_KEY_";
/**
* 微信支付回调标识
*/
public static final String PAY_NOTIFY = "PAY";
/**
* 微信退款回调标识
*/
public static final String REFUND_NOTIFY = "REFUND";
/**
* 微信退款回调通知订单锁前缀
*/
public static final String WE_CHAT_REFUND_KEY = "WE_CHAT_REFUND_KEY_";
/**
* 商城购买商品减少库存数量Redis键
*/
public static final String BUY_GOODS_REDUCE_STOCK_KEY = "BUY_GOODS_REDUCE_STOCK_KEY_";
/**
* 手机App支付prepay_id前缀
*/
public static final String APP_PREPAY_ID_KEY = "APP_PREPAY_ID_KEY_";
/**
* Excel文件格式后缀
*/
public static final String XLSX = "xlsx";
/**
* Excel文件格式后缀
*/
public static final String XLS = "xls";
/**
* 男性
*/
public static final String MALE = "MALE";
/**
* 女性
*/
public static final String FEMALE = "FEMALE";
/**
* 店铺Redis键
*/
public static final String STORE_KEY = "SHOP";
/**
* 默认密码
*/
public static final String PASS_WORD = "123456";
/**
* sys_user表 : 男性
*/
public static final String SYS_USER_MALE = "0";
/**
* sys_user表 : 女性
*/
public static final String SYS_USER_FEMALE = "1";
/**
* 护理员App文件格式后缀
*/
public static final String APK = "apk";
/**
* 护理员App文件格式名称
*/
public static final String APK_NAME = "泉医到家护理员App.apk";
/**
* 护理站角色键值标识
*/
public static final String STATION_ROLE = "stationRole";
/**
* 运营角色键值标识
*/
public static final String OPERATE_ROLE = "operateRole";
/**
* 图片上传文件带.
*/
public static final String FILE_NAME_SPOT = ".";
/**
* 移动端令牌Redis键前缀
*/
public static final String MOBILE_AUTHORIZATION_KEY = "MOBILE_AUTHORIZATION_KEY_";
/**
* 移动端令牌前缀
*/
public static final String MOBILE_AUTHORIZATION_PREFIX = "MOBILE_AUTHORIZATION_PREFIX";
/**
* 护理项目分类编码前缀
*/
public static final String CLASSIFY_ITEM = "HLT";
/**
* 学习培训项目信息编码前缀
*/
public static final String TRAINING_ITEM = "TI";
/**
* 学习培训分类编码前缀
*/
public static final String TRAINING_CATEGORY = "TC";
/**
* 学习培训分类编码前缀
*/
public static final String TRAINING_ITEM_DIRECTORY = "TID";
/**
* 护理机构分类编码前缀
*/
public static final String NURSE_AGENCY = "NA";
/**
* 海报编号编码前缀
*/
public static final String POSER_CODE = "POS";
/** /**
* 护理项目分类图标存放地址 * 护理项目分类图标存放地址
@ -227,44 +478,163 @@ public class Constants {
* 资讯主缩略图地址 * 资讯主缩略图地址
*/ */
public static final String LEAD_THUMBNAIL_URL = "leadThumbnailUrl"; public static final String LEAD_THUMBNAIL_URL = "leadThumbnailUrl";
/** /**
* 护理人员证书地址 * 海报视频存放路径
*/ */
public static final String PERSON_CERTIFICATE_URL = "personCertificateUrl"; public static final String POSTER_VIDEO_URL = "posterVideoUrl";
/**
* 健康咨询科室人员头像地址
*/
public static final String PERSON_PICTURE_URL = "personPictureUrl";
/**
* 健康咨询-科室人员资质证书证书编号前缀
*/
public static final String CERTIFICATE_URL = "certificateUrl";
/**
* 客服图片路径上传
*/
public static final String GROUP_QR_CODE_URL = "groupQrCodeUrl";
/** /**
* 科室编码前缀 * 科室编码前缀
*/ */
public static final String DEPARTMENT_CODE = "HDC"; public static final String DEPARTMENT_CODE = "HDC";
/**
* 健康咨询-科室人员资质证书证书编号前缀
*/
public static final String CERTIFICATE_CODE = "CE";
/** /**
* 医院编码前缀 * 医院编码前缀
*/ */
public static final String HOSPITAL_CODE = "HS"; public static final String HOSPITAL_CODE = "HS";
/**
* 资讯分类编码前缀
*/
public static final String INFORMATION_CATEGORY_CODE = "ICC";
/**
* 资讯编码前缀
*/
public static final String INFORMATION_CODE = "IC";
/**
* 优惠券编码前缀
*/
public static final String COUPON_CODE = "CC";
/** /**
* 科室人员编码前缀 * 科室人员编码前缀
*/ */
public static final String PERSON_CODE = "PC"; public static final String PERSON_CODE = "PC";
/**
* 预约时间点领取上限的Redis键
*/
public static final String PRE_APPOINTMENT_LIMIT_COUNT_KEY = "PRE_APPOINTMENT_LIMIT_COUNT_";
/**
* 在线客服群编号前缀
*/
public static final String GROUP_CODE = "GRO";
/**
* 泉医到家平台系统业务设置系统设置编码前缀
*/
public static final String SETTINGS_CODE = "SET";
/**
* 客服图片路径上传
*/
public static final String GROUP_QR_CODE_URL = "groupQrCodeUrl";
/**
* 健康咨询-科室人员资质证书证书编号前缀
*/
public static final String CERTIFICATE_CODE = "CE";
/**
* 健康咨询-科室人员资质证书证书编号前缀
*/
public static final String CERTIFICATE_URL = "certificateUrl";
/**
* 个人签到天数Redis键
*/
public static final String PERSONAL_SIGN_IN_DAY_KEY = "PERSONAL_SIGN_IN_DAY_";
/**
* 健康咨询科室人员头像地址
*/
public static final String PERSON_PICTURE_URL = "personPictureUrl";
/**
* 获取 access_token AppSecret 错误或者 access_token 无效请开发者认真比对 AppSecret 的正确性或查看是否正在为恰当的公众号调用接口
*/
public static final int INVALID_CREDENTIAL_ACCESS_TOKEN_ISINVALID_OR_NOT_LATEST = 40001;
/**
* 不合法的 OpenID 请开发者确认 OpenID 该用户是否已关注公众号或是否是其他公众号的 OpenID
*/
public static final int INVALID_OPENID = 40003;
/**
* 不合法的 access_token 请开发者认真比对 access_token 的有效性如是否过期或查看是否正在为恰当的公众号调用接口
*/
public static final int INVALID_ACCESS_TOKEN = 40014;
/**
* 不合法的 template_id
*/
public static final int INVALID_TEMPLATE_ID = 40037;
/**
* 用户拒接订阅
*/
public static final int DENY_SUBSCRIPTION = 43101;
/**
* 参数无效
*/
public static final int ARGUMENT_INVALID = 47003;
/**
* 成功
*/
public static final int SUCCESS_ERRCODE = 0;
/**
* 护理员证书资质信息表编号前缀
*/
public static final String PERSON_CERTIFICATE_CODE = "PCE";
/**
* 护理人员证书地址
*/
public static final String PERSON_CERTIFICATE_URL = "personCertificateUrl";
/**
* 护理站角色标识
*/
public static final String STATION_ROLE_NAME = "stationRole";
/**
* 护理员角色标识
*/
public static final String PERSON_ROLE_NAME = "nursePersonRole";
/**
* 无角色标识
*/
public static final String NOT_ROLE_NAME = "notRoleName";
/**
* 无角色标识
*/
public static final String STATION_AND_PERSON_ROLE_NAME = "wholeRole";
/**
* 培训项目logo图片路径标识
*/
public static final String TRAINING_ITEM_COVER_URL = "trainingItemCoverUrl";
/**
* 培训项目海报图片路径标识
*/
public static final String TRAINING_ITEM_POSTER_URL = "trainingItemPosterUrl";
/**
* 字符串空格标识
*/
public static final String EMPTY = " ";
/**
* 培训课程父级id
*/
public static final Long TRAINING_PARENT_ID = 0L;
} }

View File

@ -0,0 +1,39 @@
package com.xinelu.common.enums;
import lombok.Getter;
/**
* @Description 海报模块枚举
* @Author LJH
* @Version 1.0
*/
@Getter
public enum PoserModuleTypeEnum {
/**
* 护理机构模块
*/
NURSE_AGENCY_MODULE("NURSE_AGENCY_MODULE"),
/**
* 护理项目模块
*/
NURSE_ITEM_MODULE("NURSE_ITEM_MODULE"),
/**
* 健康咨询模块
*/
HEALTH_CONSUTION_MODULE("HEALTH_CONSUTION_MODULE"),
/**
* 首页模块
*/
HOME_PAGE_MODULE("HOME_PAGE_MODULE"),
;
final private String info;
PoserModuleTypeEnum(String info) {
this.info = info;
}
}

View File

@ -0,0 +1,95 @@
package com.xinelu.manage.controller.informationcategory;
import com.xinelu.common.annotation.Log;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.domain.informationcategory.InformationCategory;
import com.xinelu.manage.dto.informationcategory.InformationCategoryDTO;
import com.xinelu.manage.service.informationcategory.IInformationCategoryService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 资讯分类Controller
*
* @author xinyilu
* @date 2023-02-14
*/
@RestController
@RequestMapping("/system/InformationCategory")
public class InformationCategoryController extends BaseController {
@Resource
private IInformationCategoryService informationCategoryService;
/**
* 查询资讯分类列表
*/
@PreAuthorize("@ss.hasPermi('system:InformationCategory:list')")
@GetMapping("/list")
public TableDataInfo list(InformationCategory informationCategory) {
startPage();
List<InformationCategory> list = informationCategoryService.selectInformationCategoryList(informationCategory);
return getDataTable(list);
}
/**
* 导出资讯分类列表
*/
@PreAuthorize("@ss.hasPermi('system:InformationCategory:export')")
@Log(title = "资讯分类", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, InformationCategory informationCategory) {
List<InformationCategory> list = informationCategoryService.selectInformationCategoryList(informationCategory);
ExcelUtil<InformationCategory> util = new ExcelUtil<>(InformationCategory.class);
util.exportExcel(response, list, "资讯分类数据");
}
/**
* 获取资讯分类详细信息
*/
@PreAuthorize("@ss.hasPermi('system:InformationCategory:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(informationCategoryService.selectInformationCategoryById(id));
}
/**
* 新增资讯分类
*/
@PreAuthorize("@ss.hasPermi('system:InformationCategory:add')")
@Log(title = "资讯分类", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult add(@RequestBody @Validated(Insert.class) InformationCategoryDTO informationCategory) {
return informationCategoryService.insertInformationCategory(informationCategory);
}
/**
* 修改资讯分类
*/
@PreAuthorize("@ss.hasPermi('system:InformationCategory:edit')")
@Log(title = "资讯分类", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
public AjaxResult edit(@RequestBody @Validated(Update.class) InformationCategory informationCategory) {
return informationCategoryService.updateInformationCategory(informationCategory);
}
/**
* 删除资讯分类
*/
@PreAuthorize("@ss.hasPermi('system:InformationCategory:remove')")
@Log(title = "资讯分类", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(informationCategoryService.deleteInformationCategoryByIds(ids));
}
}

View File

@ -0,0 +1,149 @@
package com.xinelu.manage.controller.poserInfo;
import com.xinelu.common.annotation.Log;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.core.controller.BaseController;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.core.page.TableDataInfo;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import com.xinelu.common.enums.BusinessType;
import com.xinelu.common.utils.poi.ExcelUtil;
import com.xinelu.manage.dto.poserInfo.PoserInfoDTO;
import com.xinelu.manage.service.poserInfo.IPoserInfoService;
import com.xinelu.manage.vo.poserInfo.PoserInfoVO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Objects;
/**
* 泉医到家系统海报模块信息包含咨询简介信息Controller
*
* @author xinyilu
* @date 2023-02-10
*/
@RestController
@RequestMapping("/system/poser")
public class PoserInfoController extends BaseController {
@Resource
private IPoserInfoService poserInfoService;
/**
* 查询泉医到家系统海报模块信息包含咨询简介信息列表
*/
@PreAuthorize("@ss.hasPermi('system:poser:list')")
@GetMapping("/list")
public TableDataInfo list(PoserInfoVO poserInfo) {
startPage();
List<PoserInfoVO> list = poserInfoService.selectPoserInfoList(poserInfo);
return getDataTable(list);
}
/**
* 导出泉医到家系统海报模块信息包含咨询简介信息列表
*/
@PreAuthorize("@ss.hasPermi('system:poser:export')")
@Log(title = "泉医到家系统海报模块信息(包含咨询简介信息)", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, PoserInfoVO poserInfo) {
List<PoserInfoVO> list = poserInfoService.selectPoserInfoList(poserInfo);
ExcelUtil<PoserInfoVO> util = new ExcelUtil<>(PoserInfoVO.class);
util.exportExcel(response, list, "泉医到家系统海报模块信息(包含咨询简介信息)数据");
}
/**
* 获取泉医到家系统海报模块信息包含咨询简介信息详细信息
*/
@PreAuthorize("@ss.hasPermi('system:poser:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id) {
return AjaxResult.success(poserInfoService.selectPoserInfoById(id));
}
/**
* 新增泉医到家系统海报模块信息包含咨询简介信息
*/
@PreAuthorize("@ss.hasPermi('system:poser:add')")
@Log(title = "泉医到家系统海报模块信息(包含咨询简介信息)", businessType = BusinessType.INSERT)
@PostMapping("/add")
public AjaxResult add(@Validated(Insert.class) @RequestBody PoserInfoDTO poserInfo) {
return poserInfoService.insertPoserInfo(poserInfo);
}
/**
* 修改泉医到家系统海报模块信息包含咨询简介信息
*/
@PreAuthorize("@ss.hasPermi('system:poser:edit')")
@Log(title = "泉医到家系统海报模块信息(包含咨询简介信息)", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
public AjaxResult edit(@Validated(Update.class) @RequestBody PoserInfoDTO poserInfo) {
return poserInfoService.updatePoserInfo(poserInfo);
}
/**
* 删除泉医到家系统海报模块信息包含咨询简介信息
*/
@Log(title = "泉医到家系统海报模块信息(包含咨询简介信息)", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(poserInfoService.deletePoserInfoByIds(ids));
}
/**
* 根据moduleType 护理站id 护理项目id 删除泉医到家系统海报模块信息包含咨询简介信息
*/
@PreAuthorize("@ss.hasPermi('system:poser:remove')")
@Log(title = "泉医到家系统海报模块信息(包含咨询简介信息)", businessType = BusinessType.DELETE)
@DeleteMapping("/deletePoserInfo")
public AjaxResult removeModuleType(PoserInfoVO poserInfo) {
if (StringUtils.isBlank(poserInfo.getModuleType())) {
return AjaxResult.error("海报模块类型不能为空!");
}
return poserInfoService.deletePoserInfoByModuleType(poserInfo);
}
/**
* 海报视频上传
*/
@PostMapping("/updatePoserHeads")
public AjaxResult updatePoserHeads(@RequestParam("file") MultipartFile multipartFile, @RequestParam(value = "type") String type) throws Exception {
if (Objects.isNull(multipartFile) || StringUtils.isBlank(multipartFile.getOriginalFilename())) {
return AjaxResult.error("当前文件不存在,无法上传!");
}
if (multipartFile.getOriginalFilename().contains(Constants.EMPTY)) {
return AjaxResult.error("当前文件名含有空格,请先去除空格在上传!");
}
if (StringUtils.isBlank(type)) {
return AjaxResult.error("请选择所要上传的路径类型!");
}
return poserInfoService.updatePoserHeads(multipartFile, type);
}
/**
* 根据ModuleType获取泉医到家系统海报模块信息包含咨询简介信息详细信息
*/
@GetMapping(value = "/getModuleType")
public AjaxResult getModuleType(PoserInfoVO poserInfo) {
if (StringUtils.isBlank(poserInfo.getModuleType())) {
return AjaxResult.error("海报模块标识不能为空!");
}
return poserInfoService.selectPoserInfoByModuleType(poserInfo);
}
/**
* 从字典表中查询海报跳转链接
*/
@GetMapping(value = "/selectPosterImageJump")
public AjaxResult selectPosterImageJump(String dictType) {
return poserInfoService.selectPosterImageJump(dictType);
}
}

View File

@ -0,0 +1,103 @@
package com.xinelu.manage.domain.goodsCategory;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 商品分类信息对象 goods_category
*
* @author xinyilu
* @date 2022-10-17
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "商品分类信息对象", description = "goods_category")
public class GoodsCategory extends BaseDomain implements Serializable {
private static final long serialVersionUID = 7045958639272964488L;
/**
* 主键id
*/
@NotNull(message = "商品分类id不能为空", groups = {Update.class})
private Long id;
/**
* 父级分类id
*/
private Long parentId;
/**
* 商品分类名称
*/
@NotBlank(message = "商品分类名称不能为空", groups = {Insert.class, Update.class})
@ApiModelProperty(value = "商品分类名称")
@Excel(name = "商品分类名称")
@Length(max = 10, message = "商品分类名称不能超过10个字符", groups = {Insert.class, Update.class})
private String goodsCategoryName;
/**
* 商品分类编码
*/
@ApiModelProperty(value = "商品分类编码")
@Excel(name = "商品分类编码")
private String goodsCategoryCode;
/**
* 商品分类图片地址
*/
@ApiModelProperty(value = "商品分类图片地址")
@Excel(name = "商品分类图片地址")
private String goodsCategoryPicture;
/**
* 分类概述
*/
@ApiModelProperty(value = "分类概述")
@Excel(name = "分类概述")
private String categoryRemark;
/**
* 分类级别0代码根节点1代表一级节点依次递增
*/
private Integer categoryLevel;
/**
* 显示顺序
*/
@ApiModelProperty(value = "显示顺序")
@Excel(name = "显示顺序")
private Integer sort;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("goodsCategoryName", getGoodsCategoryName())
.append("goodsCategoryCode", getGoodsCategoryCode())
.append("goodsCategoryPicture", getGoodsCategoryPicture())
.append("categoryRemark", getCategoryRemark())
.append("sort", getSort())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,87 @@
package com.xinelu.manage.domain.informationcategory;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
/**
* 资讯分类对象 information_category
*
* @author xinyilu
* @date 2023-02-14
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "资讯分类对象", description = "information_category")
public class InformationCategory extends BaseDomain implements Serializable {
private static final long serialVersionUID = 8225087826554777164L;
/**
* 主键id
*/
@NotNull(message = "资讯分类信息不能为空", groups = {Update.class})
private Long id;
/**
* 资讯分类编码
*/
@ApiModelProperty(value = "资讯分类编码")
@Excel(name = "资讯分类编码")
private String informationCategoryCode;
/**
* 资讯分类名称
*/
@ApiModelProperty(value = "资讯分类名称")
@Excel(name = "资讯分类名称")
@NotBlank(message = "资讯分类名称不能为空", groups = {Insert.class, Update.class})
private String informationCategoryName;
/**
* 资讯分类类型健康咨询HEALTH_NOUSOTHER其他
*/
@ApiModelProperty(value = "资讯分类类型健康咨询HEALTH_NOUSOTHER其他")
@Excel(name = "资讯分类类型健康咨询HEALTH_NOUSOTHER其他")
@NotBlank(message = "资讯分类类型不能为空", groups = {Insert.class, Update.class})
private String informationCategoryType;
/**
* 资讯分类排序
*/
@ApiModelProperty(value = "资讯分类排序")
@Excel(name = "资讯分类排序")
@NotNull(message = "资讯分类排序", groups = {Insert.class, Update.class})
@Size(min = 0, max = 5, message = "资讯分类排序不能超过5个字符")
private Integer sort;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("informationCategoryCode", getInformationCategoryCode())
.append("informationCategoryName", getInformationCategoryName())
.append("informationCategoryType", getInformationCategoryType())
.append("sort", getSort())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,143 @@
package com.xinelu.manage.domain.poserInfo;
import com.xinelu.common.annotation.Excel;
import com.xinelu.common.core.domain.BaseDomain;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 泉医到家系统海报模块信息包含咨询简介信息对象 poser_info
*
* @author xinyilu
* @date 2023-02-10
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "泉医到家系统海报模块信息(包含咨询简介信息)对象", description = "poser_info")
public class PoserInfo extends BaseDomain implements Serializable {
private static final long serialVersionUID = -8094231218078395882L;
/**
* 主键id
*/
private Long id;
/**
* 护理机构id用于区分哪个护理站
*/
@ApiModelProperty(value = "护理机构id用于区分哪个护理站")
@Excel(name = "护理机构id用于区分哪个护理站")
private Long nurseStationId;
/**
* 护理项目id用于区分是哪个服务项目
*/
@ApiModelProperty(value = "护理项目id用于区分是哪个服务项目")
@Excel(name = "护理项目id用于区分是哪个服务项目")
private Long nurseItemId;
/**
* 海报名称
*/
@ApiModelProperty(value = "海报名称")
@Excel(name = "海报名称")
@NotBlank(message = "海报名称名称不能为空", groups = {Insert.class, Update.class})
private String poserName;
/**
* 海报编号系统自动生成
*/
@ApiModelProperty(value = "海报编号,系统自动生成")
@Excel(name = "海报编号,系统自动生成")
private String poserCode;
/**
* 海报简介
*/
@ApiModelProperty(value = "海报简介")
@Excel(name = "海报简介")
@NotBlank(message = "海报简介不能为空", groups = {Insert.class, Update.class})
private String posterIntroduce;
/**
* 海报图片存放路径
*/
@ApiModelProperty(value = "海报图片存放路径")
@Excel(name = "海报图片存放路径")
private String posterPictureUrl;
/**
* 海报视频存放路径
*/
@ApiModelProperty(value = "海报视频存放路径")
@Excel(name = "海报视频存放路径")
private String posterVideoUrl;
/**
* 海报模块标识护理机构模块NURSE_AGENCY_MODULE护理项目模块NURSE_ITEM_MODULE健康咨询模块HEALTH_CONSUTION_MODULE首页模块HOME_PAGE_MODULE
*/
@ApiModelProperty(value = "海报模块标识护理机构模块NURSE_AGENCY_MODULE护理项目模块NURSE_ITEM_MODULE健康咨询模块HEALTH_CONSUTION_MODULE首页模块HOME_PAGE_MODULE")
@Excel(name = "海报模块标识护理机构模块NURSE_AGENCY_MODULE护理项目模块NURSE_ITEM_MODULE健康咨询模块HEALTH_CONSUTION_MODULE首页模块HOME_PAGE_MODULE")
private String moduleType;
/**
* 海报显示顺序
*/
@ApiModelProperty(value = "海报显示顺序")
@Excel(name = "海报显示顺序")
private Integer poserSort;
/**
* 海报图片跳转链接
*/
@ApiModelProperty(value = "海报图片跳转链接")
@Excel(name = "海报图片跳转链接")
private String jumpLink;
/**
* 海报图片跳转标识新人福利NEW_PEOPLE_WELFARE首页HOME_PAGE商城SHOPPING
*/
@ApiModelProperty(value = "海报图片跳转标识新人福利NEW_PEOPLE_WELFARE首页HOME_PAGE商城SHOPPING")
@Excel(name = "海报图片跳转标识新人福利NEW_PEOPLE_WELFARE首页HOME_PAGE商城SHOPPING")
private String jumpType;
/**
* 图片跳转类型字典表id
*/
private Long jumpDictId;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("nurseStationId", getNurseStationId())
.append("nurseItemId", getNurseItemId())
.append("poserName", getPoserName())
.append("poserCode", getPoserCode())
.append("posterIntroduce", getPosterIntroduce())
.append("posterPictureUrl", getPosterPictureUrl())
.append("posterVideoUrl", getPosterVideoUrl())
.append("moduleType", getModuleType())
.append("poserSort", getPoserSort())
.append("jumpLink", getJumpLink())
.append("jumpType", getJumpType())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.toString();
}
}

View File

@ -0,0 +1,23 @@
package com.xinelu.manage.dto.informationcategory;
import com.xinelu.manage.domain.informationcategory.InformationCategory;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 资讯分类对象 DTO
*
* @author zh
* @date 2023-02-14
*/
@Data
public class InformationCategoryDTO implements Serializable {
private static final long serialVersionUID = 3462994824479143975L;
/**
* 资讯分类对象传入集合
*/
private List<InformationCategory> informationCategoryList;
}

View File

@ -0,0 +1,68 @@
package com.xinelu.manage.dto.poserInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.manage.domain.poserInfo.PoserInfo;
import com.xinelu.manage.vo.poserInfo.PosterPictureUrlVO;
import com.xinelu.manage.vo.poserInfo.PosterVideoUrlVO;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.Valid;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author ljh
* @version 1.0
* Create by 2023/2/13 10:25
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class PoserInfoDTO extends PoserInfo implements Serializable {
private static final long serialVersionUID = 4525244334532050701L;
/**
* 创建者
*/
private String createBy;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
/**
* 更新者
*/
private String updateBy;
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
/**
* 图片集合
*/
@Valid
private List<PosterPictureUrlVO> posterPictureUrlLists;
/**
* 视频集合
*/
private List<PosterVideoUrlVO> posterVideoUrlLists;
/**
* 护理站名称
*/
private String nurseStationName;
/**
* 护理项目名称
*/
private String nurseItemName;
}

View File

@ -0,0 +1,96 @@
package com.xinelu.manage.mapper.goodsCategory;
import com.xinelu.manage.domain.goodsCategory.GoodsCategory;
import com.xinelu.manage.vo.goodsCategory.ParentCategory;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 商品分类信息Mapper接口
*
* @author xinyilu
* @date 2022-10-17
*/
public interface GoodsCategoryMapper {
/**
* 查询商品分类信息
*
* @param id 商品分类信息主键
* @return 商品分类信息
*/
GoodsCategory selectGoodsCategoryById(Long id);
/**
* 查询商品分类信息列表
*
* @param goodsCategory 商品分类信息
* @return 商品分类信息集合
*/
List<GoodsCategory> selectGoodsCategoryList(GoodsCategory goodsCategory);
/**
* 新增商品分类信息
*
* @param goodsCategory 商品分类信息
* @return 结果
*/
int insertGoodsCategory(GoodsCategory goodsCategory);
/**
* 修改商品分类信息
*
* @param goodsCategory 商品分类信息
* @return 结果
*/
int updateGoodsCategory(GoodsCategory goodsCategory);
/**
* 删除商品分类信息
*
* @param id 商品分类信息主键
* @return 结果
*/
int deleteGoodsCategoryById(Long id);
/**
* 批量删除商品分类信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteGoodsCategoryByIds(Long[] ids);
/**
* 查询商品分类图片
*
* @param ids 商品分类id
* @return 集合
*/
List<String> selectCategoryPictureByIds(Long[] ids);
/**
* 根据id查询本级及下级信息
*
* @param ids 主键id集合
* @return List
*/
List<GoodsCategory> selectCategoryByIds(Long[] ids);
/**
* 根据id查询本级及上级信息
*
* @param id 主键
* @return ParentCategory
*/
ParentCategory selectParentIdById(Long id);
/**
* 根据商品分类名称查询名称数量
*
* @param goodsCategoryName 商品分类名称
* @param id 主键id
* @return int
*/
int getGoodsCategoryNameCount(@Param("id") Long id, @Param("goodsCategoryName") String goodsCategoryName);
}

View File

@ -0,0 +1,87 @@
package com.xinelu.manage.mapper.informationcategory;
import com.xinelu.manage.domain.informationcategory.InformationCategory;
import java.util.List;
/**
* 资讯分类Mapper接口
*
* @author xinyilu
* @date 2023-02-14
*/
public interface InformationCategoryMapper {
/**
* 查询资讯分类
*
* @param id 资讯分类主键
* @return 资讯分类
*/
InformationCategory selectInformationCategoryById(Long id);
/**
* 查询资讯分类列表
*
* @param informationCategory 资讯分类
* @return 资讯分类集合
*/
List<InformationCategory> selectInformationCategoryList(InformationCategory informationCategory);
/**
* 新增资讯分类
*
* @param informationCategory 资讯分类
* @return 结果
*/
int insertInformationCategory(InformationCategory informationCategory);
/**
* 修改资讯分类
*
* @param informationCategory 资讯分类
* @return 结果
*/
int updateInformationCategory(InformationCategory informationCategory);
/**
* 删除资讯分类
*
* @param id 资讯分类主键
* @return 结果
*/
int deleteInformationCategoryById(Long id);
/**
* 批量删除资讯分类
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteInformationCategoryByIds(Long[] ids);
/**
* 批量新增资讯分类
*
* @param informationCategoryList 资讯分类集合
* @return 数量
*/
int insertInformationCategoryList(List<InformationCategory> informationCategoryList);
/**
* 根据分类名称查询重复分类名称
*
* @param categoryNameList 资讯分类名称集合
* @return List<String>
*/
List<String> selectInformationCategoryName(List<String> categoryNameList);
/**
* 根据分类名称查询重复分类名称
*
* @param informationCategoryName 资讯分类名称
* @return int
**/
int selectInformationCategoryCount(String informationCategoryName);
}

View File

@ -0,0 +1,133 @@
package com.xinelu.manage.mapper.poserInfo;
import com.xinelu.common.core.domain.entity.SysDictData;
import com.xinelu.manage.domain.poserInfo.PoserInfo;
import com.xinelu.manage.dto.poserInfo.PoserInfoDTO;
import com.xinelu.manage.vo.poserInfo.PoserInfoVO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 泉医到家系统海报模块信息包含咨询简介信息Mapper接口
*
* @author xinyilu
* @date 2023-02-10
*/
public interface PoserInfoMapper {
/**
* 查询泉医到家系统海报模块信息包含咨询简介信息
*
* @param id 泉医到家系统海报模块信息包含咨询简介信息主键
* @return 泉医到家系统海报模块信息包含咨询简介信息
*/
PoserInfoVO selectPoserInfoById(Long id);
/**
* 查询泉医到家系统海报模块信息包含咨询简介信息列表
*
* @param poserInfo 泉医到家系统海报模块信息包含咨询简介信息
* @return 泉医到家系统海报模块信息包含咨询简介信息集合
*/
List<PoserInfoVO> selectPoserInfoList(PoserInfoVO poserInfo);
/**
* 查询泉医到家系统海报模块信息包含咨询简介信息列表
*
* @param poserInfo 泉医到家系统海报模块信息包含咨询简介信息
* @return 泉医到家系统海报模块信息包含咨询简介信息集合
*/
List<PoserInfoVO> getPoserInfoList(PoserInfoVO poserInfo);
/**
* 新增泉医到家系统海报模块信息包含咨询简介信息
*
* @param poserInfo 泉医到家系统海报模块信息包含咨询简介信息
* @return 结果
*/
int insertPoserInfo(PoserInfoDTO poserInfo);
/**
* 修改泉医到家系统海报模块信息包含咨询简介信息
*
* @param poserInfo 泉医到家系统海报模块信息包含咨询简介信息
* @return 结果
*/
int updatePoserInfo(PoserInfoDTO poserInfo);
/**
* 删除泉医到家系统海报模块信息包含咨询简介信息
*
* @param id 泉医到家系统海报模块信息包含咨询简介信息主键
* @return 结果
*/
int deletePoserInfoById(Long id);
/**
* 批量删除泉医到家系统海报模块信息包含咨询简介信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deletePoserInfoByIds(Long[] ids);
/**
* 根据moduleType批量删除泉医到家系统海报模块信息包含咨询简介信息
*
* @param moduleType 需要删除的数据主键集合
* @return 结果
*/
int deletePoserInfoByModuleType(String[] moduleType);
/**
* 新增订单评价图片信息
*
* @param poserInfoDTO 订单评价图片信息
* @return 结果
*/
int insertPoserInfoList(List<PoserInfoDTO> poserInfoDTO);
/**
* 查询泉医到家系统海报模块信息包含咨询简介信息
*
* @param poserInfo 泉医到家系统海报模块信息包含咨询简介信息主键
* @return 泉医到家系统海报模块信息包含咨询简介信息
*/
PoserInfoVO selectPoserInfoByModuleType(PoserInfoVO poserInfo);
/**
* 查询泉医到家系统海报模块信息包含咨询简介信息
*
* @param poserInfo 泉医到家系统海报模块信息包含咨询简介信息主键
* @return 泉医到家系统海报模块信息包含咨询简介信息
*/
List<PoserInfoVO> selectPoserInfoByModuleTypeList(PoserInfoVO poserInfo);
/**
* 查询当前海报模块是否存在
*
* @param moduleType 模块类型
* @param stationId 护理站id
* @param itemId 护理项目id
* @return 数量
*/
int getPoserInfoByModuleTypeAndId(@Param("moduleType") String moduleType, @Param("stationId") Long stationId, @Param("itemId") Long itemId);
/**
* 小程序根据模块类型查询海报
*
* @param moduleTyp 模块类型
* @return List<PoserInfo>
*/
List<PoserInfo> selectPoserListByModuleTyp(String moduleTyp);
/**
* 从字典表中查询海报跳转链接
*
* @param dictType 类型
* @return java.util.List<com.xinyilu.common.core.domain.entity.SysDictData>
**/
List<SysDictData> selectPosterImageJump(String dictType);
}

View File

@ -0,0 +1,64 @@
package com.xinelu.manage.service.informationcategory;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.manage.domain.informationcategory.InformationCategory;
import com.xinelu.manage.dto.informationcategory.InformationCategoryDTO;
import java.util.List;
/**
* 资讯分类Service接口
*
* @author xinyilu
* @date 2023-02-14
*/
public interface IInformationCategoryService {
/**
* 查询资讯分类
*
* @param id 资讯分类主键
* @return 资讯分类
*/
InformationCategory selectInformationCategoryById(Long id);
/**
* 查询资讯分类列表
*
* @param informationCategory 资讯分类
* @return 资讯分类集合
*/
List<InformationCategory> selectInformationCategoryList(InformationCategory informationCategory);
/**
* 新增资讯分类
*
* @param informationCategory 资讯分类
* @return 结果
*/
AjaxResult insertInformationCategory(InformationCategoryDTO informationCategory);
/**
* 修改资讯分类
*
* @param informationCategory 资讯分类
* @return 结果
*/
AjaxResult updateInformationCategory(InformationCategory informationCategory);
/**
* 批量删除资讯分类
*
* @param ids 需要删除的资讯分类主键集合
* @return 结果
*/
int deleteInformationCategoryByIds(Long[] ids);
/**
* 删除资讯分类信息
*
* @param id 资讯分类主键
* @return 结果
*/
int deleteInformationCategoryById(Long id);
}

View File

@ -0,0 +1,149 @@
package com.xinelu.manage.service.informationcategory.impl;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
import com.xinelu.manage.domain.informationcategory.InformationCategory;
import com.xinelu.manage.dto.informationcategory.InformationCategoryDTO;
import com.xinelu.manage.mapper.informationcategory.InformationCategoryMapper;
import com.xinelu.manage.service.informationcategory.IInformationCategoryService;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 资讯分类Service业务层处理
*
* @author xinyilu
* @date 2023-02-14
*/
@Service
public class InformationCategoryServiceImpl implements IInformationCategoryService {
@Resource
private InformationCategoryMapper informationCategoryMapper;
@Resource
private GenerateSystemCodeUtil generateSystemCodeUtil;
/**
* 查询资讯分类
*
* @param id 资讯分类主键
* @return 资讯分类
*/
@Override
public InformationCategory selectInformationCategoryById(Long id) {
return informationCategoryMapper.selectInformationCategoryById(id);
}
/**
* 查询资讯分类列表
*
* @param informationCategory 资讯分类
* @return 资讯分类
*/
@Override
public List<InformationCategory> selectInformationCategoryList(InformationCategory informationCategory) {
return informationCategoryMapper.selectInformationCategoryList(informationCategory);
}
/**
* 新增资讯分类
*
* @param informationCategoryList 资讯分类
* @return 结果
*/
@Transactional(rollbackFor = Exception.class)
@Override
public AjaxResult insertInformationCategory(InformationCategoryDTO informationCategoryList) {
//筛选资讯分类名称
List<String> categoryNameList = informationCategoryList.getInformationCategoryList().stream().filter(Objects::nonNull).map(InformationCategory::getInformationCategoryName).collect(Collectors.toList());
//资讯分类名称去重
List<String> distinctNameList = informationCategoryList.getInformationCategoryList().stream().filter(Objects::nonNull).map(InformationCategory::getInformationCategoryName).distinct().collect(Collectors.toList());
//集合取差集
List<String> subtractNameList = new ArrayList<>(CollectionUtils.subtract(categoryNameList, distinctNameList));
if (subtractNameList.size() > 0) {
return AjaxResult.error("'" + subtractNameList.get(0) + "'重复,请修改后重新录入!");
}
//数据库查询资讯分类名称
List<String> existCategoryName = informationCategoryMapper.selectInformationCategoryName(categoryNameList);
//集合取交集
List<String> existRetainAllNameList = new ArrayList<>(CollectionUtils.intersection(distinctNameList, existCategoryName));
if (existRetainAllNameList.size() > 0) {
return AjaxResult.error("'" + existRetainAllNameList.get(0) + "'已存在,请修改后重新录入!");
}
//新增资讯分类信息
for (InformationCategory informationCategory : informationCategoryList.getInformationCategoryList()) {
informationCategory.setCreateTime(LocalDateTime.now());
informationCategory.setCreateBy(SecurityUtils.getUsername());
informationCategory.setInformationCategoryCode(Constants.INFORMATION_CATEGORY_CODE + generateSystemCodeUtil.generateSystemCode(Constants.DEPARTMENT_CODE));
}
int insertCount = informationCategoryMapper.insertInformationCategoryList(informationCategoryList.getInformationCategoryList());
if (insertCount < 0) {
throw new RuntimeException("新增咨询分类信息失败,请联系管理员!");
}
return AjaxResult.success();
}
/**
* 修改资讯分类
*
* @param informationCategory 资讯分类
* @return 结果
*/
@Override
public AjaxResult updateInformationCategory(InformationCategory informationCategory) {
//根据咨询分类id查询数据库
InformationCategory informationCategoryById = informationCategoryMapper.selectInformationCategoryById(informationCategory.getId());
if (Objects.isNull(informationCategoryById)) {
return AjaxResult.error("当前资讯分类信息不存在,无法修改,请联系管理员!");
}
if (StringUtils.isNotBlank(informationCategory.getInformationCategoryName())
&& StringUtils.isNotBlank(informationCategoryById.getInformationCategoryName())
&& !informationCategory.getInformationCategoryName().equals(informationCategoryById.getInformationCategoryName())) {
int informationCategoryCount = informationCategoryMapper.selectInformationCategoryCount(informationCategory.getInformationCategoryName());
if (informationCategoryCount > 0) {
return AjaxResult.error("已有该资讯分类信息名称:" + informationCategory.getInformationCategoryName());
}
}
informationCategory.setUpdateTime(LocalDateTime.now());
informationCategory.setUpdateBy(SecurityUtils.getUsername());
int updateInformationCategory = informationCategoryMapper.updateInformationCategory(informationCategory);
if (updateInformationCategory < 0) {
return AjaxResult.error("修改资讯分类信息失败,请联系管理员!");
}
return AjaxResult.success();
}
/**
* 批量删除资讯分类
*
* @param ids 需要删除的资讯分类主键
* @return 结果
*/
@Transactional(rollbackFor = Exception.class)
@Override
public int deleteInformationCategoryByIds(Long[] ids) {
return informationCategoryMapper.deleteInformationCategoryByIds(ids);
}
/**
* 删除资讯分类信息
*
* @param id 资讯分类主键
* @return 结果
*/
@Override
public int deleteInformationCategoryById(Long id) {
return informationCategoryMapper.deleteInformationCategoryById(id);
}
}

View File

@ -0,0 +1,96 @@
package com.xinelu.manage.service.poserInfo;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.manage.dto.poserInfo.PoserInfoDTO;
import com.xinelu.manage.vo.poserInfo.PoserInfoVO;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
/**
* 泉医到家系统海报模块信息包含咨询简介信息Service接口
*
* @author xinyilu
* @date 2023-02-10
*/
public interface IPoserInfoService {
/**
* 查询泉医到家系统海报模块信息包含咨询简介信息
*
* @param id 泉医到家系统海报模块信息包含咨询简介信息主键
* @return 泉医到家系统海报模块信息包含咨询简介信息
*/
PoserInfoVO selectPoserInfoById(Long id);
/**
* 查询泉医到家系统海报模块信息包含咨询简介信息列表
*
* @param poserInfo 泉医到家系统海报模块信息包含咨询简介信息
* @return 泉医到家系统海报模块信息包含咨询简介信息集合
*/
List<PoserInfoVO> selectPoserInfoList(PoserInfoVO poserInfo);
/**
* 新增泉医到家系统海报模块信息包含咨询简介信息
*
* @param poserInfo 泉医到家系统海报模块信息包含咨询简介信息
* @return 结果
*/
AjaxResult insertPoserInfo(PoserInfoDTO poserInfo);
/**
* 修改泉医到家系统海报模块信息包含咨询简介信息
*
* @param poserInfo 泉医到家系统海报模块信息包含咨询简介信息
* @return 结果
*/
AjaxResult updatePoserInfo(PoserInfoDTO poserInfo);
/**
* 批量删除泉医到家系统海报模块信息包含咨询简介信息
*
* @param ids 需要删除的泉医到家系统海报模块信息包含咨询简介信息主键集合
* @return 结果
*/
int deletePoserInfoByIds(Long[] ids);
/**
* 删除泉医到家系统海报模块信息包含咨询简介信息信息
*
* @param id 泉医到家系统海报模块信息包含咨询简介信息主键
* @return 结果
*/
int deletePoserInfoById(Long id);
/**
* 根据moduleType 护理站id 护理项目id 删除泉医到家系统海报模块信息包含咨询简介信息
*
* @param poserInfo 需要删除的数据主键集合
* @return 结果
*/
AjaxResult deletePoserInfoByModuleType(PoserInfoVO poserInfo);
/**
* 查询泉医到家系统海报模块信息包含咨询简介信息
*
* @param poserInfo 泉医到家系统海报模块信息包含咨询简介信息主键
* @return 泉医到家系统海报模块信息包含咨询简介信息
*/
AjaxResult selectPoserInfoByModuleType(PoserInfoVO poserInfo);
/**
* 头像图片接口
*
* @param multipartFile 文件
* @return com.xinyilu.common.core.domain.AjaxResult
**/
AjaxResult updatePoserHeads(MultipartFile multipartFile, String type) throws Exception;
/**
* 从字典表中查询海报跳转链接
*
* @param dictType 类型
* @return java.util.List<com.xinyilu.common.core.domain.entity.SysDictData>
**/
AjaxResult selectPosterImageJump(String dictType);
}

View File

@ -0,0 +1,479 @@
package com.xinelu.manage.service.poserInfo.impl;
import com.xinelu.common.config.XinELuConfig;
import com.xinelu.common.constant.Constants;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.enums.PoserModuleTypeEnum;
import com.xinelu.common.exception.ServiceException;
import com.xinelu.common.utils.SecurityUtils;
import com.xinelu.common.utils.bean.BeanUtils;
import com.xinelu.common.utils.codes.GenerateSystemCodeUtil;
import com.xinelu.common.utils.file.FileUploadUtils;
import com.xinelu.common.utils.file.MimeTypeUtils;
import com.xinelu.manage.dto.poserInfo.PoserInfoDTO;
import com.xinelu.manage.mapper.poserInfo.PoserInfoMapper;
import com.xinelu.manage.service.poserInfo.IPoserInfoService;
import com.xinelu.manage.vo.poserInfo.PoserInfoVO;
import com.xinelu.manage.vo.poserInfo.PosterPictureUrlVO;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.BooleanUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.File;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* 泉医到家系统海报模块信息包含咨询简介信息Service业务层处理
*
* @author xinyilu
* @date 2023-02-10
*/
@Service
public class PoserInfoServiceImpl implements IPoserInfoService {
@Resource
private PoserInfoMapper poserInfoMapper;
@Resource
private GenerateSystemCodeUtil generateSystemCodeUtil;
@Resource
private XinELuConfig xinYiLuConfig;
/**
* 查询泉医到家系统海报模块信息包含咨询简介信息
*
* @param id 泉医到家系统海报模块信息包含咨询简介信息主键
* @return 泉医到家系统海报模块信息包含咨询简介信息
*/
@Override
public PoserInfoVO selectPoserInfoById(Long id) {
return poserInfoMapper.selectPoserInfoById(id);
}
/**
* 查询泉医到家系统海报模块信息包含咨询简介信息列表
*
* @param poserInfo 泉医到家系统海报模块信息包含咨询简介信息
* @return 泉医到家系统海报模块信息包含咨询简介信息
*/
@Override
public List<PoserInfoVO> selectPoserInfoList(PoserInfoVO poserInfo) {
return poserInfoMapper.selectPoserInfoList(poserInfo);
}
/**
* 新增泉医到家系统海报模块信息包含咨询简介信息
*
* @param poserInfo 泉医到家系统海报模块信息包含咨询简介信息
* @return 结果
*/
@Transactional(rollbackFor = Exception.class)
@Override
public AjaxResult insertPoserInfo(PoserInfoDTO poserInfo) {
//校验模块是否为空
AjaxResult module = this.module(poserInfo);
if (Objects.nonNull(module)) {
return module;
}
//校验当前模块是否存在
if (PoserModuleTypeEnum.NURSE_AGENCY_MODULE.getInfo().equals(poserInfo.getModuleType())) {
int count = poserInfoMapper.getPoserInfoByModuleTypeAndId(poserInfo.getModuleType(), poserInfo.getNurseStationId(), null);
if (count > 0) {
String nurseStationName = StringUtils.isBlank(poserInfo.getNurseStationName()) ? "" : poserInfo.getNurseStationName();
return AjaxResult.error("当前'" + nurseStationName + "'海报模块已经存在,无需再新增,直接在原有模块中进行修改即可!");
}
}
if (PoserModuleTypeEnum.NURSE_ITEM_MODULE.getInfo().equals(poserInfo.getModuleType())) {
int count = poserInfoMapper.getPoserInfoByModuleTypeAndId(poserInfo.getModuleType(), poserInfo.getNurseStationId(), poserInfo.getNurseItemId());
if (count > 0) {
String nurseItemName = StringUtils.isBlank(poserInfo.getNurseItemName()) ? "" : poserInfo.getNurseItemName();
return AjaxResult.error("当前'" + nurseItemName + "'海报模块已经存在,无需再新增,直接在原有模块中进行修改即可!");
}
}
if (!PoserModuleTypeEnum.NURSE_ITEM_MODULE.getInfo().equals(poserInfo.getModuleType()) && !PoserModuleTypeEnum.NURSE_AGENCY_MODULE.getInfo().equals(poserInfo.getModuleType())) {
int count = poserInfoMapper.getPoserInfoByModuleTypeAndId(poserInfo.getModuleType(), null, null);
if (count > 0) {
String moduleName = getModuleName(StringUtils.isBlank(poserInfo.getModuleType()) ? "" : poserInfo.getModuleType());
return AjaxResult.error("当前'" + moduleName + "'海报已经存在,无需再新增,直接在原有模块中进行修改即可!");
}
}
List<PoserInfoDTO> poserInfoList = new ArrayList<>();
//新增信息
if (CollectionUtils.isNotEmpty(poserInfo.getPosterPictureUrlLists())) {
for (PosterPictureUrlVO posterPictureUrlList : poserInfo.getPosterPictureUrlLists()) {
if (StringUtils.isBlank(posterPictureUrlList.getPosterPictureUrl())) {
return AjaxResult.error("海报图片不能为空!");
}
PoserInfoDTO poserInfoDTO = new PoserInfoDTO();
BeanUtils.copyProperties(poserInfo, poserInfoDTO);
poserInfoDTO.setPoserCode(Constants.POSER_CODE + generateSystemCodeUtil.generateSystemCode(Constants.POSER_CODE));
poserInfoDTO.setPosterPictureUrl(posterPictureUrlList.getPosterPictureUrl());
poserInfoDTO.setJumpType(StringUtils.isBlank(posterPictureUrlList.getJumpType()) ? "" : posterPictureUrlList.getJumpType());
poserInfoDTO.setJumpLink(StringUtils.isBlank(posterPictureUrlList.getJumpLink()) ? "" : posterPictureUrlList.getJumpLink());
poserInfoDTO.setJumpDictId(Objects.isNull(posterPictureUrlList.getJumpDictId()) ? null : posterPictureUrlList.getJumpDictId());
poserInfoDTO.setCreateBy(SecurityUtils.getUsername());
poserInfoDTO.setCreateTime(LocalDateTime.now());
poserInfoList.add(poserInfoDTO);
}
}
int insertPoserInfoList = poserInfoMapper.insertPoserInfoList(poserInfoList);
if (insertPoserInfoList <= 0) {
throw new ServiceException("新增信息失败,请联系管理员!");
}
return AjaxResult.success();
}
/**
* 修改泉医到家系统海报模块信息包含咨询简介信息
*
* @param poserInfo 泉医到家系统海报模块信息包含咨询简介信息
* @return 结果
*/
@Transactional(rollbackFor = Exception.class)
@Override
public AjaxResult updatePoserInfo(PoserInfoDTO poserInfo) {
//校验模块是否为空
AjaxResult module = this.module(poserInfo);
if (Objects.nonNull(module)) {
return module;
}
//根据ModuleType去查询数据已经存在的海报信息
PoserInfoVO poserInfoDate = new PoserInfoVO();
poserInfoDate.setModuleType(poserInfo.getModuleType());
poserInfoDate.setNurseStationId(Objects.isNull(poserInfo.getNurseStationId()) ? null : poserInfo.getNurseStationId());
poserInfoDate.setNurseItemId(Objects.isNull(poserInfo.getNurseItemId()) ? null : poserInfo.getNurseItemId());
//查询出数据库中原有的
List<PoserInfoVO> poserInfoLists = poserInfoMapper.selectPoserInfoByModuleTypeList(poserInfoDate);
if (CollectionUtils.isEmpty(poserInfoLists)) {
return AjaxResult.error("当前信息不存在,请联系管理员!");
}
//前端传过来的
List<PosterPictureUrlVO> posterPictureUrlLists = poserInfo.getPosterPictureUrlLists();
//使用Stream流取出数据库中原有的id
List<Long> poserInfoLongList = poserInfoLists.stream().filter(Objects::nonNull).filter(pose -> (Objects.nonNull(pose.getId()))).map(PoserInfoVO::getId).distinct().collect(Collectors.toList());
//使用Stream流取出前端传过来的id
List<Long> posterPictureUrlLongList = posterPictureUrlLists.stream().filter(Objects::nonNull).filter(pose -> (Objects.nonNull(pose.getId()))).map(PosterPictureUrlVO::getId).distinct().collect(Collectors.toList());
// 数据库中的与前端原有的做差集
List<Long> subtractList = new ArrayList<>(CollectionUtils.subtract(poserInfoLongList, posterPictureUrlLongList));
//判断是否为空 不为空去删
if (CollectionUtils.isNotEmpty(subtractList)) {
int deletePoserInfoByIds = poserInfoMapper.deletePoserInfoByIds(subtractList.toArray(new Long[0]));
if (deletePoserInfoByIds <= 0) {
throw new ServiceException("删除信息失败,请联系管理员!");
}
}
//循环新增如果id是空的说明是新增的
this.insertAndUpdate(posterPictureUrlLists, poserInfo);
//前端传过来的图片链接
List<String> ratePosterPictureUrList = posterPictureUrlLists.stream().filter(Objects::nonNull).filter(pose -> (StringUtils.isNotBlank(pose.getPosterPictureUrl()))).map(PosterPictureUrlVO::getPosterPictureUrl).distinct().collect(Collectors.toList());
//数据库中的图片链接
List<String> leftPosterPictureUrList = poserInfoLists.stream().filter(Objects::nonNull).filter(pose -> (StringUtils.isNotBlank(pose.getPosterPictureUrl()))).map(PoserInfoVO::getPosterPictureUrl).distinct().collect(Collectors.toList());
// 图片数据库中的与前端原有的做差集
List<String> subtractPosterPictureUrList = new ArrayList<>(CollectionUtils.subtract(leftPosterPictureUrList, ratePosterPictureUrList));
// 删除图片与视频
this.updateDeletePictureAndVideo(subtractPosterPictureUrList, poserInfoLists, poserInfo);
return AjaxResult.success();
}
/**
* 批量删除泉医到家系统海报模块信息包含咨询简介信息
*
* @param ids 需要删除的泉医到家系统海报模块信息包含咨询简介信息主键
* @return 结果
*/
@Override
public int deletePoserInfoByIds(Long[] ids) {
return poserInfoMapper.deletePoserInfoByIds(ids);
}
/**
* 删除泉医到家系统海报模块信息包含咨询简介信息信息
*
* @param id 泉医到家系统海报模块信息包含咨询简介信息主键
* @return 结果
*/
@Override
public int deletePoserInfoById(Long id) {
return poserInfoMapper.deletePoserInfoById(id);
}
/**
* 根据moduleType 护理站id 护理项目id 删除泉医到家系统海报模块信息包含咨询简介信息
*
* @param poserInfo 需要删除的数据
* @return 结果
*/
@Transactional(rollbackFor = Exception.class)
@Override
public AjaxResult deletePoserInfoByModuleType(PoserInfoVO poserInfo) {
List<PoserInfoVO> poserInfoLists = poserInfoMapper.selectPoserInfoByModuleTypeList(poserInfo);
if (CollectionUtils.isEmpty(poserInfoLists)) {
return AjaxResult.error("当前信息不存在,请联系管理员!");
}
//使用Stream流取出id
Long[] longList = poserInfoLists.stream().filter(Objects::nonNull)
.filter(pose -> (Objects.nonNull(pose.getId())))
.map(PoserInfoVO::getId).toArray(Long[]::new);
int deletePoserInfoByModuleType = poserInfoMapper.deletePoserInfoByIds(longList);
if (deletePoserInfoByModuleType <= 0) {
throw new ServiceException("删除失败,请联系管理员!");
}
//删除图片与视频地址
this.deletePictureAndVideo(poserInfoLists);
return AjaxResult.success();
}
/**
* 头像图片上传接口
*
* @param multipartFile 文件
* @return com.xinyilu.common.core.domain.AjaxResult
**/
@Override
public AjaxResult updatePoserHeads(MultipartFile multipartFile, String type) throws Exception {
//获取不同的文件路径
String uploadPathUrl = "";
//海报视频存放路径地址
if (Constants.POSTER_VIDEO_URL.equals(type)) {
uploadPathUrl = XinELuConfig.getProfile() + xinYiLuConfig.getPosterVideoUrl();
}
if (StringUtils.isBlank(uploadPathUrl)) {
return AjaxResult.success();
}
//上传
String pictureName = FileUploadUtils.uploadNurseStationPath(uploadPathUrl, multipartFile, MimeTypeUtils.VIDEO_EXTENSION);
if (StringUtils.isBlank(pictureName)) {
throw new ServiceException("视频上传失败,请联系管理员!");
}
AjaxResult ajax = AjaxResult.success("上传成功!");
ajax.put("imgUrl", pictureName);
return ajax;
}
/**
* 从字典表中查询海报跳转链接
*
* @param dictType 类型
* @return java.util.List<com.xinyilu.common.core.domain.entity.SysDictData>
**/
@Override
public AjaxResult selectPosterImageJump(String dictType) {
return AjaxResult.success(poserInfoMapper.selectPosterImageJump("poster_image_jump"));
}
/**
* 根据 模块类型 护理站id 护理项目id 查询泉医到家系统海报模块信息包含咨询简介信息
*
* @param poserInfo 泉医到家系统海报模块信息包含咨询简介信息
* @return 泉医到家系统海报模块信息包含咨询简介信息
*/
@Override
public AjaxResult selectPoserInfoByModuleType(PoserInfoVO poserInfo) {
//先根据moduleType查一下数据库
PoserInfoVO poserInfoVO = new PoserInfoVO();
List<PoserInfoVO> poserInfoVOList = poserInfoMapper.getPoserInfoList(poserInfo);
if (poserInfoVOList.size() > 0) {
BeanUtils.copyProperties(poserInfoVOList.get(0), poserInfoVO);
}
//处理海报视频路径
List<String> posterVideoUrlList = poserInfoVOList.stream().map(PoserInfoVO::getPosterVideoUrl).filter(StringUtils::isNotBlank).collect(Collectors.toList());
if (CollectionUtils.isNotEmpty(posterVideoUrlList)) {
poserInfoVO.setPosterVideoUrl(posterVideoUrlList.get(0));
}
List<PosterPictureUrlVO> posterPictureUrlLists = new ArrayList<>();
poserInfoVOList.forEach(pose -> {
PosterPictureUrlVO posterPictureUrlList = new PosterPictureUrlVO();
posterPictureUrlList.setId(pose.getId());
posterPictureUrlList.setPosterPictureUrl(pose.getPosterPictureUrl());
posterPictureUrlList.setJumpType(StringUtils.isBlank(pose.getJumpType()) ? "" : pose.getJumpType());
posterPictureUrlList.setJumpLink(StringUtils.isBlank(pose.getJumpLink()) ? "" : pose.getJumpLink());
posterPictureUrlList.setJumpDictId(Objects.isNull(pose.getJumpDictId()) ? null : pose.getJumpDictId());
posterPictureUrlLists.add(posterPictureUrlList);
});
poserInfoVO.setPosterPictureUrlLists(posterPictureUrlLists);
return AjaxResult.success(poserInfoVO);
}
/**
* 校验模块是否为空
*
* @param poserInfo 前端传的值
**/
private AjaxResult module(PoserInfoDTO poserInfo) {
//如果选中护理站模块 那么护理站不能为空
if (PoserModuleTypeEnum.NURSE_AGENCY_MODULE.getInfo().equals(poserInfo.getModuleType())) {
if (Objects.isNull(poserInfo.getNurseStationId())) {
return AjaxResult.error("请选择护理站!");
}
}
//如果选中护理项目模块 那么护理项目不能为空
if (PoserModuleTypeEnum.NURSE_ITEM_MODULE.getInfo().equals(poserInfo.getModuleType())) {
if (Objects.isNull(poserInfo.getNurseStationId())) {
return AjaxResult.error("请护理项目所属的护理站!");
}
if (Objects.isNull(poserInfo.getNurseItemId())) {
return AjaxResult.error("请选择护理项目!");
}
}
return null;
}
/**
* 修改提取方法 新增以及修改
*
* @param posterPictureUrlLists 前端传过来的取出的图片集合
* @param poserInfo 前端传过来的数据实体
**/
private void insertAndUpdate(List<PosterPictureUrlVO> posterPictureUrlLists, PoserInfoDTO poserInfo) {
//循环新增 如果id是空的说明是新增的
if (CollectionUtils.isEmpty(posterPictureUrlLists)) {
return;
}
for (PosterPictureUrlVO posterPictureUrlList : posterPictureUrlLists) {
if (StringUtils.isBlank(posterPictureUrlList.getPosterPictureUrl())) {
throw new ServiceException("海报图片不能为空!");
}
PoserInfoDTO poserInfoDTO = new PoserInfoDTO();
if (Objects.isNull(posterPictureUrlList.getId())) {
BeanUtils.copyProperties(poserInfo, poserInfoDTO);
poserInfoDTO.setPoserCode(Constants.POSER_CODE + generateSystemCodeUtil.generateSystemCode(Constants.POSER_CODE));
poserInfoDTO.setPosterPictureUrl(posterPictureUrlList.getPosterPictureUrl());
poserInfoDTO.setJumpType(StringUtils.isBlank(posterPictureUrlList.getJumpType()) ? "" : posterPictureUrlList.getJumpType());
poserInfoDTO.setJumpLink(StringUtils.isBlank(posterPictureUrlList.getJumpLink()) ? "" : posterPictureUrlList.getJumpLink());
poserInfoDTO.setJumpDictId(Objects.isNull(posterPictureUrlList.getJumpDictId()) ? null : posterPictureUrlList.getJumpDictId());
poserInfoDTO.setCreateBy(SecurityUtils.getUsername());
poserInfoDTO.setCreateTime(LocalDateTime.now());
//新增信息
int insertPoserInfoList = poserInfoMapper.insertPoserInfo(poserInfoDTO);
if (insertPoserInfoList <= 0) {
throw new ServiceException("新增信息失败,请联系管理员!");
}
} else {
//修改方法 塞入固定不变的值与变化的值
poserInfoDTO.setId(posterPictureUrlList.getId());
poserInfoDTO.setPosterPictureUrl(posterPictureUrlList.getPosterPictureUrl());
poserInfoDTO.setJumpType(StringUtils.isBlank(posterPictureUrlList.getJumpType()) ? "" : posterPictureUrlList.getJumpType());
poserInfoDTO.setPoserCode(posterPictureUrlList.getPoserCode());
poserInfoDTO.setJumpLink(StringUtils.isBlank(posterPictureUrlList.getJumpLink()) ? "" : posterPictureUrlList.getJumpLink());
poserInfoDTO.setJumpDictId(Objects.isNull(posterPictureUrlList.getJumpDictId()) ? null : posterPictureUrlList.getJumpDictId());
poserInfoDTO.setNurseStationId(Objects.isNull(poserInfo.getNurseStationId()) ? null : poserInfo.getNurseStationId());
poserInfoDTO.setNurseItemId(Objects.isNull(poserInfo.getNurseItemId()) ? null : poserInfo.getNurseItemId());
poserInfoDTO.setPosterIntroduce(StringUtils.isBlank(poserInfo.getPosterIntroduce()) ? "" : poserInfo.getPosterIntroduce());
poserInfoDTO.setPosterVideoUrl(StringUtils.isBlank(poserInfo.getPosterVideoUrl()) ? "" : poserInfo.getPosterVideoUrl());
poserInfoDTO.setPoserName(poserInfo.getPoserName());
poserInfoDTO.setModuleType(poserInfo.getModuleType());
poserInfoDTO.setPoserSort(poserInfo.getPoserSort());
poserInfoDTO.setUpdateBy(SecurityUtils.getUsername());
poserInfoDTO.setUpdateTime(LocalDateTime.now());
int updatePoserInfo = poserInfoMapper.updatePoserInfo(poserInfoDTO);
if (updatePoserInfo < 0) {
throw new ServiceException("修改信息失败,请联系管理员!");
}
}
}
}
/**
* 修改方法删除图片地址与视频
*
* @param subtractPosterPictureUrList 数据库中的图片 前端原有的做差集
* @param poserInfoLists 查询出数据库中原有的数据
* @param poserInfo 前端传过来的数据
**/
private void updateDeletePictureAndVideo(List<String> subtractPosterPictureUrList, List<PoserInfoVO> poserInfoLists, PoserInfoDTO poserInfo) {
//循环删除多个海报图片
for (String posterPictureUrList : subtractPosterPictureUrList) {
this.deletePictureUrl(posterPictureUrList);
}
//删除海报宣传视频
if (poserInfoLists.size() > 0 && StringUtils.isNotBlank(poserInfo.getPosterVideoUrl())) {
//此处视频url路径重复取第一个即可
String posterVideoUrl = poserInfoLists.get(0).getPosterVideoUrl();
if (StringUtils.isNotBlank(posterVideoUrl) && !StringUtils.equals(poserInfo.getPosterVideoUrl(), posterVideoUrl)) {
this.deletePictureUrl(posterVideoUrl);
}
}
}
/**
* 删除图片地址与视频
*
* @param poserInfoLists list集合
**/
private void deletePictureAndVideo(List<PoserInfoVO> poserInfoLists) {
//取出视频地址与 图片地址
List<String> posterPictureUrlList = poserInfoLists.stream().filter(pose -> StringUtils.isNotBlank(pose.getPosterPictureUrl())).map(PoserInfoVO::getPosterPictureUrl).collect(Collectors.toList());
// 删除图片与视频地址
for (String posterPictureUrl : posterPictureUrlList) {
if (StringUtils.isNotBlank(posterPictureUrl)) {
this.deletePictureUrl(posterPictureUrl);
}
}
//删除视频
if (poserInfoLists.size() > 0) {
//此处视频url路径重复取第一个即可
String posterVideoUrl = poserInfoLists.get(0).getPosterVideoUrl();
if (StringUtils.isNotBlank(posterVideoUrl)) {
this.deletePictureUrl(posterVideoUrl);
}
}
}
/**
* 删除图片地址
*
* @param pictureUrl 图片地址
**/
private void deletePictureUrl(String pictureUrl) {
if (StringUtils.isBlank(pictureUrl)) {
return;
}
String picture = XinELuConfig.getProfile() + pictureUrl.replaceAll("/profile", "");
File checkReportNameFile = new File(picture);
if (checkReportNameFile.exists()) {
boolean delete = checkReportNameFile.delete();
if (BooleanUtils.isFalse(delete)) {
throw new ServiceException("图片地址删除失败!");
}
}
}
/**
* 根据模块类型获取模块名称
*
* @param moduleType 模块类型
* @return 模块名称
*/
private String getModuleName(String moduleType) {
String moduleName;
switch (moduleType) {
case "NURSE_AGENCY_MODULE":
moduleName = "护理机构模块";
break;
case "NURSE_ITEM_MODULE":
moduleName = "护理项目模块";
break;
case "HEALTH_CONSUTION_MODULE":
moduleName = "健康咨询模块";
break;
case "HOME_PAGE_MODULE":
moduleName = "首页模块";
break;
case "NURSE_AGENCY_INTRODUCE_MODULE":
moduleName = "护理机构简介模块";
break;
default:
moduleName = "";
break;
}
return moduleName;
}
}

View File

@ -0,0 +1,23 @@
package com.xinelu.manage.vo.goodsCategory;
import com.xinelu.manage.domain.goodsCategory.GoodsCategory;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
/**
* @Description 被护理人传输实体类
* @Author zhangheng
* @Date 2023-1-16
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class ParentCategory extends GoodsCategory implements Serializable {
private static final long serialVersionUID = -6346533226143785247L;
/**
* 父级分类名称
*/
private String parentName;
}

View File

@ -0,0 +1,63 @@
package com.xinelu.manage.vo.poserInfo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.manage.domain.poserInfo.PoserInfo;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author ljh
* @version 1.0
* Create by 2023/2/13 13:38
*/
@EqualsAndHashCode(callSuper = true)
@Data
public class PoserInfoVO extends PoserInfo implements Serializable {
private static final long serialVersionUID = 2529036615806181455L;
/**
* 护理站名称
**/
private String nurseStationName;
/**
* 护理项目名称
**/
private String nurseItemName;
/**
* 创建者
*/
private String createBy;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime createTime;
/**
* 更新者
*/
private String updateBy;
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private LocalDateTime updateTime;
/**
* 图片集合
*/
private List<PosterPictureUrlVO> posterPictureUrlLists;
/**
* 视频集合
*/
private List<PosterVideoUrlVO> posterVideoUrlLists;
}

View File

@ -0,0 +1,56 @@
package com.xinelu.manage.vo.poserInfo;
import com.xinelu.common.custominterface.Insert;
import com.xinelu.common.custominterface.Update;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @author ljh
* @version 1.0
* Create by 2023/2/13 15:43
*/
@Data
public class PosterPictureUrlVO implements Serializable {
private static final long serialVersionUID = 7010254937989118627L;
/**
* 主键id
*/
private Long id;
/**
* 海报图片存放路径
*/
@NotBlank(message = "海报图片存放路径不能为空", groups = {Insert.class, Update.class})
private String posterPictureUrl;
/**
* 海报图片跳转标识新人福利NEW_PEOPLE_WELFARE首页HOME_PAGE商城SHOPPING
*/
private String jumpType;
/**
* 海报编号系统自动生成
*/
private String poserCode;
/**
* 海报图片跳转链接
*/
private String jumpLink;
/**
* 图片跳转类型字典表id
*/
private Long jumpDictId;
/**
* 海报显示顺序
*/
private Integer poserSort;
}

View File

@ -0,0 +1,20 @@
package com.xinelu.manage.vo.poserInfo;
import lombok.Data;
import java.io.Serializable;
/**
* @author ljh
* @version 1.0
* Create by 2023/2/13 15:46
*/
@Data
public class PosterVideoUrlVO implements Serializable {
private static final long serialVersionUID = -7378552817758688560L;
/**
* 海报视频存放路径
*/
private String posterVideoUrl;
}

View File

@ -0,0 +1,235 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xinelu.manage.mapper.goodsCategory.GoodsCategoryMapper">
<resultMap type="GoodsCategory" id="GoodsCategoryResult">
<result property="id" column="id"/>
<result property="parentId" column="parent_id"/>
<result property="goodsCategoryName" column="goods_category_name"/>
<result property="goodsCategoryCode" column="goods_category_code"/>
<result property="goodsCategoryPicture" column="goods_category_picture"/>
<result property="categoryRemark" column="category_remark"/>
<result property="categoryLevel" column="category_level"/>
<result property="sort" column="sort"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectGoodsCategoryVo">
select id,
parent_id,
goods_category_name,
goods_category_code,
goods_category_picture,
category_remark,
category_level,
sort,
create_by,
create_time,
update_by,
update_time
from goods_category
</sql>
<select id="selectGoodsCategoryList" parameterType="GoodsCategory" resultMap="GoodsCategoryResult">
<include refid="selectGoodsCategoryVo"/>
<where>
<if test="parentId != null">
and parent_id =#{parentId}
</if>
<if test="goodsCategoryName != null and goodsCategoryName != ''">
and goods_category_name like concat('%', #{goodsCategoryName}, '%')
</if>
<if test="goodsCategoryCode != null and goodsCategoryCode != ''">
and goods_category_code = #{goodsCategoryCode}
</if>
<if test="goodsCategoryPicture != null and goodsCategoryPicture != ''">
and goods_category_picture = #{goodsCategoryPicture}
</if>
<if test="categoryRemark != null and categoryRemark != ''">
and category_remark = #{categoryRemark}
</if>
<if test="sort != null ">
and sort = #{sort}
</if>
</where>
order by sort
</select>
<select id="selectGoodsCategoryById" parameterType="Long"
resultMap="GoodsCategoryResult">
<include refid="selectGoodsCategoryVo"/>
where id = #{id}
</select>
<insert id="insertGoodsCategory" parameterType="GoodsCategory" useGeneratedKeys="true"
keyProperty="id">
insert into goods_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="parentId != null">parent_id,
</if>
<if test="goodsCategoryName != null">goods_category_name,
</if>
<if test="goodsCategoryCode != null">goods_category_code,
</if>
<if test="goodsCategoryPicture != null">goods_category_picture,
</if>
<if test="categoryRemark != null">category_remark,
</if>
<if test="categoryLevel != null">category_level,
</if>
<if test="sort != null">sort,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="parentId != null">#{parentId},
</if>
<if test="goodsCategoryName != null">#{goodsCategoryName},
</if>
<if test="goodsCategoryCode != null">#{goodsCategoryCode},
</if>
<if test="goodsCategoryPicture != null">#{goodsCategoryPicture},
</if>
<if test="categoryRemark != null">#{categoryRemark},
</if>
<if test="categoryLevel != null">#{categoryLevel},
</if>
<if test="sort != null">#{sort},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
</trim>
</insert>
<update id="updateGoodsCategory" parameterType="GoodsCategory">
update goods_category
<trim prefix="SET" suffixOverrides=",">
<if test="parentId != null">parent_id =
#{parentId},
</if>
<if test="goodsCategoryName != null">goods_category_name =
#{goodsCategoryName},
</if>
<if test="goodsCategoryCode != null">goods_category_code =
#{goodsCategoryCode},
</if>
<if test="goodsCategoryPicture != null">goods_category_picture =
#{goodsCategoryPicture},
</if>
<if test="categoryRemark != null">category_remark =
#{categoryRemark},
</if>
<if test="categoryLevel != null">category_level =
#{categoryLevel},
</if>
<if test="sort != null">sort =
#{sort},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteGoodsCategoryById" parameterType="Long">
delete
from goods_category
where id = #{id}
</delete>
<delete id="deleteGoodsCategoryByIds" parameterType="String">
delete from goods_category where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<select id="selectCategoryPictureByIds" resultType="string">
select goods_category_picture
from goods_category where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="selectCategoryByIds" resultType="com.xinyilu.base.domain.goodsCategory.GoodsCategory">
SELECT
id,
parent_id,
goods_category_name,
goods_category_picture,
category_level
FROM
goods_category
WHERE
id IN
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
UNION ALL
SELECT
id,
parent_id,
goods_category_name,
goods_category_picture,
category_level
FROM
goods_category
WHERE
parent_id IN
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="selectParentIdById" resultType="com.xinyilu.base.vo.goodsCategory.ParentCategory">
select gc.id,
gc.parent_id,
gc.goods_category_name,
gc.goods_category_code,
gc.goods_category_picture,
gc.category_remark,
gc.category_level,
gc.sort,
(select goods_category_name from goods_category where id = gc.parent_id) parentName
from goods_category gc
where gc.id = #{id}
</select>
<select id="getGoodsCategoryNameCount" resultType="java.lang.Integer">
SELECT count(1)
FROM goods_category
WHERE goods_category_name = #{goodsCategoryName}
<if test="id != null">
and id &lt;&gt; #{id}
</if>
</select>
</mapper>

View File

@ -0,0 +1,183 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xinelu.manage.mapper.informationcategory.InformationCategoryMapper">
<resultMap type="InformationCategory" id="InformationCategoryResult">
<result property="id" column="id"/>
<result property="informationCategoryCode" column="information_category_code"/>
<result property="informationCategoryName" column="information_category_name"/>
<result property="informationCategoryType" column="information_category_type"/>
<result property="sort" column="sort"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectInformationCategoryVo">
select id,
information_category_code,
information_category_name,
information_category_type,
sort,
create_by,
create_time,
update_by,
update_time
from information_category
</sql>
<select id="selectInformationCategoryList" parameterType="InformationCategory"
resultMap="InformationCategoryResult">
<include refid="selectInformationCategoryVo"/>
<where>
<if test="informationCategoryCode != null and informationCategoryCode != ''">
and information_category_code = #{informationCategoryCode}
</if>
<if test="informationCategoryName != null and informationCategoryName != ''">
and information_category_name like concat('%', #{informationCategoryName}, '%')
</if>
<if test="informationCategoryType != null and informationCategoryType != ''">
and information_category_type = #{informationCategoryType}
</if>
<if test="sort != null ">
and sort = #{sort}
</if>
</where>
ORDER BY sort asc,id DESC
</select>
<select id="selectInformationCategoryById" parameterType="Long"
resultMap="InformationCategoryResult">
<include refid="selectInformationCategoryVo"/>
where id = #{id}
</select>
<insert id="insertInformationCategory" parameterType="InformationCategory" useGeneratedKeys="true"
keyProperty="id">
insert into information_category
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="informationCategoryCode != null">information_category_code,
</if>
<if test="informationCategoryName != null">information_category_name,
</if>
<if test="informationCategoryType != null">information_category_type,
</if>
<if test="sort != null">sort,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="informationCategoryCode != null">#{informationCategoryCode},
</if>
<if test="informationCategoryName != null">#{informationCategoryName},
</if>
<if test="informationCategoryType != null">#{informationCategoryType},
</if>
<if test="sort != null">#{sort},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
</trim>
</insert>
<update id="updateInformationCategory" parameterType="InformationCategory">
update information_category
<trim prefix="SET" suffixOverrides=",">
<if test="informationCategoryCode != null">information_category_code =
#{informationCategoryCode},
</if>
<if test="informationCategoryName != null">information_category_name =
#{informationCategoryName},
</if>
<if test="informationCategoryType != null">information_category_type =
#{informationCategoryType},
</if>
<if test="sort != null">sort =
#{sort},
</if>
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deleteInformationCategoryById" parameterType="Long">
delete
from information_category
where id = #{id}
</delete>
<delete id="deleteInformationCategoryByIds" parameterType="String">
delete from information_category where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="insertInformationCategoryList">
insert into information_category(
information_category_code,
information_category_name,
information_category_type,
sort,
create_by,
create_time
)values
<foreach item="informationCategoryList" index="index" collection="list" separator=",">
(
#{informationCategoryList.informationCategoryCode},
#{informationCategoryList.informationCategoryName},
#{informationCategoryList.informationCategoryType},
#{informationCategoryList.sort},
#{informationCategoryList.createBy},
#{informationCategoryList.createTime}
)
</foreach>
</insert>
<select id="selectInformationCategoryName" resultType="java.lang.String">
select information_category_name from information_category where information_category_name in
<foreach item="categoryNameList" collection="list" open="(" separator="," close=")">
#{categoryNameList}
</foreach>
</select>
<select id="selectInformationCategoryCount" resultType="int">
SELECT
count( 1 )
FROM
information_category
<where>
<if test="informationCategoryName != null and informationCategoryName != ''">
and information_category_name = #{informationCategoryName}
</if>
</where>
</select>
</mapper>

View File

@ -0,0 +1,534 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.xinelu.manage.mapper.poserInfo.PoserInfoMapper">
<resultMap type="PoserInfo" id="PoserInfoResult">
<result property="id" column="id"/>
<result property="nurseStationId" column="nurse_station_id"/>
<result property="nurseItemId" column="nurse_item_id"/>
<result property="poserName" column="poser_name"/>
<result property="poserCode" column="poser_code"/>
<result property="posterIntroduce" column="poster_introduce"/>
<result property="posterPictureUrl" column="poster_picture_url"/>
<result property="posterVideoUrl" column="poster_video_url"/>
<result property="moduleType" column="module_type"/>
<result property="poserSort" column="poser_sort"/>
<result property="jumpLink" column="jump_link"/>
<result property="jumpType" column="jump_type"/>
<result property="jumpDictId" column="jump_dict_id"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
<result property="updateTime" column="update_time"/>
</resultMap>
<sql id="selectPoserInfoVo">
select id,
nurse_station_id,
nurse_item_id,
poser_name,
poser_code,
poster_introduce,
poster_picture_url,
poster_video_url,
module_type,
poser_sort,
jump_link,
jump_type,
jump_dict_id,
create_by,
create_time,
update_by,
update_time
from poser_info
</sql>
<select id="selectPoserInfoList" parameterType="com.xinelu.manage.vo.poserInfo.PoserInfoVO"
resultType="com.xinelu.manage.vo.poserInfo.PoserInfoVO">
SELECT
ns.nurse_station_name,
nsi.nurse_item_name,
pi.id,
pi.nurse_station_id,
pi.nurse_item_id,
pi.poser_name,
pi.poser_code,
pi.poster_introduce,
pi.poster_picture_url,
pi.poster_video_url,
pi.module_type,
pi.poser_sort,
pi.jump_link,
pi.jump_type,
pi.jump_dict_id,
pi.create_by,
pi.create_time,
pi.update_by,
pi.update_time
FROM
poser_info pi
LEFT JOIN nurse_station ns ON pi.nurse_station_id = ns.id
LEFT JOIN nurse_station_item nsi ON pi.nurse_item_id = nsi.id
<where>
<if test="nurseStationId != null ">
and pi.nurse_station_id = #{nurseStationId}
</if>
<if test="nurseItemId != null ">
and pi.nurse_item_id = #{nurseItemId}
</if>
<if test="poserName != null and poserName != ''">
and pi.poser_name like concat('%', #{poserName}, '%')
</if>
<if test="poserCode != null and poserCode != ''">
and pi.poser_code = #{poserCode}
</if>
<if test="posterIntroduce != null and posterIntroduce != ''">
and pi.poster_introduce = #{posterIntroduce}
</if>
<if test="posterPictureUrl != null and posterPictureUrl != ''">
and pi.poster_picture_url = #{posterPictureUrl}
</if>
<if test="posterVideoUrl != null and posterVideoUrl != ''">
and pi.poster_video_url = #{posterVideoUrl}
</if>
<if test="moduleType != null and moduleType != ''">
and pi.module_type = #{moduleType}
</if>
<if test="poserSort != null ">
and pi.poser_sort = #{poserSort}
</if>
<if test="jumpLink != null and jumpLink != ''">
and pi.jump_link = #{jumpLink}
</if>
<if test="jumpType != null and jumpType != ''">
and pi.jump_type = #{jumpType}
</if>
</where>
GROUP BY pi.nurse_station_id, pi.nurse_item_id, pi.module_type
ORDER BY pi.id DESC
</select>
<select id="getPoserInfoList" parameterType="com.xinelu.manage.vo.poserInfo.PoserInfoVO"
resultType="com.xinelu.manage.vo.poserInfo.PoserInfoVO">
SELECT
ns.nurse_station_name,
nsi.nurse_item_name,
pi.id,
pi.nurse_station_id,
pi.nurse_item_id,
pi.poser_name,
pi.poser_code,
pi.poster_introduce,
pi.poster_picture_url,
pi.poster_video_url,
pi.module_type,
pi.poser_sort,
pi.jump_link,
pi.jump_dict_id,
pi.create_by,
pi.create_time,
pi.update_by,
pi.update_time,
(select dict_value from sys_dict_data where dict_code = pi.jump_dict_id) jump_type
FROM
poser_info pi
LEFT JOIN nurse_station ns ON pi.nurse_station_id = ns.id
LEFT JOIN nurse_station_item nsi ON pi.nurse_item_id = nsi.id
<where>
<if test="nurseStationId != null ">
and pi.nurse_station_id = #{nurseStationId}
</if>
<if test="nurseItemId != null ">
and pi.nurse_item_id = #{nurseItemId}
</if>
<if test="poserName != null and poserName != ''">
and pi.poser_name like concat('%', #{poserName}, '%')
</if>
<if test="poserCode != null and poserCode != ''">
and pi.poser_code = #{poserCode}
</if>
<if test="posterIntroduce != null and posterIntroduce != ''">
and pi.poster_introduce = #{posterIntroduce}
</if>
<if test="posterPictureUrl != null and posterPictureUrl != ''">
and pi.poster_picture_url = #{posterPictureUrl}
</if>
<if test="posterVideoUrl != null and posterVideoUrl != ''">
and pi.poster_video_url = #{posterVideoUrl}
</if>
<if test="moduleType != null and moduleType != ''">
and pi.module_type = #{moduleType}
</if>
<if test="poserSort != null ">
and pi.poser_sort = #{poserSort}
</if>
<if test="jumpLink != null and jumpLink != ''">
and pi.jump_link = #{jumpLink}
</if>
<if test="jumpType != null and jumpType != ''">
and pi.jump_type = #{jumpType}
</if>
</where>
</select>
<select id="selectPoserInfoById" parameterType="Long"
resultType="com.xinelu.manage.vo.poserInfo.PoserInfoVO">
SELECT ns.nurse_station_name,
nsi.nurse_item_name,
pi.id,
pi.nurse_station_id,
pi.nurse_item_id,
pi.poser_name,
pi.poser_code,
pi.poster_introduce,
pi.poster_picture_url,
pi.poster_video_url,
pi.module_type,
pi.poser_sort,
pi.jump_link,
pi.jump_type,
pi.jump_dict_id,
pi.create_by,
pi.create_time,
pi.update_by,
pi.update_time
FROM poser_info pi
LEFT JOIN nurse_station ns ON pi.nurse_station_id = ns.id
LEFT JOIN nurse_station_item nsi ON pi.nurse_item_id = nsi.id
where pi.id = #{id}
</select>
<insert id="insertPoserInfo" parameterType="com.xinelu.manage.dto.poserInfo.PoserInfoDTO" useGeneratedKeys="true"
keyProperty="id">
insert into poser_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="nurseStationId != null">nurse_station_id,
</if>
<if test="nurseItemId != null">nurse_item_id,
</if>
<if test="poserName != null">poser_name,
</if>
<if test="poserCode != null">poser_code,
</if>
<if test="posterIntroduce != null">poster_introduce,
</if>
<if test="posterPictureUrl != null">poster_picture_url,
</if>
<if test="posterVideoUrl != null">poster_video_url,
</if>
<if test="moduleType != null">module_type,
</if>
<if test="poserSort != null">poser_sort,
</if>
<if test="jumpLink != null">jump_link,
</if>
<if test="jumpType != null">jump_type,
</if>
<if test="jumpDictId != null">jump_dict_id,
</if>
<if test="createBy != null">create_by,
</if>
<if test="createTime != null">create_time,
</if>
<if test="updateBy != null">update_by,
</if>
<if test="updateTime != null">update_time,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="nurseStationId != null">#{nurseStationId},
</if>
<if test="nurseItemId != null">#{nurseItemId},
</if>
<if test="poserName != null">#{poserName},
</if>
<if test="poserCode != null">#{poserCode},
</if>
<if test="posterIntroduce != null">#{posterIntroduce},
</if>
<if test="posterPictureUrl != null">#{posterPictureUrl},
</if>
<if test="posterVideoUrl != null">#{posterVideoUrl},
</if>
<if test="moduleType != null">#{moduleType},
</if>
<if test="poserSort != null">#{poserSort},
</if>
<if test="jumpLink != null">#{jumpLink},
</if>
<if test="jumpType != null">#{jumpType},
</if>
<if test="jumpDictId != null">#{jumpDictId},
</if>
<if test="createBy != null">#{createBy},
</if>
<if test="createTime != null">#{createTime},
</if>
<if test="updateBy != null">#{updateBy},
</if>
<if test="updateTime != null">#{updateTime},
</if>
</trim>
</insert>
<update id="updatePoserInfo" parameterType="com.xinelu.manage.dto.poserInfo.PoserInfoDTO">
update poser_info
<trim prefix="SET" suffixOverrides=",">
<if test="nurseStationId != null">nurse_station_id =
#{nurseStationId},
</if>
<if test="nurseItemId != null">nurse_item_id =
#{nurseItemId},
</if>
<if test="poserName != null">poser_name =
#{poserName},
</if>
<if test="poserCode != null">poser_code =
#{poserCode},
</if>
<if test="posterIntroduce != null">poster_introduce =
#{posterIntroduce},
</if>
<if test="posterPictureUrl != null">poster_picture_url =
#{posterPictureUrl},
</if>
<if test="posterVideoUrl != null">poster_video_url =
#{posterVideoUrl},
</if>
<if test="moduleType != null">module_type =
#{moduleType},
</if>
<if test="poserSort != null">poser_sort =
#{poserSort},
</if>
jump_link = #{jumpLink},
<if test="jumpType != null">jump_type =
#{jumpType},
</if>
jump_dict_id = #{jumpDictId},
<if test="createBy != null">create_by =
#{createBy},
</if>
<if test="createTime != null">create_time =
#{createTime},
</if>
<if test="updateBy != null">update_by =
#{updateBy},
</if>
<if test="updateTime != null">update_time =
#{updateTime},
</if>
</trim>
where id = #{id}
</update>
<delete id="deletePoserInfoById" parameterType="Long">
delete
from poser_info
where id = #{id}
</delete>
<delete id="deletePoserInfoByIds" parameterType="String">
delete from poser_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<delete id="deletePoserInfoByModuleType" parameterType="String">
delete from poser_info where module_type in
<foreach item="moduleType" collection="array" open="(" separator="," close=")">
#{moduleType}
</foreach>
</delete>
<insert id="insertPoserInfoList">
insert into poser_info(
nurse_station_id,
nurse_item_id,
poser_name,
poser_code,
poster_introduce,
poster_picture_url,
poster_video_url,
module_type,
poser_sort,
jump_link,
jump_type,
jump_dict_id,
create_by,
create_time,
update_by,
update_time
) values
<foreach item="insertPoserInfoList" index="index" collection="list" separator=",">
(
#{insertPoserInfoList.nurseStationId},
#{insertPoserInfoList.nurseItemId},
#{insertPoserInfoList.poserName},
#{insertPoserInfoList.poserCode},
#{insertPoserInfoList.posterIntroduce},
#{insertPoserInfoList.posterPictureUrl},
#{insertPoserInfoList.posterVideoUrl},
#{insertPoserInfoList.moduleType},
#{insertPoserInfoList.poserSort},
#{insertPoserInfoList.jumpLink},
#{insertPoserInfoList.jumpType},
#{insertPoserInfoList.jumpDictId},
#{insertPoserInfoList.createBy},
#{insertPoserInfoList.createTime},
#{insertPoserInfoList.updateBy},
#{insertPoserInfoList.updateTime}
)
</foreach>
</insert>
<select id="selectPoserInfoByModuleType" parameterType="com.xinelu.manage.vo.poserInfo.PoserInfoVO"
resultType="com.xinelu.manage.vo.poserInfo.PoserInfoVO">
SELECT ns.nurse_station_name,
nsi.nurse_item_name,
pi.id,
pi.nurse_station_id,
pi.nurse_item_id,
pi.poser_name,
pi.poser_code,
pi.poster_introduce,
pi.poster_picture_url,
pi.poster_video_url,
pi.module_type,
pi.poser_sort,
pi.jump_link,
pi.jump_type,
pi.jump_dict_id,
pi.create_by,
pi.create_time,
pi.update_by,
pi.update_time
FROM poser_info pi
LEFT JOIN nurse_station ns ON pi.nurse_station_id = ns.id
LEFT JOIN nurse_station_item nsi ON pi.nurse_item_id = nsi.id
<where>
<if test="moduleType != null and moduleType != ''">
and pi.module_type = #{moduleType}
</if>
</where>
GROUP BY pi.module_type
</select>
<select id="selectPoserInfoByModuleTypeList" parameterType="com.xinelu.manage.vo.poserInfo.PoserInfoVO"
resultType="com.xinelu.manage.vo.poserInfo.PoserInfoVO">
SELECT ns.nurse_station_name,
nsi.nurse_item_name,
pi.id,
pi.nurse_station_id,
pi.nurse_item_id,
pi.poser_name,
pi.poser_code,
pi.poster_introduce,
IFNULL(pi.poster_picture_url, '') poster_picture_url,
IFNULL(pi.poster_video_url, '') poster_video_url,
pi.module_type,
pi.poser_sort,
pi.jump_link,
pi.jump_type,
pi.jump_dict_id,
pi.create_by,
pi.create_time,
pi.update_by,
pi.update_time
FROM poser_info pi
LEFT JOIN nurse_station ns ON pi.nurse_station_id = ns.id
LEFT JOIN nurse_station_item nsi ON pi.nurse_item_id = nsi.id
<where>
<if test="moduleType != null and moduleType != ''">
and pi.module_type = #{moduleType}
</if>
<if test="nurseStationId != null ">
and pi.nurse_station_id = #{nurseStationId}
</if>
<if test="nurseItemId != null ">
and pi.nurse_item_id = #{nurseItemId}
</if>
</where>
</select>
<select id="getPoserInfoByModuleTypeAndId" resultType="int">
select count(1) from poser_info
<where>
<if test="moduleType != null and moduleType != ''">
and module_type = #{moduleType}
</if>
<if test="stationId != null">
and nurse_station_id = #{stationId}
</if>
<if test="itemId != null">
and nurse_item_id = #{itemId}
</if>
</where>
</select>
<select id="selectPoserList" parameterType="PoserInfo" resultMap="PoserInfoResult">
<include refid="selectPoserInfoVo"/>
<where>
<if test="nurseStationId != null ">
and nurse_station_id = #{nurseStationId}
</if>
<if test="nurseItemId != null ">
and nurse_item_id = #{nurseItemId}
</if>
<if test="poserName != null and poserName != ''">
and poser_name like concat('%', #{poserName}, '%')
</if>
<if test="poserCode != null and poserCode != ''">
and poser_code = #{poserCode}
</if>
<if test="posterIntroduce != null and posterIntroduce != ''">
and poster_introduce = #{posterIntroduce}
</if>
<if test="posterPictureUrl != null and posterPictureUrl != ''">
and poster_picture_url = #{posterPictureUrl}
</if>
<if test="posterVideoUrl != null and posterVideoUrl != ''">
and poster_video_url = #{posterVideoUrl}
</if>
<if test="moduleType != null and moduleType != ''">
and module_type = #{moduleType}
</if>
<if test="poserSort != null ">
and poser_sort = #{poserSort}
</if>
<if test="jumpLink != null and jumpLink != ''">
and jump_link = #{jumpLink}
</if>
<if test="jumpType != null and jumpType != ''">
and jump_type = #{jumpType}
</if>
</where>
</select>
<select id="selectPoserListByModuleTyp" resultType="com.xinelu.manage.domain.poserInfo.PoserInfo">
<include refid="selectPoserInfoVo"/>
<where>
<if test="moduleType != null and moduleType != ''">
and module_type = #{moduleType}
</if>
</where>
</select>
<select id="selectPosterImageJump" parameterType="String" resultType="SysDictData">
SELECT sdd.dict_code,
sdd.dict_label,
sdd.dict_value,
sdd.dict_type
FROM
sys_dict_data sdd
<where>
<if test="dictType != null and dictType != ''">
AND sdd.dict_type = #{dictType}
</if>
</where>
</select>
</mapper>