添加零件信息-分页列表查询接口
This commit is contained in:
+22
-1
@@ -1,5 +1,6 @@
|
||||
package com.jero.modules.laws.part.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
@@ -10,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -27,7 +29,7 @@ public class LawsPartInfoController {
|
||||
private ILawsPartInfoService lawsPartInfoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
* 列表查询
|
||||
*
|
||||
* @param lawsPartInfo
|
||||
* @return
|
||||
@@ -40,4 +42,23 @@ public class LawsPartInfoController {
|
||||
List<LawsPartInfo> list = lawsPartInfoService.queryList(lawsPartInfo, req);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param lawsPartInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "业务支持-零件信息-分页列表查询")
|
||||
@ApiOperation(value = "业务支持-零件信息-分页列表查询", notes = "业务支持-零件信息-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
@ApiOperationSupport(order = 1)
|
||||
public Result<IPage<LawsPartInfo>> queryList(LawsPartInfo lawsPartInfo,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<LawsPartInfo> list = lawsPartInfoService.queryPage(lawsPartInfo, pageNo, pageSize, req);
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.jero.modules.laws.part.job;
|
||||
|
||||
import com.jero.modules.laws.part.service.ILawsPartInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.quartz.Job;
|
||||
import org.quartz.JobExecutionContext;
|
||||
import org.quartz.JobExecutionException;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 同步零件数据
|
||||
*/
|
||||
@Slf4j
|
||||
public class SyncPartPmmInfoPartDiffJob implements Job {
|
||||
|
||||
@Resource
|
||||
private ILawsPartInfoService lawsPartInfoService;
|
||||
|
||||
@Override
|
||||
public void execute(JobExecutionContext context) throws JobExecutionException {
|
||||
lawsPartInfoService.truncatePartPmmInfoPartDiff();
|
||||
lawsPartInfoService.syncPartPmmInfoPartDiff();
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,11 @@ import com.jero.modules.laws.part.entity.LawsPartInfo;
|
||||
|
||||
public interface LawsPartInfoMapper extends BaseMapper<LawsPartInfo> {
|
||||
|
||||
void truncatePartPmmInfoPartDiff();
|
||||
|
||||
void syncPartPmmInfoPartDiff();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
+9
@@ -4,4 +4,13 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.laws.part.mapper.LawsPartInfoMapper">
|
||||
|
||||
<delete id="truncatePartPmmInfoPartDiff">
|
||||
TRUNCATE TABLE ods_qr_cgbom_pmm_info_part_diff_df;
|
||||
</delete>
|
||||
|
||||
<insert id="syncPartPmmInfoPartDiff">
|
||||
insert into laws_part_pmm_partition_info(reg_part_name_cn,fnd_gpc)
|
||||
(SELECT regpartnamecn as reg_part_name_cn,CONCAT(fna,upc) as fnd_gpc FROM `ods_qr_cgbom_pmm_partition_info_df` where fna is not null and upc is not null
|
||||
and regpartnamecn is not null and regpartnamecn != '-' and regpartnamecn != '/' group by CONCAT(fna,upc))
|
||||
</insert>
|
||||
</mapper>
|
||||
|
||||
+8
@@ -1,7 +1,9 @@
|
||||
package com.jero.modules.laws.part.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.laws.part.entity.LawsPartInfo;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
@@ -9,4 +11,10 @@ import java.util.List;
|
||||
public interface ILawsPartInfoService extends IService<LawsPartInfo> {
|
||||
|
||||
List<LawsPartInfo> queryList(LawsPartInfo lawsPartInfo, HttpServletRequest req);
|
||||
|
||||
IPage<LawsPartInfo> queryPage(LawsPartInfo lawsPartInfo,Integer pageNo, Integer pageSize,HttpServletRequest req);
|
||||
|
||||
void truncatePartPmmInfoPartDiff();
|
||||
|
||||
void syncPartPmmInfoPartDiff();
|
||||
}
|
||||
|
||||
+24
@@ -1,6 +1,8 @@
|
||||
package com.jero.modules.laws.part.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.laws.part.entity.LawsPartInfo;
|
||||
@@ -9,6 +11,7 @@ import com.jero.modules.laws.part.service.ILawsPartInfoService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
@@ -18,12 +21,33 @@ import java.util.List;
|
||||
public class LawsPartInfoServiceImpl extends ServiceImpl<LawsPartInfoMapper, LawsPartInfo>
|
||||
implements ILawsPartInfoService {
|
||||
|
||||
@Resource
|
||||
private LawsPartInfoMapper lawsPartInfoMapper;
|
||||
|
||||
@Override
|
||||
public List<LawsPartInfo> queryList(LawsPartInfo lawsPartInfo, HttpServletRequest req) {
|
||||
QueryWrapper<LawsPartInfo> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(lawsPartInfo, req.getParameterMap());
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<LawsPartInfo> queryPage(LawsPartInfo lawsPartInfo, Integer pageNo, Integer pageSize, HttpServletRequest req) {
|
||||
QueryWrapper<LawsPartInfo> queryWrapper =
|
||||
QueryGenerator.initQueryWrapper(lawsPartInfo, req.getParameterMap());
|
||||
Page<LawsPartInfo> page = new Page<>(pageNo, pageSize);
|
||||
return page(page, queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void truncatePartPmmInfoPartDiff() {
|
||||
lawsPartInfoMapper.truncatePartPmmInfoPartDiff();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void syncPartPmmInfoPartDiff() {
|
||||
lawsPartInfoMapper.syncPartPmmInfoPartDiff();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user