市场活动增加子表

This commit is contained in:
rbw 2024-11-14 16:20:03 +08:00
parent 1e1b8a0c42
commit b1c91bb7b0
4 changed files with 203 additions and 96 deletions

View File

@ -12,11 +12,16 @@ import com.yb.lb.webapp.archives.distributor.service.DistributorService;
import com.yb.lb.webapp.archives.marketingArea.service.MarketingAreaService; import com.yb.lb.webapp.archives.marketingArea.service.MarketingAreaService;
import com.yb.lb.webapp.random.service.RandomService; import com.yb.lb.webapp.random.service.RandomService;
import com.yb.lb.webapp.redis.service.RedisService; import com.yb.lb.webapp.redis.service.RedisService;
import com.yb.lb.webapp.stock.entity.CrmInventoryDetail;
import com.yb.lb.webapp.stock.entity.CrmInventoryInfo;
import com.yb.lb.webapp.system.authority.service.AccessService; import com.yb.lb.webapp.system.authority.service.AccessService;
import com.yb.lb.webapp.system.logger.utils.BusinessType; import com.yb.lb.webapp.system.logger.utils.BusinessType;
import com.yb.lb.webapp.system.logger.utils.Log; import com.yb.lb.webapp.system.logger.utils.Log;
import com.yb.lb.webapp.system.logger.utils.OperatorType; import com.yb.lb.webapp.system.logger.utils.OperatorType;
import com.yb.lb.webapp.utils.RoleDateUtils; import com.yb.lb.webapp.utils.RoleDateUtils;
import com.yb.lb.webapp.view.view.entity.CrmMarketingDetail;
import com.yb.lb.webapp.view.view.entity.ViewMeeting;
import com.yb.lb.webapp.view.view.entity.ViewMeetingDTO;
import com.yb.lb.webapp.view.view.sevice.ViewMeetingService; import com.yb.lb.webapp.view.view.sevice.ViewMeetingService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
@ -24,16 +29,10 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Calendar; import java.util.*;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/** /**
* @author TanChao * @author TanChao
@ -69,20 +68,21 @@ public class ViewMeetingApi extends BaseController {
@ApiOperation("提交") @ApiOperation("提交")
@Log(title = "App市场活动", businessType = BusinessType.INSERT, operatorType = OperatorType.MOBILE) @Log(title = "App市场活动", businessType = BusinessType.INSERT, operatorType = OperatorType.MOBILE)
public Map<String, Object> add( public Map<String, Object> add(
@ApiParam(required = false, value = "活动形式编号(数据字典)") @RequestParam(required = false) String typeId, // @ApiParam(required = false, value = "活动形式编号(数据字典)") @RequestParam(required = false) String typeId,
@ApiParam(required = false, value = "活动内容") @RequestParam(required = false) String activityContent, // @ApiParam(required = false, value = "活动内容") @RequestParam(required = false) String activityContent,
@ApiParam(required = false, value = "活动日期") @RequestParam(required = false) String activityDate, // @ApiParam(required = false, value = "活动日期") @RequestParam(required = false) String activityDate,
@ApiParam(required = false, value = "客户id") @RequestParam(required = true) String dealersId, // @ApiParam(required = false, value = "客户id") @RequestParam(required = true) String dealersId,
@ApiParam(required = false, value = "客户名称") @RequestParam(required = false) String distributorName, // @ApiParam(required = false, value = "客户名称") @RequestParam(required = false) String distributorName,
@ApiParam(required = false, value = "传客户的行政区域编码") @RequestParam(required = false) String region, // @ApiParam(required = false, value = "传客户的行政区域编码") @RequestParam(required = false) String region,
@ApiParam(required = false, value = "客户类型") @RequestParam(required = false) String clientType, // @ApiParam(required = false, value = "客户类型") @RequestParam(required = false) String clientType,
@ApiParam(required = false, value = "人员规模") @RequestParam(required = false) String staffSize, // @ApiParam(required = false, value = "人员规模") @RequestParam(required = false) String staffSize,
@ApiParam(required = false, value = "地点") @RequestParam(required = false) String site, // @ApiParam(required = false, value = "地点") @RequestParam(required = false) String site,
@ApiParam(required = false, value = "经度") @RequestParam(required = false) String longitude, // @ApiParam(required = false, value = "经度") @RequestParam(required = false) String longitude,
@ApiParam(required = false, value = "纬度") @RequestParam(required = false) String latitude, // @ApiParam(required = false, value = "纬度") @RequestParam(required = false) String latitude,
@ApiParam(required = false, value = "活动照片") @RequestParam(required = false) String activityImg, // @ApiParam(required = false, value = "活动照片") @RequestParam(required = false) String activityImg,
@ApiParam(required = false, value = "活动视频") @RequestParam(required = false) String videos, // @ApiParam(required = false, value = "活动视频") @RequestParam(required = false) String videos,
@ApiParam(required = false, value = "备注") @RequestParam(required = false) String remark, // @ApiParam(required = false, value = "备注") @RequestParam(required = false) String remark,
@RequestBody ViewMeetingDTO viewMeetingDTO,
HttpServletRequest request) { HttpServletRequest request) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
Map params = new HashMap(); Map params = new HashMap();
@ -90,21 +90,34 @@ public class ViewMeetingApi extends BaseController {
if (!redisService.exists(token)) { if (!redisService.exists(token)) {
return AjaxResult.error(ErrorUtils.IS_NOT_LOGIN_ERROR, "用户未登录"); return AjaxResult.error(ErrorUtils.IS_NOT_LOGIN_ERROR, "用户未登录");
} }
Map tokenMap = redisService.hmget(token); ViewMeeting info = viewMeetingDTO.getViewMeeting();
params = ParameterUtils.reqMapSeria(request.getParameterMap()); Map<String, String> tokenMap = redisService.hmget(token);
params.put("id", IdUtil.simpleUUID());
params.put("createTime", DateUtil.getTime()); info.setId(IdUtil.simpleUUID());
params.put("companyId", tokenMap.get("companyId") + ""); info.setCreateTime(DateUtil.getTime());
params.put("createUser", tokenMap.get("id") + ""); info.setCompanyId(tokenMap.get("companyId") + "");
params.put("staffId", tokenMap.get("archivesId") + ""); info.setCreateUser(tokenMap.get("id") + "");
params.put("staffName", tokenMap.get("realName") + ""); info.setStaffId(tokenMap.get("archivesId") + "");
params.put("semId", tokenMap.get("areaId") + ""); info.setStaffName(tokenMap.get("realName") + "");
params.put("ancestors", tokenMap.get("ancestors") + ""); info.setSemId(tokenMap.get("areaId") + "");
info.setAncestors(tokenMap.get("ancestors") + "");
info.setViewNo(randomService.randomUtils1(FINALCMD.VIEW_NO, tokenMap.get("companyId") + ""));
info.setStatus("4");
// params = ParameterUtils.reqMapSeria(request.getParameterMap());
// params.put("id", IdUtil.simpleUUID());
// params.put("createTime", DateUtil.getTime());
// params.put("companyId", tokenMap.get("companyId") + "");
// params.put("createUser", tokenMap.get("id") + "");
// params.put("staffId", tokenMap.get("archivesId") + "");
// params.put("staffName", tokenMap.get("realName") + "");
// params.put("semId", tokenMap.get("areaId") + "");
// params.put("ancestors", tokenMap.get("ancestors") + "");
// 编码 // 编码
params.put("viewNo", randomService.randomUtils1(FINALCMD.VIEW_NO, tokenMap.get("companyId") + "")); // params.put("viewNo", randomService.randomUtils1(FINALCMD.VIEW_NO, tokenMap.get("companyId") + ""));
// 状态:0待审核1审核通过2审核未通过3.审核中4.自由态 // 状态:0待审核1审核通过2审核未通过3.审核中4.自由态
params.put("status", "4"); // params.put("status", "4");
return toAjax(viewMeetingService.addView(params, ".addView")); return toAjax(viewMeetingService.addView(viewMeetingDTO, ".addView"));
} }
/** /**
@ -116,34 +129,40 @@ public class ViewMeetingApi extends BaseController {
@ApiOperation("修改") @ApiOperation("修改")
@Log(title = "App市场活动", businessType = BusinessType.UPDATE, operatorType = OperatorType.MOBILE) @Log(title = "App市场活动", businessType = BusinessType.UPDATE, operatorType = OperatorType.MOBILE)
public Map<String, Object> update( public Map<String, Object> update(
@ApiParam(required = true, value = "活动Id ") @RequestParam(required = true) String id, // @ApiParam(required = true, value = "活动Id ") @RequestParam(required = true) String id,
@ApiParam(required = false, value = "活动形式编号(数据字典)") @RequestParam(required = false) String typeId, // @ApiParam(required = false, value = "活动形式编号(数据字典)") @RequestParam(required = false) String typeId,
@ApiParam(required = false, value = "活动内容") @RequestParam(required = false) String activityContent, // @ApiParam(required = false, value = "活动内容") @RequestParam(required = false) String activityContent,
@ApiParam(required = false, value = "活动日期") @RequestParam(required = false) String activityDate, // @ApiParam(required = false, value = "活动日期") @RequestParam(required = false) String activityDate,
@ApiParam(required = false, value = "客户id") @RequestParam(required = true) String dealersId, // @ApiParam(required = false, value = "客户id") @RequestParam(required = true) String dealersId,
@ApiParam(required = false, value = "客户名称") @RequestParam(required = false) String distributorName, // @ApiParam(required = false, value = "客户名称") @RequestParam(required = false) String distributorName,
@ApiParam(required = false, value = "传客户的行政区域编码") @RequestParam(required = false) String region, // @ApiParam(required = false, value = "传客户的行政区域编码") @RequestParam(required = false) String region,
@ApiParam(required = false, value = "客户类型") @RequestParam(required = false) String clientType, // @ApiParam(required = false, value = "客户类型") @RequestParam(required = false) String clientType,
@ApiParam(required = false, value = "人员规模") @RequestParam(required = false) String staffSize, // @ApiParam(required = false, value = "人员规模") @RequestParam(required = false) String staffSize,
@ApiParam(required = false, value = "地点") @RequestParam(required = false) String site, // @ApiParam(required = false, value = "地点") @RequestParam(required = false) String site,
@ApiParam(required = false, value = "经度") @RequestParam(required = false) String longitude, // @ApiParam(required = false, value = "经度") @RequestParam(required = false) String longitude,
@ApiParam(required = false, value = "纬度") @RequestParam(required = false) String latitude, // @ApiParam(required = false, value = "纬度") @RequestParam(required = false) String latitude,
@ApiParam(required = false, value = "活动照片") @RequestParam(required = false) String activityImg, // @ApiParam(required = false, value = "活动照片") @RequestParam(required = false) String activityImg,
@ApiParam(required = false, value = "活动视频") @RequestParam(required = false) String videos, // @ApiParam(required = false, value = "活动视频") @RequestParam(required = false) String videos,
@ApiParam(required = false, value = "备注") @RequestParam(required = false) String remark, // @ApiParam(required = false, value = "备注") @RequestParam(required = false) String remark,
@RequestBody ViewMeetingDTO viewMeetingDTO,
HttpServletRequest request) { HttpServletRequest request) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
String token = request.getHeader("token"); String token = request.getHeader("token");
if (!redisService.exists(token)) { if (!redisService.exists(token)) {
return AjaxResult.error(ErrorUtils.IS_NOT_LOGIN_ERROR, "用户未登录"); return AjaxResult.error(ErrorUtils.IS_NOT_LOGIN_ERROR, "用户未登录");
} }
Map<String, String> params = ParameterUtils.reqMapSeria(request.getParameterMap()); ViewMeeting info = viewMeetingDTO.getViewMeeting();
Map tokenMap = redisService.hmget(token); Map<String, String> tokenMap = redisService.hmget(token);
params.put("staffId", tokenMap.get("archivesId") + ""); info.setStaffId(tokenMap.get("archivesId") + "");
params.put("staffName", tokenMap.get("realName") + ""); info.setStaffName(tokenMap.get("realName") + "");
params.put("semId", tokenMap.get("areaId") + ""); info.setSemId(tokenMap.get("areaId") + "");
params.put("ancestors", tokenMap.get("ancestors") + ""); info.setAncestors(tokenMap.get("ancestors") + "");
return toAjax(viewMeetingService.updateView(params, ".updateView")); // Map<String, String> params = ParameterUtils.reqMapSeria(request.getParameterMap());
// params.put("staffId", tokenMap.get("archivesId") + "");
// params.put("staffName", tokenMap.get("realName") + "");
// params.put("semId", tokenMap.get("areaId") + "");
// params.put("ancestors", tokenMap.get("ancestors") + "");
return toAjax(viewMeetingService.updateView(viewMeetingDTO, ".updateView"));
} }
/** /**
@ -219,6 +238,28 @@ public class ViewMeetingApi extends BaseController {
return AjaxResult.success(viewMeetingService.oneView(params, ".pageList")); return AjaxResult.success(viewMeetingService.oneView(params, ".pageList"));
} }
/**
* 查询市场活动-产品列表
*
* @author mzr
* @date 2024/11/13
*/
@ResponseBody
@PatchMapping(value = "/listDetail")
@ApiOperation(value = "查询市场活动-产品列表")
public Map<String, Object> listDetail(
@ApiParam(required = true, value = "市场活动id") @RequestParam(required = true) String viewId,
HttpServletRequest request) {
Map<String, Object> params = new HashMap<>();
Map<String, Object> result = new HashMap<>();
String token = request.getHeader("token");
if (!redisService.exists(token)) {
return AjaxResult.error(ErrorUtils.IS_NOT_LOGIN_ERROR, "用户未登录");
}
params.put("viewId", viewId);
return AjaxResult.success(viewMeetingService.listDetail(params, ".findCrmMarketingDetailByCondition"));
}
/** /**
* @description: 市场活动数据统计 * @description: 市场活动数据统计
* @author: mzr * @author: mzr

View File

@ -5,28 +5,30 @@
<mapper namespace="com.yb.lb.webapp.view.view.entity.CrmMarketingDetail"> <mapper namespace="com.yb.lb.webapp.view.view.entity.CrmMarketingDetail">
<!-- 字段映射 --> <!-- 字段映射 -->
<resultMap id="crmMarketingDetailMap" type="com.yb.lb.webapp.view.view.entity.CrmMarketingDetail"> <resultMap id="crmMarketingDetailMap" type="com.yb.lb.webapp.view.view.entity.CrmMarketingDetail">
<id column="id" property="id" jdbcType="VARCHAR" /> <id column="id" property="id" jdbcType="VARCHAR"/>
<result column="view_id" property="viewId" jdbcType="VARCHAR" /> <result column="view_id" property="viewId" jdbcType="VARCHAR"/>
<result column="goods_id" property="goodsId" jdbcType="VARCHAR" /> <result column="goods_id" property="goodsId" jdbcType="VARCHAR"/>
<result column="goods_no" property="goodsNo" jdbcType="VARCHAR" /> <result column="goods_no" property="goodsNo" jdbcType="VARCHAR"/>
<result column="goods_name" property="goodsName" jdbcType="VARCHAR" /> <result column="goods_name" property="goodsName" jdbcType="VARCHAR"/>
<result column="spec" property="spec" jdbcType="VARCHAR" /> <result column="spec" property="spec" jdbcType="VARCHAR"/>
<result column="create_time" property="createTime" jdbcType="VARCHAR" /> <result column="create_time" property="createTime" jdbcType="VARCHAR"/>
<result column="earnest" property="earnest" jdbcType="VARCHAR" /> <result column="earnest" property="earnest" jdbcType="VARCHAR"/>
<result column="goods_num" property="goodsNum" jdbcType="VARCHAR" /> <result column="goods_num" property="goodsNum" jdbcType="VARCHAR"/>
<result column="reserve_acre" property="reserveAcre" jdbcType="VARCHAR" /> <result column="reserve_acre" property="reserveAcre" jdbcType="VARCHAR"/>
<result column="product_type_name" property="productTypeName" jdbcType="VARCHAR"/>
<result column="product_type_code" property="productTypeCode" jdbcType="VARCHAR"/>
</resultMap> </resultMap>
<!-- 表查询字段 --> <!-- 表查询字段 -->
<sql id="allColumns"> <sql id="allColumns">
a.id, a.view_id, a.goods_id, a.goods_no, a.goods_name, a.spec, a.create_time, a.earnest, a.id, a.view_id, a.goods_id, a.goods_no, a.goods_name, a.spec, a.create_time, a.earnest,
a.goods_num, a.reserve_acre a.goods_num, a.reserve_acre, a.product_type_name, a.product_type_code
</sql> </sql>
<!-- 根据条件参数查询数据列表 --> <!-- 根据条件参数查询数据列表 -->
<select id="findCrmMarketingDetailByCondition" resultMap="crmMarketingDetailMap" parameterType="map"> <select id="findCrmMarketingDetailByCondition" resultMap="crmMarketingDetailMap" parameterType="map">
SELECT SELECT
<include refid="allColumns" /> <include refid="allColumns"/>
FROM crm_marketing_detail a WHERE 1 = 1 FROM crm_marketing_detail a WHERE 1 = 1
<if test="viewId != null and viewId != ''"> <if test="viewId != null and viewId != ''">
AND a.view_id = #{viewId} AND a.view_id = #{viewId}
@ -41,12 +43,12 @@
AND a.goods_name LIKE '%' || #{goodsName} || '%' AND a.goods_name LIKE '%' || #{goodsName} || '%'
</if> </if>
</select> </select>
<!-- 插入数据 --> <!-- 插入数据 -->
<insert id="insertCrmMarketingDetail" parameterType="map"> <insert id="insertCrmMarketingDetail" parameterType="map">
INSERT INTO crm_marketing_detail ( INSERT INTO crm_marketing_detail (
id, view_id, goods_id, goods_no, goods_name, spec, create_time, earnest, id, view_id, goods_id, goods_no, goods_name, spec, create_time, earnest,
goods_num, reserve_acre goods_num, reserve_acre, product_type_name, product_type_code
) VALUES ( ) VALUES (
#{id,jdbcType=VARCHAR}, #{id,jdbcType=VARCHAR},
#{viewId,jdbcType=VARCHAR}, #{viewId,jdbcType=VARCHAR},
@ -57,32 +59,36 @@
#{createTime,jdbcType=VARCHAR}, #{createTime,jdbcType=VARCHAR},
#{earnest,jdbcType=VARCHAR}, #{earnest,jdbcType=VARCHAR},
#{goodsNum,jdbcType=VARCHAR}, #{goodsNum,jdbcType=VARCHAR},
#{reserveAcre,jdbcType=VARCHAR} #{reserveAcre,jdbcType=VARCHAR},
#{productTypeName,jdbcType=VARCHAR},
#{productTypeCode,jdbcType=VARCHAR}
) )
</insert> </insert>
<!-- 批量插入数据 --> <!-- 批量插入数据 -->
<insert id="insertCrmMarketingDetails" parameterType="list"> <insert id="insertCrmMarketingDetails" parameterType="list">
INSERT INTO crm_marketing_detail ( INSERT INTO crm_marketing_detail (
id, view_id, goods_id, goods_no, goods_name, spec, create_time, earnest, id, view_id, goods_id, goods_no, goods_name, spec, create_time, earnest,
goods_num, reserve_acre goods_num, reserve_acre,product_type_name,product_type_code
) )
<foreach collection="list" index="index" item="item" separator="UNION ALL"> <foreach collection="list" index="index" item="item" separator="UNION ALL">
SELECT SELECT
#{item.id,jdbcType=VARCHAR}, #{item.id,jdbcType=VARCHAR},
#{item.viewId,jdbcType=VARCHAR}, #{item.viewId,jdbcType=VARCHAR},
#{item.goodsId,jdbcType=VARCHAR}, #{item.goodsId,jdbcType=VARCHAR},
#{item.goodsNo,jdbcType=VARCHAR}, #{item.goodsNo,jdbcType=VARCHAR},
#{item.goodsName,jdbcType=VARCHAR}, #{item.goodsName,jdbcType=VARCHAR},
#{item.spec,jdbcType=VARCHAR}, #{item.spec,jdbcType=VARCHAR},
#{item.createTime,jdbcType=VARCHAR}, #{item.createTime,jdbcType=VARCHAR},
#{item.earnest,jdbcType=VARCHAR}, #{item.earnest,jdbcType=VARCHAR},
#{item.goodsNum,jdbcType=VARCHAR}, #{item.goodsNum,jdbcType=VARCHAR},
#{item.reserveAcre,jdbcType=VARCHAR} #{item.reserveAcre,jdbcType=VARCHAR}
#{item.productTypeName,jdbcType=VARCHAR},
#{item.productTypeCode,jdbcType=VARCHAR}
FROM DUAL FROM DUAL
</foreach> </foreach>
</insert> </insert>
<!-- 修改数据 --> <!-- 修改数据 -->
<update id="updateCrmMarketingDetail" parameterType="map"> <update id="updateCrmMarketingDetail" parameterType="map">
UPDATE crm_marketing_detail UPDATE crm_marketing_detail
@ -114,15 +120,21 @@
<if test="reserveAcre != null"> <if test="reserveAcre != null">
reserve_acre = #{reserveAcre,jdbcType=VARCHAR} reserve_acre = #{reserveAcre,jdbcType=VARCHAR}
</if> </if>
<if test="productTypeName != null">
product_type_name = #{productTypeName,jdbcType=VARCHAR}
</if>
<if test="productTypeCode != null">
product_type_code = #{productTypeCode,jdbcType=VARCHAR}
</if>
</set> </set>
WHERE id = #{id} WHERE id = #{id}//
</update> </update>
<!-- 根据主键删除数据 --> <!-- 根据主键删除数据 -->
<delete id="deleteCrmMarketingDetailById" parameterType="string"> <delete id="deleteCrmMarketingDetailById" parameterType="string">
DELETE FROM crm_marketing_detail WHERE id = #{id} DELETE FROM crm_marketing_detail WHERE view_id = #{viewId}
</delete> </delete>
<!-- 根据主键批量删除数据 --> <!-- 根据主键批量删除数据 -->
<delete id="deleteCrmMarketingDetailByIds" parameterType="list"> <delete id="deleteCrmMarketingDetailByIds" parameterType="list">
DELETE FROM crm_marketing_detail WHERE id IN DELETE FROM crm_marketing_detail WHERE id IN

View File

@ -1,5 +1,6 @@
package com.yb.lb.webapp.view.view.entity; package com.yb.lb.webapp.view.view.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
/** /**
@ -14,33 +15,51 @@ public class CrmMarketingDetail implements java.io.Serializable {
private static final long serialVersionUID = -423516422284485951L; private static final long serialVersionUID = -423516422284485951L;
/** 主键Id */ /** 主键Id */
@ApiModelProperty(hidden = true)
private String id; private String id;
/** 主键Id(市场活动) */ /** 主键Id(市场活动) */
@ApiModelProperty(value = "主键Id(市场活动)")
private String viewId; private String viewId;
/** 商品id */ /** 商品id */
@ApiModelProperty(value = "商品id")
private String goodsId; private String goodsId;
/** 商品编码 */ /** 商品编码 */
@ApiModelProperty(value = "商品编码")
private String goodsNo; private String goodsNo;
/** 商品名称 */ /** 商品名称 */
@ApiModelProperty(value = "商品名称")
private String goodsName; private String goodsName;
/** 规格 */ /** 规格 */
@ApiModelProperty(value = "规格")
private String spec; private String spec;
/** 制单时间 */ /** 制单时间 */
@ApiModelProperty(hidden = true)
private String createTime; private String createTime;
/** 亩定金(元) */ /** 亩定金(元) */
@ApiModelProperty(value = "亩定金(元)")
private String earnest; private String earnest;
/** 件数 */ /** 件数 */
@ApiModelProperty(value = "件数")
private String goodsNum; private String goodsNum;
/** 预定亩数 */ /** 预定亩数 */
@ApiModelProperty(value = "预定亩数")
private String reserveAcre; private String reserveAcre;
/** 产品类型名称 */
@ApiModelProperty(value = "产品类型名称")
private String productTypeName;
/** 产品类型编码 */
@ApiModelProperty(value = "产品类型编码")
private String productTypeCode;
} }

