Commit eae8412d by 吴迪

【新增】注册注销公告

parent 84277e4f
package io.office.modules.manage.controller;
import java.util.Arrays;
import java.util.Map;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.app.annotation.Login;
import io.office.modules.manage.entity.PartnersEntity;
import io.office.modules.manage.vo.request.EanUpcEntityVo;
import io.office.modules.manage.vo.response.EanUpcEntityDetailVo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import io.office.modules.manage.entity.EanUpcEntity;
import io.office.modules.manage.service.EanUpcService;
import io.office.common.utils.PageUtils;
import io.office.common.utils.R;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-06 16:04:53
*/
@RestController
@RequestMapping("/eanupc")
public class EanUpcController {
@Autowired
private EanUpcService eanUpcService;
/**
* 列表
*/
@RequestMapping("/list")
// @RequiresPermissions("manage:eanupc:list")
public R list(@RequestParam Map<String, Object> params){
PageUtils page = eanUpcService.queryPage(params);
return R.ok().put("page", page);
}
/**
* 信息
*/
@RequestMapping("/info/{fId}")
// @RequiresPermissions("manage:eanupc:info")
public R info(@PathVariable("fId") Integer fId){
EanUpcEntity eanUpc = eanUpcService.getById(fId);
return R.ok().put("eanUpc", eanUpc);
}
/**
* 保存
*/
@RequestMapping("/save")
// @RequiresPermissions("manage:eanupc:save")
public R save(@RequestBody EanUpcEntity eanUpc){
eanUpcService.save(eanUpc);
return R.ok();
}
/**
* 修改
*/
@RequestMapping("/update")
// @RequiresPermissions("manage:eanupc:update")
public R update(@RequestBody EanUpcEntity eanUpc){
eanUpcService.updateById(eanUpc);
return R.ok();
}
/**
* 删除
*/
@RequestMapping("/delete")
// @RequiresPermissions("manage:eanupc:delete")
public R delete(@RequestBody Integer[] fIds){
eanUpcService.removeByIds(Arrays.asList(fIds));
return R.ok();
}
/**
* 注册公告
* @param params
* @return
*/
@Login
@RequestMapping("/api/getEanUpcByCondition")
// @RequiresPermissions("manage:partners:list")
public R getEanUpcByCondition(@RequestBody Map<String, Object> params){
EanUpcEntity eanUpcEntity = new EanUpcEntity();
eanUpcEntity.setLogoutFlag(params.get("logoutFlag").toString());
Page<EanUpcEntityVo> page = this.eanUpcService.getEanUpcByCondition(eanUpcEntity,
new Page(Integer.valueOf(params.get("page").toString()),
Integer.valueOf(params.get("limit").toString())));
PageUtils pageUtils = new PageUtils(page);
return R.ok().put("data", pageUtils);
}
/**
* 详情
* @param eanUpcEntity
* @return
*/
@Login
@RequestMapping("/api/getDetailById")
public EanUpcEntityDetailVo getDetailById(@RequestBody EanUpcEntity eanUpcEntity) {
return eanUpcService.getDetailById(eanUpcEntity);
}
}
package io.office.modules.manage.dao;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.manage.entity.EanUpcEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import io.office.modules.manage.vo.request.EanUpcEntityVo;
import io.office.modules.manage.vo.response.EanUpcEntityDetailVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-06 16:04:53
*/
@Mapper
public interface EanUpcDao extends BaseMapper<EanUpcEntity> {
List<EanUpcEntityVo> getEanUpcByCondition (@Param("eanUpcEntity")EanUpcEntity eanUpcEntity, Page page);
EanUpcEntityDetailVo getDetailById(@Param("eanUpcEntity")EanUpcEntity eanUpcEntity);
}
package io.office.modules.manage.entity;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-06 16:04:53
*/
@Data
@TableName("EAN_UPC")
public class EanUpcEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* $column.comments
*/
@TableId
private Integer fId;
/**
* $column.comments
*/
private String code;
/**
* $column.comments
*/
private String codeType;
/**
* $column.comments
*/
private Date loginDate;
/**
* $column.comments
*/
private Date validDate;
/**
* $column.comments
*/
private String approveMan;
/**
* $column.comments
*/
private String logoutFlag;
/**
* $column.comments
*/
private Date logoutDate;
/**
* $column.comments
*/
private String memo;
}
package io.office.modules.manage.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import io.office.common.utils.PageUtils;
import io.office.modules.manage.entity.EanUpcEntity;
import io.office.modules.manage.entity.PartnersEntity;
import io.office.modules.manage.vo.request.EanUpcEntityVo;
import io.office.modules.manage.vo.response.EanUpcEntityDetailVo;
import org.apache.ibatis.annotations.Param;
import java.util.Map;
/**
* ${comments}
*
* @author wudi
* @email
* @date 2021-12-06 16:04:53
*/
public interface EanUpcService extends IService<EanUpcEntity> {
PageUtils queryPage(Map<String, Object> params);
Page<EanUpcEntityVo> getEanUpcByCondition( EanUpcEntity eanUpcEntity, Page page);
EanUpcEntityDetailVo getDetailById(EanUpcEntity eanUpcEntity);
}
package io.office.modules.manage.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.office.modules.manage.entity.PartnersEntity;
import io.office.modules.manage.vo.request.EanUpcEntityVo;
import io.office.modules.manage.vo.response.EanUpcEntityDetailVo;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.office.common.utils.PageUtils;
import io.office.common.utils.Query;
import io.office.modules.manage.dao.EanUpcDao;
import io.office.modules.manage.entity.EanUpcEntity;
import io.office.modules.manage.service.EanUpcService;
@Service("eanUpcService")
public class EanUpcServiceImpl extends ServiceImpl<EanUpcDao, EanUpcEntity> implements EanUpcService {
@Override
public PageUtils queryPage(Map<String, Object> params) {
IPage<EanUpcEntity> page = this.page(
new Query<EanUpcEntity>().getPage(params),
new QueryWrapper<EanUpcEntity>()
);
return new PageUtils(page);
}
@Override
public Page<EanUpcEntityVo> getEanUpcByCondition(EanUpcEntity eanUpcEntity, Page page) {
List<EanUpcEntityVo> list = this.baseMapper.getEanUpcByCondition(eanUpcEntity,page);
page.setRecords(list);
return page;
}
@Override
public EanUpcEntityDetailVo getDetailById(EanUpcEntity eanUpcEntity) {
return baseMapper.getDetailById(eanUpcEntity);
}
}
\ No newline at end of file
package io.office.modules.manage.vo.request;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
*
* 
 @description:
