类型接口开发

This commit is contained in:
haozq 2024-11-12 10:51:15 +08:00
parent 10e324a89b
commit dd1263e3be
17 changed files with 403 additions and 16 deletions

View File

@ -2,7 +2,13 @@
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="AliAccessStaticViaInstance" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliArrayNamingShouldHaveBracket" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliControlFlowStatementWithoutBraces" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliDeprecation" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliEqualsAvoidNull" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliLongLiteralsEndingWithLowercaseL" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliMissingOverrideAnnotation" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AliWrapperTypeEquality" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AlibabaAbstractClassShouldStartWithAbstractNaming" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AlibabaAbstractMethodOrInterfaceMethodMustUseJavadoc" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="AlibabaAvoidApacheBeanUtilsCopy" enabled="true" level="WARNING" enabled_by_default="true" />
@ -91,6 +97,7 @@
<inspection_tool class="JavadocDeclaration" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ADDITIONAL_TAGS" value="date" />
</inspection_tool>
<inspection_tool class="MapOrSetKeyShouldOverrideHashCodeEquals" enabled="true" level="WARNING" enabled_by_default="true" />
<inspection_tool class="MissingJavadoc" enabled="true" level="WARNING" enabled_by_default="true">
<option name="PACKAGE_SETTINGS">
<Options>

View File

@ -1,6 +1,7 @@
package com.bonus.gzgqj.business.bases.controller;
import com.bonus.gzgqj.business.bases.entity.PaTypeVo;
import com.bonus.gzgqj.business.bases.entity.PartInputVo;
import com.bonus.gzgqj.business.bases.service.PaTypeService;
import com.bonus.gzgqj.business.plan.entity.PlanApplyAuditBean;
import com.bonus.gzgqj.manager.annotation.DecryptAndVerify;
@ -19,6 +20,7 @@ import java.util.List;
/**
* @author 黑子
* 类型管理
*/
@RestController
@RequestMapping("/backstage/paType")
@ -29,7 +31,7 @@ public class PaTypeController {
@Autowired
private PaTypeService service;
/**
* X详情接口
* 查询 树集合
* @param dto
* @return
*/
@ -40,7 +42,7 @@ public class PaTypeController {
}
/**
* X详情接口
* 新增 数据頛
* @param dto
* @return
*/
@ -51,7 +53,7 @@ public class PaTypeController {
}
/**
* X详情接口
* 修改数据类型
* @param dto
* @return
*/
@ -61,7 +63,7 @@ public class PaTypeController {
return service.updateTypeData(dto.getData());
}
/**
* X详情接口
* 删除 数据
* @param dto
* @return
*/
@ -71,4 +73,19 @@ public class PaTypeController {
return service.deleteTypeData(dto.getData());
}
/**
* 分页查询配件入库
* @param dto
* @return
*/
@GetMapping("findByPage")
@DecryptAndVerify(decryptedClass = PartInputVo.class)
public PageInfo<PaTypeVo> findByPage(EncryptedReq<PaTypeVo> dto) {
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
List<PaTypeVo> list = service.findByPage(dto.getData());;
PageInfo<PaTypeVo> pageInfo = new PageInfo<>(list);
return pageInfo;
}
}

View File

@ -0,0 +1,32 @@
package com.bonus.gzgqj.business.bases.controller;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author 黑子
* 配件管理
*/
@RestController
@RequestMapping("/backstage/partApply")
@Slf4j
public class PartApplyController {
}

View File

@ -0,0 +1,60 @@
package com.bonus.gzgqj.business.bases.controller;
import com.bonus.gzgqj.business.bases.entity.PartInputVo;
import com.bonus.gzgqj.business.bases.service.PartInputService;
import com.bonus.gzgqj.business.plan.entity.PlanApplyBean;
import com.bonus.gzgqj.manager.annotation.DecryptAndVerify;
import com.bonus.gzgqj.manager.core.entity.EncryptedReq;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* 配件入库
* @author 黑子
*/
@RestController
@RequestMapping("/backstage/partInput")
@Slf4j
public class PartInputController {
@Autowired
private PartInputService service;
/**
* 分页查询配件入库
* @param dto
* @return
*/
@GetMapping("findByPage")
@DecryptAndVerify(decryptedClass = PartInputVo.class)
public PageInfo<PartInputVo> findByPage(EncryptedReq<PartInputVo> dto) {
PageHelper.startPage(dto.getPageNum(),dto.getPageSize());
List<PartInputVo> list = service.findByPage(dto.getData());;
PageInfo<PartInputVo> pageInfo = new PageInfo<>(list);
return pageInfo;
}
}

