zq-erp/src/main/java/com/matrix/system/app/action/ApiFollowupAction.java
@@ -1,28 +1,14 @@ package com.matrix.system.app.action; import com.matrix.core.constance.MatrixConstance; import com.matrix.core.exception.GlobleException; import com.matrix.core.pojo.AjaxResult; import com.matrix.core.pojo.PaginationVO; import com.matrix.core.tools.StringUtils; import com.matrix.core.tools.WebUtil; import com.matrix.system.app.dto.*; import com.matrix.system.app.vo.OrderDetailVo; import com.matrix.system.app.vo.ShoppingGoodsDetailVo; import com.matrix.system.app.vo.ShoppingGoodsListVo; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.tools.DataAuthUtil; import com.matrix.system.hive.bean.*; import com.matrix.system.hive.dao.SysFollowupCommentDao; import com.matrix.system.hive.dao.SysFollowupDao; import com.matrix.system.hive.dao.SysVipAlbumDao; import com.matrix.system.hive.dao.SysVipInfoDao; import com.matrix.system.hive.dao.*; import com.matrix.system.hive.plugin.util.CollectionUtils; import com.matrix.system.hive.pojo.ShoppingCarItem; import com.matrix.system.hive.pojo.ShoppingCarItemsVo; import com.matrix.system.hive.service.ShoppingGoodsCategoryService; import com.matrix.system.hive.service.ShoppingGoodsService; import com.matrix.system.hive.service.SysOrderService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; @@ -56,6 +42,14 @@ private SysFollowupCommentDao followupCommentDao; @Autowired private SysOrderItemDao orderItemDao; @Autowired private SysBeauticianStateDao beauticianStateDao; @ApiOperation(value = "新增跟进记录", notes = "新增跟进记录") @ApiResponses({ @ApiResponse(code = 200, message = "ok", response = SysFollowup.class) @@ -68,19 +62,45 @@ followup.setStaffId(user.getSuId()); followup.setCompanyId(user.getCompanyId()); followup.setShopId(user.getShopId()); //处理订单摘要 if(followup.getOrderId()!=null){ List<SysOrderItem> sysOrderItems = orderItemDao.selectByOrderId(followup.getOrderId()); String abs=""; if(sysOrderItems.size()>1){ abs= sysOrderItems.get(0).getShoppingGoods().getName()+"等"+sysOrderItems.size()+"件商品"; }else{ abs= sysOrderItems.get(0).getShoppingGoods().getName(); } followup.setOrderAbstract(abs); } //服务单摘要 if(followup.getServiceId()!=null){ List<SysBeauticianState> sysBeauticianStates = beauticianStateDao.selectBySerIds(followup.getServiceId()); String abs=""; if(sysBeauticianStates.size()>1){ abs= sysBeauticianStates.get(0).getProjInfo().getName()+"等"+sysBeauticianStates.size()+"项服务"; }else{ abs= sysBeauticianStates.get(0).getProjInfo().getName(); } followup.setOrderAbstract(abs); } followupDao.insert(followup); //插入图片 List<SysVipAlbum> albums=followup.getAlbums(); for (SysVipAlbum vipAlbum:albums){ if(StringUtils.isNotBlank(vipAlbum.getImg())){ vipAlbum.setCreateBy(user.getSuName()); vipAlbum.setUpdateBy(user.getSuName()); vipAlbum.setSource(SysVipAlbum.SOURCE_FOLLOW); vipAlbum.setVipId(followup.getVipId()); vipAlbum.setSourceId(followup.getId()); vipAlbumDao.insert(vipAlbum); if(CollectionUtils.isNotEmpty(albums)){ for (SysVipAlbum vipAlbum:albums){ if(StringUtils.isNotBlank(vipAlbum.getImg())){ vipAlbum.setCreateBy(user.getSuName()); vipAlbum.setUpdateBy(user.getSuName()); vipAlbum.setSource(SysVipAlbum.SOURCE_FOLLOW); vipAlbum.setVipId(followup.getVipId()); vipAlbum.setSourceId(followup.getId()); vipAlbumDao.insert(vipAlbum); } } } return AjaxResult.buildSuccessInstance("保存成功"); } @@ -135,13 +155,13 @@ @ApiResponse(code = 200, message = "ok", response = SysFollowup.class) }) @PostMapping(value = "/findFollowup") public AjaxResult findFollowup(@RequestBody @Validated FollowupCommonetListDto followupCommonetListDto) { public AjaxResult findFollowup(@RequestBody @Validated FollowupListDto followupListDto) { SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); followupCommonetListDto.setShopId(user.getShopId()); followupCommonetListDto.setCompanyId(user.getCompanyId()); followupCommonetListDto.setSelfStaff(user.getSuId()); followupListDto.setShopId(user.getShopId()); followupListDto.setCompanyId(user.getCompanyId()); followupListDto.setSelfStaff(user.getSuId()); //TODO 需要设置跨店数据权限 List<SysFollowup> rows= followupDao.selectByAppDto(followupCommonetListDto); List<SysFollowup> rows= followupDao.selectByAppDto(followupListDto); return AjaxResult.buildSuccessInstance(rows,"查询成功"); } zq-erp/src/main/java/com/matrix/system/app/action/ApiServiceOrderAction.java
@@ -137,12 +137,14 @@ throw new GlobleException("请选择服务"); } SysVipInfo vipInfo = sysVipInfoService.findById(serviceOrderDto.getVipId()); if (StringUtils.isBlank(vipInfo.getPassWord())) { return AjaxResult.buildFailInstance("未设置资金密码"); } // if (StringUtils.isBlank(vipInfo.getPassWord())) { // return AjaxResult.buildFailInstance("未设置资金密码"); // } if (!vipInfo.getPassWord().equals(serviceOrderDto.getPassword())) { return AjaxResult.buildFailInstance("资金密码错误"); if (StringUtils.isNotBlank(vipInfo.getPassWord())) { if (!vipInfo.getPassWord().equals(serviceOrderDto.getPassword())) { return AjaxResult.buildFailInstance("资金密码错误"); } } SysProjServices sysProjServices = new SysProjServices(); zq-erp/src/main/java/com/matrix/system/app/action/ApiVipInfoAction.java
@@ -203,4 +203,18 @@ } return AjaxResult.buildSuccessInstance("档案更新成功"); } @ApiOperation(value = "用户是否存在资金密码", notes = "用户是否存在资金密码") @GetMapping(value = "/isExistFundPassword/{vipId}") public AjaxResult isExistFundPassword(@PathVariable(value = "vipId") Long vipId) { SysVipInfo vipInfo = sysVipInfoService.findById(vipId); AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功"); if (StringUtils.isNotBlank(vipInfo.getPassWord())) { ajaxResult.putInMap("isExist", true); } else { ajaxResult.putInMap("isExist", false); } return ajaxResult; } } zq-erp/src/main/java/com/matrix/system/app/dto/CreateServiceOrderDto.java
@@ -39,7 +39,6 @@ @ApiModelProperty(value = "备注") private String remark; @NotBlank(message = "参数错误") @ApiModelProperty(value = "资金密码") private String password; zq-erp/src/main/java/com/matrix/system/app/dto/FollowupListDto.java
File was renamed from zq-erp/src/main/java/com/matrix/system/app/dto/FollowupCommonetListDto.java @@ -15,7 +15,7 @@ * @date 2020-12-23 **/ @ApiModel(value = "FollowupCommonetListDto", description = "跟进记录查询参数") public class FollowupCommonetListDto { public class FollowupListDto { @NotNull(message = "参数错误") @ApiModelProperty(value = "查询条数", example = "10") zq-erp/src/main/java/com/matrix/system/hive/bean/SysFollowup.java
@@ -32,7 +32,6 @@ /** * 员工ID */ @NotNull(message = "员工ID") private Long staffId; @@ -118,6 +117,42 @@ @ApiModelProperty(value = "评论集合",example ="") private List<SysFollowupComment> followupComments; @Extend @ApiModelProperty(value = "员工名称",example ="") private String staffName; @Extend @ApiModelProperty(value = "员工头像",example ="") private String staffPhoto; @Extend @ApiModelProperty(value = "客户名称",example ="") private String vipName; public String getStaffName() { return staffName; } public void setStaffName(String staffName) { this.staffName = staffName; } public String getStaffPhoto() { return staffPhoto; } public void setStaffPhoto(String staffPhoto) { this.staffPhoto = staffPhoto; } public String getVipName() { return vipName; } public void setVipName(String vipName) { this.vipName = vipName; } public List<SysFollowupComment> getFollowupComments() { return followupComments; } zq-erp/src/main/java/com/matrix/system/hive/dao/SysFollowupDao.java
@@ -1,6 +1,6 @@ package com.matrix.system.hive.dao; import com.matrix.system.app.dto.FollowupCommonetListDto; import com.matrix.system.app.dto.FollowupListDto; import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -40,5 +40,5 @@ void updateZan(@Param("id")Long id, @Param("zans")String zans); List<SysFollowup> selectByAppDto(FollowupCommonetListDto followupCommonetListDto); List<SysFollowup> selectByAppDto(FollowupListDto followupListDto); } zq-erp/src/main/resources/mybatis/mapper/hive/SysFollowupDao.xml
@@ -22,6 +22,10 @@ <result property="orderAbstract" column="order_abstract" /> <result property="zans" column="zans" /> <result property="staffPhoto" column="staffPhoto" /> <result property="staffName" column="staffName" /> <result property="vipName" column="vipName" /> <collection property="albums" column="{sourceId=id}" select="com.matrix.system.hive.dao.SysVipAlbumDao.selectBySourceId" /> <collection property="followupComments" column="{follId=id}" select="com.matrix.system.hive.dao.SysFollowupCommentDao.selectByfollId" ></collection> @@ -341,32 +345,38 @@ <select id="selectByAppDto" resultMap="SysFollowupMap"> select * from sys_followup select a.*, b.su_photo as staffPhoto, b.su_name as staffName, c.vip_name as vipName from sys_followup a left join sys_users b on a.staff_id= b.su_id left join sys_vip_info c on a.vip_id=c.id <where> and company_id=#{companyId} and a.company_id=#{companyId} <if test="shopId != null "> and shop_id=#{shopId} and a.shop_id=#{shopId} </if> <if test="queryType == 1 "> and (visible=1 or ( visible!=1 and staff_id=#{selfStaff})) and (visible=1 or ( visible!=1 and a.staff_id=#{selfStaff})) </if> <if test="queryType == 2 "> and staff_id=#{selfStaff} and a.staff_id=#{selfStaff} </if> <if test="queryType == 3 "> and( visible=1 and staff_id!=#{selfStaff}) and( visible=1 and a.staff_id!=#{selfStaff}) </if> <if test="startTime != null "> and create_time <![CDATA[ >= ]]> #{startTime} and a.create_time <![CDATA[ >= ]]> #{startTime} </if> <if test="endTime != null "> and create_time <![CDATA[ <= ]]> #{endTime} and a.create_time <![CDATA[ <= ]]> #{endTime} </if> <if test="vipIds!=null and vipIds.size()!=0"> and vip_id in and a.vip_id in <foreach collection="vipIds" index="index" item="item" open="(" separator="," close=")"> #{item} @@ -374,7 +384,7 @@ </if> <if test="staffIds!=null and staffIds.size()!=0"> and staff_id in and a.staff_id in <foreach collection="staffIds" index="index" item="item" open="(" separator="," close=")"> #{item} zq-xcx/project.config.json
@@ -28,13 +28,15 @@ "disablePlugins": [], "outputPath": "" }, "enableEngineNative": false, "useIsolateContext": true, "useCompilerModule": true, "userConfirmedUseCompilerModuleSwitch": false, "userConfirmedBundleSwitch": false, "packNpmManually": false, "packNpmRelationList": [], "enableEngineNative": false, "minifyWXSS": true "minifyWXSS": true, "bundle": false }, "compileType": "miniprogram", "libVersion": "1.9.98",