*
* @author wudi
* @date 16:21 2021/12/6
*/
@Data
public class EanUpcEntityVo implements Serializable {
private Integer fId;
private String code;
private Date loginDate;
private Date logDate;
private String logoutFlag;
private String firmName;
}
package io.office.modules.manage.vo.response;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
*
* 
 @description:
*
* @author wudi
* @date 17:15 2021/12/6
*/
@Data
public class EanUpcEntityDetailVo implements Serializable {
private String firmName;
private String registerAddress;
private String postcode;
private String code;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date validDate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date loginDate;
private String logoutFlag;
private String fId;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date logoutDate;
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="io.office.modules.manage.dao.EanUpcDao">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="io.office.modules.manage.entity.EanUpcEntity" id="eanUpcMap">
<result property="fId" column="f_id"/>
<result property="code" column="code"/>
<result property="codeType" column="code_type"/>
<result property="loginDate" column="login_date"/>
<result property="validDate" column="valid_date"/>
<result property="approveMan" column="approve_man"/>
<result property="logoutFlag" column="logout_flag"/>
<result property="logoutDate" column="logout_date"/>
<result property="memo" column="memo"/>
</resultMap>
<select id="getEanUpcByCondition" parameterType="io.office.modules.manage.entity.EanUpcEntity" resultType="io.office.modules.manage.vo.request.EanUpcEntityVo">
SELECT
b.logout_flag AS logout_flag,
a.firm_name,
b.f_id,
b.code,
a.log_date,
b.login_date
FROM
center_outer.dbo.bulletin AS a
INNER JOIN ean_upc AS b ON a.code = b.code
WHERE
(
DATEDIFF(DAY, login_date, getdate()) >= 7
OR b.code = '69507917'
)
AND b.code &lt;&gt; '69305132'
AND logout_flag = #{eanUpcEntity.logoutFlag}
AND type_name IN (
'系统成员注册',
'厂商识别代码注销'
)
ORDER BY
login_date DESC,
f_id DESC
</select>
<select id="getDetailById" parameterType="io.office.modules.manage.entity.EanUpcEntity" resultType="io.office.modules.manage.vo.response.EanUpcEntityDetailVo">
SELECT
a.firm_name,
a.register_address,
a.postcode,
b.code,
b.valid_date,
b.login_date,
b.logout_flag,
b.f_id,
b.logout_date
FROM
firm a
LEFT JOIN ean_upc b ON a.f_id = b.f_id
LEFT JOIN center_outer.dbo.bulletin c ON c.code = b.code
WHERE
a.f_id = '6'
AND b.code = '6901009'
ORDER BY
c.Id DESC
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment