|
@@ -38,8 +38,8 @@ import com.jtgh.yjpt.common.BusinessContext;
|
|
import com.jtgh.yjpt.common.Constants;
|
|
import com.jtgh.yjpt.common.Constants;
|
|
import com.jtgh.yjpt.common.GlobalData;
|
|
import com.jtgh.yjpt.common.GlobalData;
|
|
import com.jtgh.yjpt.common.PredicateModel;
|
|
import com.jtgh.yjpt.common.PredicateModel;
|
|
-import com.jtgh.yjpt.common.ReportExportHelper;
|
|
|
|
import com.jtgh.yjpt.common.PredicateModel.Operator;
|
|
import com.jtgh.yjpt.common.PredicateModel.Operator;
|
|
|
|
+import com.jtgh.yjpt.common.ReportExportHelper;
|
|
import com.jtgh.yjpt.common.SinglePageRequest;
|
|
import com.jtgh.yjpt.common.SinglePageRequest;
|
|
import com.jtgh.yjpt.common.SpecificationCreater;
|
|
import com.jtgh.yjpt.common.SpecificationCreater;
|
|
import com.jtgh.yjpt.common.Utils;
|
|
import com.jtgh.yjpt.common.Utils;
|
|
@@ -53,12 +53,14 @@ import com.jtgh.yjpt.entity.jyr.JyrEntity;
|
|
import com.jtgh.yjpt.entity.jyrxxgl.GksssbEntity;
|
|
import com.jtgh.yjpt.entity.jyrxxgl.GksssbEntity;
|
|
import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgCountEntity;
|
|
import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgCountEntity;
|
|
import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgEntity;
|
|
import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgEntity;
|
|
|
|
+import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgztEntity;
|
|
import com.jtgh.yjpt.entity.yjgl.zdwxyfb.ZbhjjbqkEntity;
|
|
import com.jtgh.yjpt.entity.yjgl.zdwxyfb.ZbhjjbqkEntity;
|
|
import com.jtgh.yjpt.service.common.AccessoryService;
|
|
import com.jtgh.yjpt.service.common.AccessoryService;
|
|
import com.jtgh.yjpt.service.gkgq.GqService;
|
|
import com.jtgh.yjpt.service.gkgq.GqService;
|
|
import com.jtgh.yjpt.service.jyr.JyrService;
|
|
import com.jtgh.yjpt.service.jyr.JyrService;
|
|
import com.jtgh.yjpt.service.jyrxxgl.GksssbService;
|
|
import com.jtgh.yjpt.service.jyrxxgl.GksssbService;
|
|
import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgService;
|
|
import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgService;
|
|
|
|
+import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgztService;
|
|
import com.jtgh.yjpt.service.yjgl.zdwxyfb.ZbhjjbqkService;
|
|
import com.jtgh.yjpt.service.yjgl.zdwxyfb.ZbhjjbqkService;
|
|
|
|
|
|
@Controller
|
|
@Controller
|
|
@@ -72,6 +74,8 @@ public class CgController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private CgService cgService;
|
|
private CgService cgService;
|
|
@Autowired
|
|
@Autowired
|
|
|
|
+ private CgztService cgztService;
|
|
|
|
+ @Autowired
|
|
private CgDao cgDao;
|
|
private CgDao cgDao;
|
|
@Autowired
|
|
@Autowired
|
|
private AccessoryService accessoryService;
|
|
private AccessoryService accessoryService;
|
|
@@ -102,6 +106,11 @@ public class CgController extends BaseController {
|
|
if (null == pageRequest) {
|
|
if (null == pageRequest) {
|
|
List<CgEntity> dataset = cgService.findAll(spec);
|
|
List<CgEntity> dataset = cgService.findAll(spec);
|
|
for (CgEntity vo : dataset) {
|
|
for (CgEntity vo : dataset) {
|
|
|
|
+ //检索储罐状态
|
|
|
|
+ CgztEntity cgzt = cgztService.findByCg(vo);
|
|
|
|
+ if(cgzt != null) {
|
|
|
|
+ vo.setZt(cgzt.getZt());
|
|
|
|
+ }
|
|
// 检索附件
|
|
// 检索附件
|
|
filterList = new ArrayList<PredicateModel>();
|
|
filterList = new ArrayList<PredicateModel>();
|
|
addNotEmptyModel(filterList, "entityType.id",
|
|
addNotEmptyModel(filterList, "entityType.id",
|
|
@@ -120,6 +129,11 @@ public class CgController extends BaseController {
|
|
} else {
|
|
} else {
|
|
Page<CgEntity> page = cgService.findAll(spec, pageRequest);
|
|
Page<CgEntity> page = cgService.findAll(spec, pageRequest);
|
|
for (CgEntity vo : page) {
|
|
for (CgEntity vo : page) {
|
|
|
|
+ //检索储罐状态
|
|
|
|
+ CgztEntity cgzt = cgztService.findByCg(vo);
|
|
|
|
+ if(cgzt != null) {
|
|
|
|
+ vo.setZt(cgzt.getZt());
|
|
|
|
+ }
|
|
// 检索附件
|
|
// 检索附件
|
|
filterList = new ArrayList<PredicateModel>();
|
|
filterList = new ArrayList<PredicateModel>();
|
|
addNotEmptyModel(filterList, "entityType.id",
|
|
addNotEmptyModel(filterList, "entityType.id",
|
|
@@ -526,6 +540,63 @@ public class CgController extends BaseController {
|
|
} finally {
|
|
} finally {
|
|
outputStream.close();
|
|
outputStream.close();
|
|
}
|
|
}
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 查询储罐状态信息
|
|
|
|
+ * @param pageRequest
|
|
|
|
+ * @param functionId
|
|
|
|
+ * @param entity
|
|
|
|
+ * @param hz
|
|
|
|
+ * @param tbsj1
|
|
|
|
+ * @param tbsj2
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public BusinessContext listZt(SinglePageRequest pageRequest, Long functionId,
|
|
|
|
+ CgEntity entity,String hz,Date tbsj1,Date tbsj2) {
|
|
|
|
+ List<PredicateModel> filterList = new ArrayList<PredicateModel>();
|
|
|
|
+ //所属储罐
|
|
|
|
+ addNotEmptyModel(filterList, "cg", entity.getId(), Operator.EQ);
|
|
|
|
+ //货种
|
|
|
|
+ addNotEmptyModel(filterList, "hz", hz, Operator.LIKE);
|
|
|
|
+ //填报时间
|
|
|
|
+ if(tbsj1!=null){
|
|
|
|
+ addNotEmptyModel(filterList, "tbsj", Utils.getDateFirstTime(tbsj1), Operator.GTE);
|
|
|
|
+ }
|
|
|
|
+ if(tbsj2!=null){
|
|
|
|
+ addNotEmptyModel(filterList, "tbsj", Utils.getDateLastTime(tbsj2), Operator.LTE);
|
|
|
|
+ }
|
|
|
|
+ addNotEmptyModel(filterList, "recordStatus",
|
|
|
|
+ BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
|
|
|
|
+ Specification<CgztEntity> spec = SpecificationCreater
|
|
|
|
+ .searchByPredicateModels(filterList);
|
|
|
|
+ Page<CgztEntity> page = cgztService.findAll(spec,pageRequest);
|
|
|
|
+ return createBusinessContext(page);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 保存
|
|
|
|
+ * @param functionId
|
|
|
|
+ * @param entity
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ public BusinessContext saveZt(Long functionId,CgztEntity entity){
|
|
|
|
+ //新增
|
|
|
|
+ if(entity.getId()==null || entity.getId().equals(0l)){
|
|
|
|
+ entity.setAddDate(new Date());
|
|
|
|
+ entity.setAddUser(Utils.getCurrentUser());
|
|
|
|
+ entity.setRecordCode( getCurrentRoleCode(functionId));
|
|
|
|
+ } else {
|
|
|
|
+ entity.setUpdateDate(new Date());
|
|
|
|
+ entity.setUpdateUser(Utils.getCurrentUser());
|
|
|
|
+ }
|
|
|
|
+ entity = cgztService.save(entity);
|
|
|
|
+ return createBusinessContext(entity);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public void deleteZt(CgztEntity entity){
|
|
|
|
+ cgztService.logicDelete(entity.getId());
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|