dad7c4d6 康伟

kangwei :采购计划的选择物料,去年数据使用计划表单的计划年参数

1 个父辈 4d6c01ca
......@@ -8,6 +8,7 @@ import com.skua.core.aspect.annotation.AutoLog;
import com.skua.core.context.BaseContextHandler;
import com.skua.core.query.QueryGenerator;
import com.skua.core.util.ConvertUtils;
import com.skua.core.util.DateUtils;
import com.skua.modules.equipment.service.IEquipmentSparepartService;
import com.skua.modules.erp.entity.ApproveRecord;
import com.skua.modules.erp.entity.PurchaseMaterial;
......@@ -15,6 +16,7 @@ import com.skua.modules.erp.service.IDistributMaterialService;
import com.skua.modules.erp.service.IPurchaseMaterialService;
import com.skua.modules.erp.vo.MaterialSearchVO;
import com.skua.modules.erp.vo.PurchaseMaterialVO;
import com.skua.modules.guest.util.DateUtil;
import com.skua.modules.quartz.util.BaseUtil;
import com.skua.modules.supplies.entity.EquipmentSparepartSupplies;
import com.skua.modules.supplies.entity.EquipmentSparepartType;
......@@ -64,9 +66,13 @@ public class ErpCommonController {
sparepartTypeStr = String.join(",", sparepartTypeSet);
}
}
Integer applyYear = DateUtils.getYear() -1;
if(materialSearchVO.getApplyYear() != null ){
applyYear =materialSearchVO.getApplyYear() -1;
}
// String depId = BaseContextHandler.getRealDepartId();//临时参数
// String username = req.getParameter("username");
IPage<EquipmentSparepartSupplies> pageList = sparepartSuppliesService.queryPageByOut(page , materialSearchVO.getSparepartName() ,sparepartTypeStr ,materialSearchVO.getSparepartCode());
IPage<EquipmentSparepartSupplies> pageList = sparepartSuppliesService.queryPageByOut(page , materialSearchVO.getSparepartName() ,sparepartTypeStr ,materialSearchVO.getSparepartCode(),applyYear);
result.setSuccess(true);
result.setResult(pageList);
return result;
......
......@@ -19,6 +19,9 @@ public class MaterialSearchVO {
@ApiModelProperty(value = "分销合同编号")
private String distributContractId;
@ApiModelProperty(value = "计划年份")
private Integer applyYear;
@ApiModelProperty(value = "物料编号")
private String sparepartCode;
......
......@@ -19,5 +19,5 @@ public interface EquipmentSparepartSuppliesMapper extends BaseMapper<EquipmentSp
* @return
*/
public IPage<EquipmentSparepartSupplies> selectPageByOut(Page<EquipmentSparepartSupplies> page,@Param("sparepartName")String sparepartName,
@Param("sparepartType")String sparepartType ,@Param("sparepartCode")String sparepartCode);
@Param("sparepartType")String sparepartType ,@Param("sparepartCode")String sparepartCode, @Param("applyYear")Integer applyYear);
}
......
......@@ -9,7 +9,7 @@
left join (
select sum(out_num) out_num ,sparepart_id from equipment_out_child
where
YEAR(create_time) = YEAR(CURRENT_DATE - INTERVAL 1 YEAR)
YEAR(create_time) = #{applyYear}
group by sparepart_id
) aaa on aaa.sparepart_id = ss.id
<where>
......
......@@ -15,5 +15,5 @@ public interface IEquipmentSparepartSuppliesService extends IService<EquipmentSp
* @param depId
* @return
*/
public IPage<EquipmentSparepartSupplies> queryPageByOut(Page<EquipmentSparepartSupplies> page, String sparepartName,String sparepartType ,String sparepartCode);
public IPage<EquipmentSparepartSupplies> queryPageByOut(Page<EquipmentSparepartSupplies> page, String sparepartName,String sparepartType ,String sparepartCode ,Integer applyYear);
}
......
......@@ -20,7 +20,7 @@ public class EquipmentSparepartSuppliesServiceImpl extends ServiceImpl<Equipment
* @param
* @return
*/
public IPage<EquipmentSparepartSupplies> queryPageByOut(Page<EquipmentSparepartSupplies> page ,String sparepartName,String sparepartType ,String sparepartCode){
return baseMapper.selectPageByOut(page ,sparepartName,sparepartType,sparepartCode);
public IPage<EquipmentSparepartSupplies> queryPageByOut(Page<EquipmentSparepartSupplies> page ,String sparepartName,String sparepartType ,String sparepartCode,Integer applyYear){
return baseMapper.selectPageByOut(page ,sparepartName,sparepartType,sparepartCode,applyYear);
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!