This commit is contained in:
haozq 2024-11-11 17:32:24 +08:00
parent dc021a35fd
commit 30f6b31b73
7 changed files with 166 additions and 16 deletions

View File

@ -0,0 +1,43 @@
package com.bonus.gzgqj.business.bases.controller;
import com.bonus.gzgqj.business.bases.entity.PaTypeVo;
import com.bonus.gzgqj.business.bases.service.PaTypeService;
import com.bonus.gzgqj.business.plan.entity.PlanApplyAuditBean;
import com.bonus.gzgqj.manager.annotation.DecryptAndVerify;
import com.bonus.gzgqj.manager.core.entity.EncryptedReq;
import com.bonus.gzgqj.manager.webResult.ServerResponse;
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/paType")
@Slf4j
public class PaTypeController {
@Autowired
private PaTypeService service;
/**
* X详情接口
* @param dto
* @return
*/
@GetMapping("getTypeList")
@DecryptAndVerify(decryptedClass = PaTypeVo.class)
public ServerResponse getTypeList(EncryptedReq<PaTypeVo> dto) {
return service.getTypeList(dto.getData());
}
}

View File

@ -0,0 +1,47 @@
package com.bonus.gzgqj.business.bases.entity;
import lombok.Data;
/**
* 配件管理
* @author 黑子
*/
@Data
public class PaTypeVo {
private int id;
/**
* 父id
*/
private int pId;
/**
* 名称
*/
private String name;
/**
* 等级
*/
private String level;
/**
* 数量
*/
private String num;
/**
* 价格
*/
private String price;
/**
* 单位
*/
private String unit;
/**
* 重量
*/
private String weight;
/**
* 是否有效
*/
private String isActive;
}

View File

@ -0,0 +1,12 @@
package com.bonus.gzgqj.business.bases.mapper;
import org.springframework.stereotype.Repository;
/**
* 类型接口层
* @author 黑子
*/
@Repository
public interface PaTypeMapper {
}

View File

@ -0,0 +1,18 @@
package com.bonus.gzgqj.business.bases.service;
import com.bonus.gzgqj.business.bases.entity.PaTypeVo;
import com.bonus.gzgqj.manager.webResult.ServerResponse;
import lombok.extern.slf4j.Slf4j;
/**
* 配件类型管理业务层
* @author 黑子
*/
public interface PaTypeService {
/**
* 获取 类型
* @param data
* @return
*/
ServerResponse getTypeList(PaTypeVo data);
}

View File

@ -0,0 +1,33 @@
package com.bonus.gzgqj.business.bases.service;
import com.bonus.gzgqj.business.bases.entity.PaTypeVo;
import com.bonus.gzgqj.manager.webResult.ServerResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 配件类型接口 处理层
* @author 黑子
*/
@Slf4j
@Service
public class PaTypeServiceImpl implements PaTypeService{
/**
* @param data
* @return
*/
@Override
public ServerResponse getTypeList(PaTypeVo data) {
List<PaTypeVo> list=new ArrayList<>();
try{
}catch (Exception e){
log.error(e.toString(),e);
}
return ServerResponse.createSuccess();
}
}

View File

@ -8,7 +8,7 @@ public class StatisticsVo {
/**
* 需要数量
*/
private int neeNum;
private int needNum;
/**
* 发货数量
*/

View File

@ -120,12 +120,11 @@
where ppi.pro_id=#{proId}
</select>
<select id="getStatistics" resultType="com.bonus.gzgqj.business.plan.entity.StatisticsVo">
select sum(need_num) needNum ,sum(fh_num+tz_num) fhNum,SUM(IF(need_num-fh_num-tz_num,need_num-fh_num-tz_num,0)) dfhNum,
ROUND(sum(fh_num+tz_num)/sum(need_num)*100) fh,100- ROUND(sum(fh_num+tz_num) /sum(need_num)*100) dfh
select sum(need_num) needNum ,sum(fh_num+tz_num) fhNum,SUM(IF(need_num-fh_num-tz_num>0,need_num-fh_num-tz_num,0)) dfhNum
from t_pro_need_info
WHERE need_type=1
UNION
select IFNULL( sum(need_num),0) needNum ,IFNULL(sum(fh_num),0) fhNum,IFNULL(SUM(IF(need_num-fh_num-tz_num,need_num-fh_num-tz_num,0)),0) dfhNum,0,0
select IFNULL( sum(need_num),0) needNum ,IFNULL(sum(fh_num),0) fhNum,IFNULL(SUM(IF(need_num-fh_num-tz_num>0,need_num-fh_num-tz_num,0)),0) dfhNum
from t_pro_need_info
WHERE need_type=2
</select>
@ -314,7 +313,7 @@
where pni.module_id=#{moduleId}
</select>
<select id="getWarnInfoPage" resultType="com.bonus.gzgqj.business.plan.entity.ProNeedInfo">
select tni.pro_id,tni.type,tni.`name`,tni.module,tni.module_id moduleId ,tni.unit,tni.need_num needNum,tni.id ,mt.num,
select tni.pro_id proId,tni.type,tni.`name`,tni.module,tni.module_id moduleId ,tni.unit,tni.need_num needNum,tni.id ,mt.num,
FLOOR(tni.need_num-mt.num) diff
from t_pro_need_info tni
left join mm_type mt on mt.id=tni.module_id and mt.`LEVEL`=4
@ -327,20 +326,18 @@
</if>
</select>
<select id="getWarnInfoPage2" resultType="com.bonus.gzgqj.business.plan.entity.ProNeedInfo">
select tni.pro_id,tni.type,tni.`name`,tni.module,tni.module_id moduleId ,
tni.unit,tni.need_num needNum,tni.id ,pro2.name proName,tni.fh_num fhNum
select tni.pro_id proId,tni.type,tni.`name`,tni.module,tni.module_id moduleId ,
tni.unit,tni.need_num needNum,tni.id ,pro2.name proName,tni.fh_num fhNum,IFNULL(tpi.plan_num ,0) planNUM
from t_pro_need_info tni
LEFT JOIN bm_project pro2 on tni.pro_id=pro2.id
LEFT JOIN t_pro_plan_info tpi on tpi.pro_id=tni.pro_id
where 1=1 and tni.need_type=2
<if test="module!=null and module!=''">
and pni.`module` like concat('%',#{module},'%')
</if>
<if test="name!=null and name!=''">
and pni.`name` like concat('%',#{name},'%')
</if>
<if test="module!=null and module!=''">
and pni.`module` like concat('%',#{module},'%')
</if>
<if test="name!=null and name!=''">
and pni.`name` like concat('%',#{name},'%')
</if>
</select>
</mapper>