View File

@ -0,0 +1,55 @@
package com.bonus.gzgqj.business.bases.entity;
import lombok.Data;
import org.apache.poi.hpsf.Decimal;
/**
* 入库详情数据
* @author 黑子
*/
@Data
public class PartInputDetails {
private String id;
private String inputId;
/**
* 批次数量
*/
private int inputNum;
/**
* 单个价格
*/
private Decimal partPrice;
/**
* 总价格
*/
private Decimal totalPrice;
/**
* 厂家id
*/
private String venderId;
/**
* 厂家名称
*/
private String venderName;
/**
* 配件id
*/
private String patyId;
/**
* 配件类型
*/
private String partType;
/**
* 配件名称
*/
private String patyName;
/**
* 配件类型
*/
private String partmodel;
}

View File

@ -0,0 +1,75 @@
package com.bonus.gzgqj.business.bases.entity;
import lombok.Data;
import org.apache.poi.hpsf.Decimal;
/**
* @author 黑子
* 入库管理
*/
@Data
public class PartInputVo {
/**
* 主键
*/
private String id;
/**
* 编码
*/
private String code;
/**
* 入库人
*/
private String creator;
/**
* 入库日期
*/
private String inputDay;
/**
* 备注
*/
private String remark;
/**
* 单价是否录入
*/
private String isFlag;
/**
* 更新人
*/
private String updater;
/**
* 更新时间
*/
private String updateTime;
/**
* 创建时间
*/
private String createTime;
/**
* 总金额
*/
private Decimal allPrice;
/**
* 入库数量
*/
private int inputNum;
/**
* 开始日期
*/
private String startDay;
/**
* 结束日期
*/
private String endDay;
/**
* 关键字
*/
private String keyWord;
}

View File

@ -0,0 +1,8 @@
package com.bonus.gzgqj.business.bases.mapper;
/**
*
* @author 黑子
*/
public class PartApplyMapper {
}

View File

@ -0,0 +1,13 @@
package com.bonus.gzgqj.business.bases.mapper;
import com.bonus.gzgqj.business.bases.entity.PartInputVo;
import java.util.List;
/**
* 配件入库 -数据层
* @author 黑子
*/
public interface PartInputMapper {
List<PartInputVo> findByPage(PartInputVo data);
}

View File

@ -4,6 +4,8 @@ import com.bonus.gzgqj.business.bases.entity.PaTypeVo;
import com.bonus.gzgqj.manager.webResult.ServerResponse;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* 配件类型管理业务层
* @author 黑子
@ -36,4 +38,11 @@ public interface PaTypeService {
* @return
*/
ServerResponse deleteTypeData(PaTypeVo data);
/**
* 分页查询类型列表
* @param data
* @return
*/
List<PaTypeVo> findByPage(PaTypeVo data);
}

View File

