提交 dd48989f 作者: zhenjie

解决冲突

......@@ -5,3 +5,4 @@ metadata:
namespace: default
data:
SPRING_PROFILES_ACTIVE: default
SW_AGENT_COLLECTOR_BACKEND_SERVICES: "default-oap:11800"
......@@ -14,6 +14,7 @@ spec:
metadata:
labels:
app: pms
swck-java-agent-injected: 'true'
spec:
containers:
- name: pms
......@@ -33,6 +34,11 @@ spec:
configMapKeyRef:
name: pms-map
key: SPRING_PROFILES_ACTIVE
- name: SW_AGENT_COLLECTOR_BACKEND_SERVICES
valueFrom:
configMapKeyRef:
name: pms-map
key: SW_AGENT_COLLECTOR_BACKEND_SERVICES
volumes:
- name: log-of-app
hostPath:
......
......@@ -18,4 +18,4 @@ patches:
images:
- name: REGISTRY/NAMESPACE/IMAGE:TAG
newName: mmc-registry.cn-shenzhen.cr.aliyuncs.com/sharefly-dev/pms
newTag: 4f4b315dae822973a98907e615f45940937f4d1d
newTag: a867fba96ec08a2bc2dc53d1ed1fb8c77e6fc287
package com.mmc.pms.constant;
public interface DateConstant {
String YYYYMMDDHHMMSS = "yyyy-MM-dd HH:mm:ss";
}
......@@ -8,7 +8,7 @@ import com.mmc.pms.model.qo.ServiceQO;
import com.mmc.pms.model.work.dto.ServiceDTO;
import com.mmc.pms.model.work.dto.WorkServiceDTO;
import com.mmc.pms.model.work.vo.ServiceVO;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.model.work.vo.UpAndDownServiceVO;
import com.mmc.pms.service.BackstageTaskService;
import io.swagger.annotations.*;
import org.springframework.validation.annotation.Validated;
......@@ -46,11 +46,18 @@ public class BackstageTaskServiceController extends BaseController {
return backstageTaskService.updateById(param);
}
@ApiOperation(value = "删除作业服务")
@ApiOperation(value = "批量删除作业服务")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@GetMapping("deleteWorkService")
public ResultBody deleteWorkService(@ApiParam("作业服务id") @RequestParam(value = "id") Integer id) {
return backstageTaskService.deleteById(id);
@PostMapping("deleteWorkService")
public ResultBody deleteWorkService(@ApiParam("作业服务id") @RequestBody List<Integer> ids) {
return backstageTaskService.deleteByIds(ids);
}
@ApiOperation(value = "批量上下架作业服务")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = ResultBody.class)})
@PostMapping("batchUpAndDownWorkService")
public ResultBody batchUpAndDownWorkService(@RequestBody UpAndDownServiceVO param) {
return backstageTaskService.batchUpAndDownWorkService(param);
}
@ApiOperation(value = "查询作业服务")
......
package com.mmc.pms.controller;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.entity.Categories;
import com.mmc.pms.model.categories.dto.CategoriesDTO;
import com.mmc.pms.model.group.Create;
import com.mmc.pms.model.qo.ServiceQO;
import com.mmc.pms.model.work.dto.ServiceDTO;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.CategoriesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.CollectionUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.stream.Collectors;
/**
* <p>
* 前端控制器
* </p>
*
* @author Pika
* @since 2023-06-08
*/
@Api(tags = {"后台-目录管理-接口"})
@RestController
@RequestMapping("/directory")
public class DirectoryController {
private final String DIRECTORY_NAME_APPLICATION = "应用";
private final String DIRECTORY_NAME_INDUSTRY = "行业";
@Autowired
private CategoriesService categoriesService;
@ApiOperation(value = "获取应用类型列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CategoriesDTO.class)})
@PostMapping("getApplicationList")
public ResultBody<CategoriesDTO> getApplicationList() {
return categoriesService.getApplicationList(DIRECTORY_NAME_APPLICATION);
}
@ApiOperation(value = "获取对应行业列表")
@ApiResponses({@ApiResponse(code = 200, message = "OK", response = CategoriesDTO.class)})
@PostMapping("getIndustryList")
public ResultBody<CategoriesDTO> getIndustryList() {
return categoriesService.getApplicationList(DIRECTORY_NAME_INDUSTRY);
}
}
package com.mmc.pms.dao;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.entity.ServiceDO;
import com.mmc.pms.model.qo.ServiceQO;
import com.mmc.pms.model.work.dto.ServiceDTO;
import com.mmc.pms.model.work.vo.UpAndDownServiceVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......@@ -19,7 +21,7 @@ public interface BackstageTaskServiceDao {
Integer update(ServiceDO serviceDO);
Integer deleteById(Integer id);
Integer deleteByIds(@Param("ids") List<Integer> ids);
ServiceDO queryById(Integer id);
......@@ -32,4 +34,6 @@ public interface BackstageTaskServiceDao {
List<ServiceDO> queryPageByLimit(@Param("param") ServiceQO param,@Param("categoriesIds") List<Integer> categoriesIds, @Param("userIds") List<Integer> userIds);
List<ServiceDTO> QueryWorkServiceListById(@Param("ids") List<Integer> ids);
Integer batchUpAndDownWorkService(@Param("param") UpAndDownServiceVO param);
}
......@@ -112,4 +112,6 @@ public interface GoodsInfoDao {
int countGoodsInfoByCategoryId(Integer id);
void updateMallProdSkuInfo(MallProdInfoDO mallProdInfoDO);
List<MallProdInfoDO> getAllMallProSkuInfo(Integer goodsInfoId);
}
......@@ -34,7 +34,7 @@ public class ServiceVO implements Serializable {
@ApiModelProperty(value = "服务名称", example = "服务名称")
@NotBlank(
message = "服务名称不能为空",
groups = {Create.class, Update.class})
groups = {Create.class})
@Length(message = "最大不超过30字", max = 30)
private String serviceName;
......@@ -44,19 +44,19 @@ public class ServiceVO implements Serializable {
@ApiModelProperty(value = "行业", example = "2")
@NotNull(
message = "行业id不能为空",
groups = {Create.class, Update.class})
groups = {Create.class})
private Integer industryId;
@ApiModelProperty(value = "展示状态,0为上架,1下架", example = "0")
@NotNull(
message = "展示状态不能为空",
groups = {Create.class, Update.class})
groups = {Create.class})
private Integer displayState;
@ApiModelProperty(value = "封面图")
@NotBlank(
message = "封面图不能为空",
groups = {Create.class, Update.class})
groups = {Create.class})
private String coverPlan;
@ApiModelProperty(value = "分享卡片")
......
package com.mmc.pms.model.work.vo;
import com.mmc.pms.model.group.Update;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.List;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UpAndDownServiceVO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id集合")
@Size(min = 1,message = "修改时id集合不能为空",groups = Update.class)
private List<Integer> ids;
@ApiModelProperty(value = "展示状态,0为上架,1下架", example = "0")
@NotNull(message = "修改时展示状态不能为空",groups = Update.class)
private Integer displayState;
}
......@@ -4,6 +4,7 @@ import com.mmc.pms.common.ResultBody;
import com.mmc.pms.model.qo.ServiceQO;
import com.mmc.pms.model.work.dto.ServiceDTO;
import com.mmc.pms.model.work.vo.ServiceVO;
import com.mmc.pms.model.work.vo.UpAndDownServiceVO;
import com.mmc.pms.page.PageResult;
import javax.servlet.http.HttpServletRequest;
......@@ -19,7 +20,7 @@ public interface BackstageTaskService {
ResultBody updateById(ServiceVO param);
ResultBody deleteById(Integer id);
ResultBody deleteByIds(List<Integer> ids);
ResultBody<ServiceDTO> queryById(Integer id);
......@@ -28,4 +29,6 @@ public interface BackstageTaskService {
PageResult queryWorkServiceList(ServiceQO param, HttpServletRequest request);
List<ServiceDTO> feignQueryWorkServiceListById(List<Integer> ids);
ResultBody batchUpAndDownWorkService(UpAndDownServiceVO param);
}
......@@ -3,6 +3,7 @@ package com.mmc.pms.service.Impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.mmc.pms.common.ResultBody;
import com.mmc.pms.constant.DateConstant;
import com.mmc.pms.dao.BackstageTaskServiceDao;
import com.mmc.pms.dao.CategoriesDao;
import com.mmc.pms.entity.Categories;
......@@ -13,10 +14,12 @@ import com.mmc.pms.model.qo.ServiceQO;
import com.mmc.pms.model.work.dto.ServiceDTO;
import com.mmc.pms.model.work.dto.WorkServiceDTO;
import com.mmc.pms.model.work.vo.ServiceVO;
import com.mmc.pms.model.work.vo.UpAndDownServiceVO;
import com.mmc.pms.page.PageResult;
import com.mmc.pms.service.BackstageTaskService;
import com.mmc.pms.service.InspComtService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.lang3.RandomUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -63,8 +66,10 @@ public class BackstageTaskServiceImpl implements BackstageTaskService {
}
@Override
public ResultBody deleteById(Integer id) {
backstageTaskServiceDao.deleteById(id);
public ResultBody deleteByIds(List<Integer> ids) {
if(!CollectionUtils.isEmpty(ids)){
backstageTaskServiceDao.deleteByIds(ids);
}
return ResultBody.success();
}
......@@ -137,6 +142,9 @@ public class BackstageTaskServiceImpl implements BackstageTaskService {
@Override
public PageResult queryWorkServiceList(ServiceQO param, HttpServletRequest request) {
log.info(
"开始queryWorkServiceList==>{}",
JSONObject.toJSONString(DateFormatUtils.format(new Date(), DateConstant.YYYYMMDDHHMMSS)));
Integer pageNo = param.getPageNo();
param.buildCurrentPage();
List<Integer> userIds = null;
......@@ -155,6 +163,9 @@ public class BackstageTaskServiceImpl implements BackstageTaskService {
List<ServiceDO> pageList = backstageTaskServiceDao.queryPageByLimit(param,categoriesIds,userIds);
List<WorkServiceDTO> workServiceDTOList = getWorkServiceDTOS(pageList);
log.info(
"结束queryWorkServiceList==>{}",
JSONObject.toJSONString(DateFormatUtils.format(new Date(), DateConstant.YYYYMMDDHHMMSS)));
return PageResult.buildPage(pageNo, param.getPageSize(), count, workServiceDTOList);
}
......@@ -163,6 +174,14 @@ public class BackstageTaskServiceImpl implements BackstageTaskService {
return backstageTaskServiceDao.QueryWorkServiceListById(ids);
}
@Override
public ResultBody batchUpAndDownWorkService(UpAndDownServiceVO param) {
if(!CollectionUtils.isEmpty(param.getIds())){
backstageTaskServiceDao.batchUpAndDownWorkService(param);
}
return ResultBody.success();
}
private List<WorkServiceDTO> getWorkServiceDTOS(List<ServiceDO> pageList) {
// 用户暂时无关联公司数据,先用假数据展示
String companyName = "浙江科比特创新科技有限公司";
......@@ -170,9 +189,6 @@ public class BackstageTaskServiceImpl implements BackstageTaskService {
for (ServiceDO item : pageList) {
WorkServiceDTO workServiceDTO = WorkServiceDTO.builder().id(item.getId()).serviceName(item.getServiceName()).companyName(companyName)
.coverPlan(item.getCoverPlan()).serviceIntroduction(item.getServiceIntroduction()).video(item.getVideo()).shareCard(item.getShareCard()).build();
List<InspComtDO> inspComtList = RandomGetInspComt(item.getId());
workServiceDTO.setInspComtList(inspComtList);
workServiceDTO.setInspComtAmount(inspComtList.size());
workServiceDTOList.add(workServiceDTO);
}
return workServiceDTOList;
......
......@@ -718,7 +718,7 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
private List<GoodsSpecDTO> getProductSpecInfo(
Integer goodsInfoId, Integer type, Integer leaseTerm) {
// 获取商品对应绑定sku的信息
List<MallProdInfoDO> mallProdSkuInfoList = goodsInfoDao.getMallProSkuInfo(goodsInfoId);
List<MallProdInfoDO> mallProdSkuInfoList = goodsInfoDao.getAllMallProSkuInfo(goodsInfoId);
List<GoodsSpecDTO> list =
mallProdSkuInfoList.stream()
.map(MallProdInfoDO::buildGoodsSpecDTO)
......
......@@ -186,10 +186,10 @@ public class WebDeviceServiceImpl implements WebDeviceService {
}
int pageNo = param.getPageNo();
param.buildCurrentPage();
if (StringUtils.isBlank(request.getHeader(TokenConstant.TOKEN))) {
List<GoodsInfo> list = webDeviceDao.listWareInfoPage(param, userIds, param.getType());
List<LeaseGoodsInfoDTO> pageList =
list.stream().map(GoodsInfo::buildLeaseGoodsInfoDTO).collect(Collectors.toList());
if (StringUtils.isBlank(request.getHeader(TokenConstant.TOKEN))) {
return ResultBody.success(PageResult.buildPage(pageNo, param.getPageSize(), count, pageList));
}
......@@ -198,9 +198,6 @@ public class WebDeviceServiceImpl implements WebDeviceService {
if (userAccountSimpleDTO == null) {
return ResultBody.error(ResultEnum.INTERNAL_SERVER_ERROR);
}
List<GoodsInfo> list = webDeviceDao.listWareInfoPage(param, userIds, param.getType());
List<LeaseGoodsInfoDTO> pageList =
list.stream().map(GoodsInfo::buildLeaseGoodsInfoDTO).collect(Collectors.toList());
if (userAccountSimpleDTO.getCooperationTagId() == null) {
return ResultBody.success(PageResult.buildPage(pageNo, param.getPageSize(), count, pageList));
}
......
......@@ -172,11 +172,12 @@
select id, `name`, icon,directory_id
from categories
<where>
is_deleted = 0
is_deleted = 0 and parent_id = 0
<foreach collection="list" separator="," open="and directory_id in(" close=")" index="index" item="d">
#{d}
</foreach>
</where>
order by sort asc
</select>
<select id="getCategoriesByDirectoryId" resultType="com.mmc.pms.entity.Categories"
......
......@@ -136,11 +136,11 @@
</foreach>
</update>
<update id="batchUpdateMallProdSpec">
<foreach collection="list" item="d" separator=";" index="index">
update mall_prod_info_spec
set is_deleted = 1
where id = #{d}
and is_deleted = 0
where is_deleted = 0
<foreach collection="list" item="d" separator="," index="index" open="and id in (" close=")">
#{d}
</foreach>
</update>
<update id="batchDownWare">
......@@ -226,6 +226,7 @@
INNER JOIN product ps ON ps.id = mi.product_id
WHERE mi.goods_info_id = #{id}
AND mi.is_deleted = 0
and flag = 0
</select>
<select id="getMallIndustrySkuInfo" resultType="com.mmc.pms.entity.MallIndustrySkuInfoDO">
SELECT mi.id,
......@@ -491,6 +492,7 @@
INNER JOIN product_spec ps ON mp.product_spec_id = ps.id
WHERE mp.goods_info_id = #{id}
AND mp.is_deleted = 0
ORDER BY mp.create_time asc
</select>
<select id="listMallprodSpecById" resultType="com.mmc.pms.entity.MallProdSkuInfoSpecDO">
SELECT
......@@ -574,7 +576,7 @@
</if>
</where>
ORDER BY
gi.shelf_status DESC , gi.create_time DESC
gi.shelf_status DESC , gi.create_time asc
limit #{pageNo},#{pageSize}
</select>
......@@ -596,4 +598,27 @@
OR gi.category_by_two = #{id})
AND gi.is_deleted = 0
</select>
<select id="getAllMallProSkuInfo" resultType="com.mmc.pms.entity.MallProdInfoDO">
SELECT mi.id,
mi.goods_info_id,
mi.product_id prodSkuId,
mi.prod_spec_name prodSkuSpecName,
mi.categories_id categoriesId,
mi.choose_type chooseType,
mi.sku_unit_id skuUnitId,
mi.is_must must,
mi.flag flag,
mi.create_time createTime,
c.name typeName,
su.id skuUnitId,
su.unit_name unitName,
ps.product_name productSkuName
FROM mall_prod_info mi
INNER JOIN categories c ON c.id = mi.categories_id
INNER JOIN sku_unit su ON mi.sku_unit_id = su.id
INNER JOIN product ps ON ps.id = mi.product_id
WHERE mi.goods_info_id = #{id}
AND mi.is_deleted = 0
ORDER BY mi.create_time asc
</select>
</mapper>
......@@ -5,8 +5,8 @@
<mapper namespace="com.mmc.pms.dao.ProductDao">
<insert id="insertProductSku" parameterType="com.mmc.pms.entity.ProductSkuDO"
useGeneratedKeys="true" keyProperty="id">
insert into product (product_name, categories_id, model, brand_info_id, directory_id)
values (#{productName}, #{categoriesId}, #{model}, #{brandInfoId}, #{directoryId})
insert into product (product_name, categories_id, model, brand_info_id, directory_id, customize)
values (#{productName}, #{categoriesId}, #{model}, #{brandInfoId}, #{directoryId}, #{customize})
</insert>
<insert id="insertProductSpec" keyProperty="id" useGeneratedKeys="true"
parameterType="com.mmc.pms.entity.ProductSpecDO">
......
......@@ -194,7 +194,7 @@
</foreach>
</if>
</where>
order by gi.create_time DESC
order by gi.create_time asc
limit #{param.pageNo},#{param.pageSize}
</select>
<select id="getWareInfoById" resultMap="wareInfoResultMap" parameterType="java.lang.Integer">
......
......@@ -153,17 +153,20 @@
</update>
<!--通过主键删除-->
<update id="deleteById" parameterType="java.lang.Integer">
<update id="deleteByIds" parameterType="java.lang.Integer">
update service
set is_deleted = 1
where id = #{id}
where
<foreach collection="ids" open="id in (" close=")" item="item" separator=",">
#{item}
</foreach>
</update>
<select id="conditionCount" resultType="java.lang.Integer">
select count(*)
from service
<where>
is_deleted = 0 and display_state = 0
is_deleted = 0
<if test="categoriesIds != null">
<foreach collection="categoriesIds" item="item" open="and (application_id in (" close=")" separator=",">
#{item}
......@@ -188,6 +191,9 @@
<if test="param.applicationId!=null">
and application_id = #{param.applicationId}
</if>
<if test="param.displayState != null">
and display_state = #{param.displayState}
</if>
</where>
</select>
......@@ -197,7 +203,7 @@
service_introduction, create_time, update_time, account_id
from service
<where>
is_deleted = 0 and display_state = 0
is_deleted = 0
<if test="categoriesIds != null">
<foreach collection="categoriesIds" item="item" open="and (application_id in (" close=")" separator=",">
#{item}
......@@ -222,6 +228,9 @@
<if test="param.applicationId!=null">
and application_id = #{param.applicationId}
</if>
<if test="param.displayState != null">
and display_state = #{param.displayState}
</if>
</where>
order by create_time desc
limit #{param.pageNo}, #{param.pageSize}
......@@ -248,4 +257,13 @@
</foreach>
</if>
</select>
<select id="batchUpAndDownWorkService" resultType="java.lang.Integer">
update service
set display_state = #{param.displayState}
where
<foreach collection="param.ids" open="id in (" close=")" item="item" separator=",">
#{item}
</foreach>
</select>
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论