package com.thhy.materials.modules.biz.pipeplan.service.impl;
|
|
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageInfo;
|
import com.thhy.general.common.BasicResult;
|
import com.thhy.general.config.SysUserInfo;
|
import com.thhy.general.utils.UserInfoUtils;
|
import com.thhy.materials.modules.biz.pipeplan.entity.TPipeInfo;
|
import com.thhy.materials.modules.biz.pipeplan.mapper.TPipeInfoMapper;
|
import com.thhy.materials.modules.biz.pipeplan.service.SegmentPrintService;
|
import org.springframework.stereotype.Service;
|
|
import javax.annotation.Resource;
|
import java.text.SimpleDateFormat;
|
import java.util.Date;
|
import java.util.HashMap;
|
import java.util.List;
|
import java.util.Map;
|
|
@Service
|
public class SegmentPrintServiceImpl implements SegmentPrintService {
|
|
@Resource
|
private TPipeInfoMapper pipeInfoMapper;
|
|
@Override
|
public BasicResult printPlanList(Map<String, Object> values) {
|
//登录人 分公司id
|
SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo();
|
String companyId = sysUserInfo.getCompanyId();
|
values.put("companyId",companyId);
|
// 1 当天
|
Integer typeTime = Integer.valueOf(values.get("typeTime").toString());
|
if(typeTime==1){
|
//当前日期 查询当天的数据
|
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
|
Date date = new Date();
|
String format1 = format.format(date);
|
values.put("newTime",format1);
|
}
|
Integer pageSize = Integer.valueOf(values.get("pageSize").toString());
|
Integer pageNum = Integer.valueOf(values.get("pageNum").toString());
|
PageHelper.startPage(pageNum,pageSize);
|
List<TPipeInfo> pipeInfos = pipeInfoMapper.printPlanList(values);
|
PageInfo<TPipeInfo> tPipeInfoPageInfo = new PageInfo<>(pipeInfos);
|
return BasicResult.success(tPipeInfoPageInfo);
|
}
|
|
@Override
|
public BasicResult printRecord(Map<String, Object> values) {
|
values.put("id","");
|
//已打印管片id
|
List<String> recordIds = (List<String>) values.get("recordIds");
|
if(recordIds.size()>0){
|
for (String recordId :recordIds ){
|
HashMap<String, Object> hashMap = new HashMap<>();
|
hashMap.put("id","");
|
hashMap.put("pipeId",recordId);
|
pipeInfoMapper.pipeRecordInsert(hashMap);
|
}
|
return BasicResult.success("打印成功");
|
}else {
|
return BasicResult.faild("11111","未选择打印信息","null");
|
}
|
}
|
|
@Override
|
public BasicResult printRecordList(Map<String, Object> values) {
|
SysUserInfo sysUserInfo = UserInfoUtils.getInstance().getUserInfo();
|
String companyId = sysUserInfo.getCompanyId();
|
values.put("companyId",companyId);
|
|
Integer pageSize = Integer.valueOf(values.get("pageSize").toString());
|
|
Integer pageNum = Integer.valueOf(values.get("pageNum").toString());
|
PageHelper.startPage(pageNum,pageSize);
|
List<TPipeInfo> pipeInfos = pipeInfoMapper.printRecordList(values);
|
PageInfo<TPipeInfo> tPipeInfoPageInfo = new PageInfo<>(pipeInfos);
|
return BasicResult.success(tPipeInfoPageInfo);
|
}
|
}
|