View File

@ -1,14 +1,20 @@
package com.yb.lb.webapp.view.view.sevice; package com.yb.lb.webapp.view.view.sevice;
import cn.hutool.core.util.IdUtil;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.yb.lb.common.base.oracle.BaseOracleDao; import com.yb.lb.common.base.oracle.BaseOracleDao;
import com.yb.lb.common.utils.DateUtil;
import com.yb.lb.common.utils.FINALCMD;
import com.yb.lb.common.utils.MapObjUtil; import com.yb.lb.common.utils.MapObjUtil;
import com.yb.lb.common.utils.StringUtil; import com.yb.lb.common.utils.StringUtil;
import com.yb.lb.webapp.archives.dictionary.entity.Dictionaryies; import com.yb.lb.webapp.archives.dictionary.entity.Dictionaryies;
import com.yb.lb.webapp.archives.dictionary.service.DictionaryiesService; import com.yb.lb.webapp.archives.dictionary.service.DictionaryiesService;
import com.yb.lb.webapp.redis.service.RedisService; import com.yb.lb.webapp.redis.service.RedisService;
import com.yb.lb.webapp.stock.entity.CrmInventoryDetail;
import com.yb.lb.webapp.stock.entity.CrmInventoryInfo;
import com.yb.lb.webapp.view.view.entity.CrmMarketingDetail; import com.yb.lb.webapp.view.view.entity.CrmMarketingDetail;
import com.yb.lb.webapp.view.view.entity.ViewMeeting; import com.yb.lb.webapp.view.view.entity.ViewMeeting;
import com.yb.lb.webapp.view.view.entity.ViewMeetingDTO;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -32,16 +38,45 @@ public class ViewMeetingService {
* @description: 新增市场活动 * @description: 新增市场活动
* @date: 20210331 * @date: 20210331
*/ */
public boolean addView(Map<String, String> params, String id) { public boolean addView(ViewMeetingDTO viewMeetingDTO, String id) {
return dao.add_obj(ViewMeeting.class.getName() + id, params); ViewMeeting info = viewMeetingDTO.getViewMeeting();
if (dao.add_obj(ViewMeeting.class.getName() + id, info)) {
List<CrmMarketingDetail> infoDetails = viewMeetingDTO.getDetails();
if (infoDetails != null && infoDetails.size() > 0) {
for (CrmMarketingDetail marketDetail : infoDetails) {
marketDetail.setId(IdUtil.simpleUUID());
marketDetail.setViewId(info.getId());
marketDetail.setCreateTime(info.getCreateTime());
}
detailDao.add_obj(CrmMarketingDetail.class.getName() + ".insertCrmMarketingDetails", infoDetails);
}
return true;
}
return false;
} }
/** /**
* @description: 市场活动修改 * @description: 市场活动修改
* @date: 20210331 * @date: 20210331
*/ */
public boolean updateView(Map<String, String> params, String id) { public boolean updateView(ViewMeetingDTO viewMeetingDTO, String id) {
return dao.update(ViewMeeting.class.getName() + id, params); ViewMeeting info = viewMeetingDTO.getViewMeeting();
if (dao.update(ViewMeeting.class.getName() + id, info)) {
List<CrmMarketingDetail> infoDetails = viewMeetingDTO.getDetails();
if (infoDetails != null && infoDetails.size() > 0) {
String viewId = info.getId();
if (detailDao.delete(CrmMarketingDetail.class.getName() + ".deleteCrmMarketingDetailById", viewId)) {
for (CrmMarketingDetail marketDetail : infoDetails) {
marketDetail.setId(IdUtil.simpleUUID());
marketDetail.setViewId(info.getId());
marketDetail.setCreateTime(info.getCreateTime());
}
detailDao.add_obj(CrmMarketingDetail.class.getName() + ".insertCrmMarketingDetails", infoDetails);
}
}
return true;
}
return false;
} }
/** /**