@ -29,13 +29,7 @@ public class PaTypeServiceImpl implements PaTypeService{
public ServerResponse getTypeList(PaTypeVo data) {
List<PaTypeVo> list=new ArrayList<>();
try{
PaTypeVo vo=new PaTypeVo();
vo.setLevel(0);
vo.setId(-1);
vo.setParentId(-2);
vo.setName("配件类型列表");
list=mapper.getTypeList(data);
list.add(vo);
}catch (Exception e){
log.error(e.toString(),e);
}
@ -51,7 +45,7 @@ public class PaTypeServiceImpl implements PaTypeService{
public ServerResponse addTypeData(PaTypeVo data) {
try{
int pId=data.getParentId();
if (pId==-1){
if (pId==0){
data.setLevel(1);
data.setParentId(0);
}else{
@ -73,7 +67,7 @@ public class PaTypeServiceImpl implements PaTypeService{
}else{
int num= mapper.addTypeData(data);
if(num>0){
return ServerResponse.createSuccess("添加成功");
return ServerResponse.createSuccess("添加成功",data);
}else{
return ServerResponse.createErroe("添加失败");
}
@ -145,4 +139,20 @@ public class PaTypeServiceImpl implements PaTypeService{
}
return ServerResponse.createErroe("修改失败");
}
/**
* 分页查询列表
* @param data
* @return
*/
@Override
public List<PaTypeVo> findByPage(PaTypeVo data) {
try{
}catch (Exception e){
}
}
}

View File

@ -0,0 +1,7 @@
package com.bonus.gzgqj.business.bases.service;
/**
* 配件管理 -入库
* @author 黑子
*/
public interface PartApplyService {
}

View File

@ -0,0 +1,7 @@
package com.bonus.gzgqj.business.bases.service;
/**
* 配件管理 入库
* @author 黑子
*/
public class PartApplyServiceImpl {
}

View File

@ -0,0 +1,17 @@
package com.bonus.gzgqj.business.bases.service;
import com.bonus.gzgqj.business.bases.entity.PartInputVo;
import java.util.List;
/**
* @author 黑子
*/
public interface PartInputService {
/**
* 分页查询配件入库
* @param data
* @return
*/
List<PartInputVo> findByPage(PartInputVo data);
}

View File

@ -0,0 +1,43 @@
package com.bonus.gzgqj.business.bases.service;
import com.bonus.gzgqj.business.bases.entity.PartInputVo;
import com.bonus.gzgqj.business.bases.mapper.PartInputMapper;
import com.bonus.gzgqj.manager.common.util.StringHelper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 配件入库 业务层
* @author 黑子
*/
@Service
@Slf4j
public class PartInputServiceImpl implements PartInputService{
@Autowired
private PartInputMapper mapper;
/**
* 分页查询配件入库
* @param data
* @return
*/
@Override
public List<PartInputVo> findByPage(PartInputVo data) {
List<PartInputVo> list=new ArrayList<>();
try{
if(StringHelper.isNotEmpty(data.getInputDay())){
data.setStartDay(data.getInputDay().split(" ~ ")[0]);
data.setEndDay(data.getInputDay().split(" ~ ")[1]);
}
list=mapper.findByPage(data);
}catch (Exception e){
log.error(e.toString(),e);
}
return list;
}
}

View File

@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.bonus.gzgqj.business.bases.mapper.PaTypeMapper" >
<!--新增类型-->
<insert id="addTypeData">
<insert id="addTypeData" useGeneratedKeys="true" keyProperty="id">
insert into pa_type(parent_id, name,remarks,is_active,level)VALUES(#{pId},#{name},#{remarks},1,#{level})
</insert>
<update id="updateTypeData">
@ -12,9 +12,9 @@
update pa_type set is_active=0 where id=#{id}
</update>
<select id="getTypeList" resultType="com.bonus.gzgqj.business.bases.entity.PaTypeVo">
select id,parent_id parentId,name,num,
price,unit,weight,is_consumables ,
remarks,is_active ,level,warn_num
select if(id=1,0,id) id ,parent_id parentId,name,num,
price,unit,weight,is_consumables ,
remarks,is_active ,level,warn_num
FROM pa_type
WHERE is_active=1
</select>

View File

@ -0,0 +1,5 @@
<?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="com.bonus.gzgqj.business.bases.mapper.PartApplyMapper" >
</mapper>

View File

@ -0,0 +1,22 @@
<?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="com.bonus.gzgqj.business.bases.mapper.PartInputMapper" >
<!--分页查询-->
<select id="findByPage" resultType="com.bonus.gzgqj.business.bases.entity.PartInputVo">
select tpi.id,tpi.code,tpi.creator,tpi.input_day inputDay,
tpi.input_num inputNum,tpi.all_price allPrice,tpi.remark,tpi.is_flag isFlag
from t_part_input tpi
<where>
<if test="keyWord!=null and keyWord!=''">
and (tpi.code like concat('%',#{keyWord},'%') or
tpi.creator like concat('%',#{keyWord},'%') or
tpi.input_day like concat('%',#{keyWord},'%') or
tpi.remark like concat('%',#{keyWord},'%')
)
</if>
<if test="inputDay!=null and inputDay!='' and startDay!=null and endDay!=null ">
and STR_TO_DATE(tpi.input_day, '%Y-%m-%d') between STR_TO_DATE(#{startDay} ,'%Y-%m-%d') AND STR_TO_DATE(#{endDay},'%Y-%m-%d')
</if>
</where>
</select>
</mapper>