Commit 294f3a75 by 李小惠

超期装备写入定时任务

parent 77a476b2
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
package com.junmp.jyzb.Repository;
import com.junmp.jyzb.entity.Supplier;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
public interface SupplierRepository extends ElasticsearchRepository<Supplier, Long> {
}
......@@ -96,4 +96,10 @@ public interface InventorySummaryMapper extends BaseMapper<InventorySummary> {
void useViewOrgIdInLevel(@Param("sql") String sql,@Param("orgId") Long orgId);
List<Long> selectOrgIds(@Param("orgId") Long orgId);
void setWarrantyInventoryAction();
void setDestoryGroupAction();
void setWarrantyGroupAction();
}
\ No newline at end of file
......@@ -48,4 +48,10 @@ public interface InventorySummaryService extends IService<InventorySummary> {
PageResult<InventorySummary> GetEquipmentSummary(InventorySumReq req);
List<InventorySummary> GetEquipmentSummaryDetail(InventorySumReq req);
void setWarrantyInventoryAction();
void setDestoryGroupAction();
void setWarrantyGroupAction();
}
......@@ -16,4 +16,6 @@ public interface PublicService {
List<SimpleDictVo> getAllDictItem();
boolean updateMessage(MessageReq req);
}
......@@ -11,6 +11,9 @@ import com.junmp.v2.db.api.page.PageResult;
import java.util.List;
public interface SupplierService extends IService<Supplier> {
Object addEs();
/**
* 新增
*
......
......@@ -141,6 +141,8 @@ public class EquipmentSizeServiceImpl extends ServiceImpl<EquipmentSizeMapper, E
mqDto.setMessage("Adding sizeInfo");
MQ.sendToExchange(exchangeName,"org",mqDto);
//添加es
sizeRepository.save(size);
return sizeID+"||"+code;
}
......@@ -186,6 +188,8 @@ public class EquipmentSizeServiceImpl extends ServiceImpl<EquipmentSizeMapper, E
mqDto.setMessage("Updating sizeInfo");
MQ.sendToExchange(exchangeName,"org",mqDto);
//添加es
sizeRepository.save(size);
return this.updateById(size);
}
......
......@@ -151,12 +151,14 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
mqDto.setType(2);
mqDto.setMessage("Adding typeInfo");
MQ.sendToExchange(exchangeName,"org",mqDto);
//往es中添加数据
typeRepository.save(type);
return String.valueOf(newcode);
} else {
String msg="以下供应商不存在:" +String.join(",", chekResult);
throw new JYZBAppException(EquipmentExceptionEnum.SUPPLIER_NOT_EXIST, msg);
}
}
......@@ -256,6 +258,8 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
mqDto.setType(2);
mqDto.setMessage("Updating typeInfo");
MQ.sendToExchange(exchangeName,"org",mqDto);
//往es中添加数据
typeRepository.save(type);
return this.updateById(type);
} else {
String msg="以下供应商不存在:" +String.join(",", chekResult);
......
......@@ -176,6 +176,8 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
return inventorySummaryMapper.GetEquipmentSummaryDetail(req);
}
@Override
public List<InventorySummary> getEquipmentInfoList(InventorySumReq req) {
//当没有参数传递的时候默认查询全部,但是如果传递了条件,根据条件查询并且如果是根据id进行查询,则需要判断该id是否存在
......@@ -517,4 +519,24 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
return wrapper;
}
//执行过质保期装备存储过程
@Override
public void setWarrantyInventoryAction() {
inventorySummaryMapper.setWarrantyInventoryAction();
System.out.println("111 = " + 111);
}
//执行过质保期装备存储过程
@Override
public void setDestoryGroupAction() {
inventorySummaryMapper.setDestoryGroupAction();
System.out.println("111 = " + 222);
}
//执行过质保期装备存储过程
@Override
public void setWarrantyGroupAction() {
inventorySummaryMapper.setWarrantyGroupAction();
System.out.println("111 = " + 333);
}
}
......@@ -836,6 +836,8 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
pubOrg.setCreateTime(DateTimeUtil.getCurrentDateTime());
pubOrg.setIsMap("0");
save(pubOrg);
//添加es
pubOrgRepository.save(pubOrg);
return pubOrg.getOrgId();
}
......@@ -848,6 +850,8 @@ public class PubOrgServiceImpl extends ServiceImpl<PubOrgMapper, PubOrg> implem
// }
PubOrg pubOrg = new PubOrg();
BeanPlusUtil.copyProperties(req,pubOrg);
//添加es
pubOrgRepository.save(pubOrg);
return updateById(pubOrg);
}
......
......@@ -5,6 +5,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.junmp.jyzb.Repository.SupplierRepository;
import com.junmp.jyzb.api.bean.dto.FetchingDataDto.SupplierInfoDto;
import com.junmp.jyzb.api.bean.dto.MQDto;
import com.junmp.jyzb.api.bean.dto.SupplierDto;
......@@ -42,6 +43,16 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
@Resource
private SupplierMapper supplierMapper;
@Resource
private SupplierRepository supplierRepository;
@Override
public Object addEs() {
QuerySupplierReq req = new QuerySupplierReq();
return null;
}
@Override
public String AddSupplier(UpdateSupplierReq req) {
......
......@@ -36,7 +36,7 @@ public class VieWarrantyGroupServiceImpl extends ServiceImpl<VieWarrantyGroupMap
private VieDestoryGroupServiceImpl VieDestoryGroupService;
@Override
public PageResult<WarrantyDataDto> WarrantyData(WarrantyReq req) {
if(req.getWarrantyType().equals(0)||req.getWarrantyType().equals(1))
if(req.getWarrantyType().equals("0")||req.getWarrantyType().equals("1"))
{
LambdaQueryWrapper<VieWarrantyGroup> wrapper = createWrapper(req);
Page<VieWarrantyGroup> page = page(PageFactory.getDefaultPage(req.getPageNo(), req.getPageSize()), wrapper);
......
package com.junmp.jyzb.task;
import com.junmp.jyzb.service.InventorySummaryService;
import com.junmp.jyzb.service.PublicService;
import com.junmp.v2.job.api.JobAction;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Slf4j
@Component
public class DestoryGroupAction implements JobAction {
@Resource
private InventorySummaryService inventorySummaryService;
@Override
public void action() {
inventorySummaryService.setDestoryGroupAction();
}
}
package com.junmp.jyzb.task;
import com.junmp.jyzb.service.InventorySummaryService;
import com.junmp.jyzb.service.PublicService;
import com.junmp.v2.job.api.JobAction;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Slf4j
@Component
public class WarrantyGroupAction implements JobAction{
@Resource
private InventorySummaryService inventorySummaryService;
@Override
public void action() {
inventorySummaryService.setWarrantyGroupAction();
}
}
package com.junmp.jyzb.task;
import com.junmp.jyzb.service.InventorySummaryService;
import com.junmp.jyzb.service.PublicService;
import com.junmp.v2.job.api.JobAction;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@Slf4j
@Component
public class WarrantyInventoryAction implements JobAction{
@Resource
private InventorySummaryService inventorySummaryService;
@Override
public void action() {
inventorySummaryService.setWarrantyInventoryAction();
}
}
......@@ -87,7 +87,21 @@
END
WHERE add_price IS NULL OR add_num IS NULL;
</update>
<insert id="setWarrantyInventoryAction" statementType="CALLABLE">
{CALL Insert_into_base_warranty_inventory()}
</insert>
<insert id="setDestoryGroupAction" statementType="CALLABLE">
{CALL Insert_into_view_destory_group()}
</insert>
<insert id="setWarrantyGroupAction" statementType="CALLABLE">
{CALL Insert_into_view_warranty_group()}
</insert>
<insert id="getSumByCabinet">
INSERT INTO base_inventory_summary (id,org_id_int,org_name,type_id, type_name,size_id,size_name,location_id,location_name,
......
......@@ -32,7 +32,7 @@ knife4j:
spring:
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://192.168.1.128:3306/db_jyzb?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
url: jdbc:mysql://192.168.1.128:3306/db_jyzb_test?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
username: root
password: 123456
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论