3d3fd299 康伟

kangwei : 会议纪要文件下载

1 个父辈 f4d0b938
......@@ -26,6 +26,7 @@ import com.skua.modules.ajh.service.IAjhMeetingSendService;
import com.skua.modules.ajh.service.IAjhMeetingService;
import com.skua.modules.guest.util.DateUtil;
import com.skua.modules.system.service.ISysConfigService;
import com.skua.modules.system.service.ISysUserService;
import lombok.extern.slf4j.Slf4j;
......@@ -80,6 +81,9 @@ public class AjhMeetingMinutesController {
@Autowired
private ISysUserService userService;
@Autowired
private ISysConfigService sysConfigService;
/**
* <pre>
......@@ -412,6 +416,7 @@ public class AjhMeetingMinutesController {
//添加图片
// 第三部分:图片
if(minutesimage != null ){
File minutesimageFile = new File(minutesimage);
if(minutesimageFile.exists()){
WordImageEntity img = new WordImageEntity();
......@@ -423,6 +428,8 @@ public class AjhMeetingMinutesController {
paramMap.put("meetingImg" , img);
}
}
//导出word
exportWordData( templatePath , exportName , paramMap ,response);
}
......@@ -440,12 +447,15 @@ public class AjhMeetingMinutesController {
try {
//获取word文档解析对象
File file = new File(templatePath);
if(file.exists()){
inputStream = new FileInputStream(templatePath);
}else{//判断文件是否存在,如果不存在使用默认模板
Resource resource = new ClassPathResource("templates" + File.separator + "template_AjhMeetingMinutes.docx");
inputStream = resource.getInputStream();
if( ! file.exists()){////判断文件是否存在,如果不存在使用默认模板
templatePath = sysConfigService.queryValueByKey("MEETING_MINUTES_TEMPLATE_PATH");
//file = new File(bak_templatePath);
//}else{
//inputStream = this.getClass().getResourceAsStream(File.separator +"templates" + File.separator + "template_AjhMeetingMinutes.docx");
//Resource resource = new ClassPathResource("templates" + File.separator + "template_AjhMeetingMinutes.docx");
// inputStream = resource.getInputStream();
}
inputStream = new FileInputStream(templatePath);
//加载模板文件
MyXWPFDocument document = new MyXWPFDocument(inputStream);
//解析07版的Word并且进行赋值
......
......@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.erp.service.IPurchaseMaterialService;
import com.skua.modules.erp.vo.DistributContractVO;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
......@@ -75,10 +76,10 @@ public class DistributContractController {
@AutoLog(value = "erp分销合同-添加")
@ApiOperation(value="erp分销合同-添加", notes="erp分销合同-添加")
@PostMapping(value = "/add")
public Result<DistributContract> add(@RequestBody DistributContract distributContract) {
Result<DistributContract> result = new Result<DistributContract>();
public Result<DistributContractVO> add(@RequestBody DistributContractVO distributContract) {
Result<DistributContractVO> result = new Result<DistributContractVO>();
try {
distributContractService.save(distributContract);
distributContractService.saveDistributContractVO(distributContract);
result.success("添加成功!");
} catch (Exception e) {
log.error(e.getMessage(),e);
......@@ -90,13 +91,13 @@ public class DistributContractController {
@AutoLog(value = "erp分销合同-编辑")
@ApiOperation(value="erp分销合同-编辑", notes="erp分销合同-编辑")
@PutMapping(value = "/edit")
public Result<DistributContract> edit(@RequestBody DistributContract distributContract) {
public Result<DistributContract> edit(@RequestBody DistributContractVO distributContract) {
Result<DistributContract> result = new Result<DistributContract>();
DistributContract distributContractEntity = distributContractService.getById(distributContract.getId());
if(distributContractEntity==null) {
result.error500("未找到对应实体");
}else {
boolean ok = distributContractService.updateById(distributContract);
boolean ok = distributContractService.updateDistributContractVO(distributContract);
//TODO 返回false说明什么?
if(ok) {
result.success("修改成功!");
......@@ -111,7 +112,7 @@ public class DistributContractController {
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
try {
distributContractService.removeById(id);
distributContractService.delById(id);
} catch (Exception e) {
log.error("删除失败",e.getMessage());
return Result.error("删除失败!");
......
......@@ -96,4 +96,9 @@ public class PurchaseMaterial {
@ApiModelProperty(value = "厂站名称")
private String departName;
@TableField(exist=false)
@ApiModelProperty(value = "扩展:采购物料数量")
private String materialNum;
}
......
......@@ -26,7 +26,7 @@
<if test="goodCode != null and goodCode != ''">
AND m.good_code like concat('%', #{goodCode}, '%')
</if>
<if test="noticeType != null and noticeType != ''">
<if test="departId != null and departId != ''">
AND pc.departs like concat('%', #{departId}, '%')
</if>
) aaa
......@@ -40,15 +40,17 @@
from (
select m.* from erp_purchase_material m , erp_purchase_contract pc where m.contract_id = pc.id
<if test="goodCode != null and goodCode != ''">
AND m.good_code like concat('%', #{goodCode}, '%')
AND m.good_code like concat('', #{goodCode}, '%')
</if>
<if test="noticeType != null and noticeType != ''">
<if test="departId != null and departId != ''">
AND pc.departs like concat('%', #{departId}, '%')
</if>
limit 1
) aaa
left join equipment_sparepart_supplies ss on aaa.sparepart_id = ss.id
left join equipment_sparepart_type st on st.id = aaa.sparepart_type
left join ajh_supplier_manage sm on sm.id = aaa.supplier_id
</select>
......
......@@ -10,7 +10,11 @@
pp.id = pi.plan_id
<if test="ev.sparepartType != null and ev.sparepartType != '' ">
and pi.sparepart_type = #{ev.sparepartType}
</if> <if test="ev.sparepartName != null and ev.sparepartName != '' ">
</if>
<if test="ev.sparepartCode != null and ev.sparepartCode != '' ">
AND pi.sparepart_code like concat('%', #{ev.sparepartCode}, '%')
</if>
<if test="ev.sparepartName != null and ev.sparepartName != '' ">
AND pi.sparepart_name like concat('%', #{ev.sparepartName}, '%')
</if>
<if test="ev.applyYear != null and ev.applyYear != '' ">
......@@ -28,7 +32,7 @@
group by pi.sparepart_id
)aaa
left join equipment_sparepart_supplies ss on aaa.sparepart_id = ss.id
left join equipment_sparepart_type st on st.id = aaa.sparepart_type
left join equipment_sparepart_type st on st.id = ss.sparepart_type
</select>
......
......@@ -5,7 +5,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.skua.modules.erp.entity.PurchaseMaterial;
import com.skua.modules.erp.mapper.PurchaseMaterialMapper;
import com.skua.modules.erp.service.IPurchaseMaterialService;
import com.skua.modules.erp.vo.PurchasePlanSearchVO;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
......
......@@ -25,10 +25,12 @@ public class PurchasePlanSearchVO {
@ApiModelProperty(value = "物料编号")
public String sparepartId;
@ApiModelProperty(value = "物料Code")
public String sparepartCode;
@ApiModelProperty(value = "权限下的部门编号集合")
private String departs;
@ApiModelProperty(value = "开始时间")
private String startTime;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!