|
@@ -5,11 +5,15 @@ import java.util.List;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import com.jtgh.yjpt.common.Constants;
|
|
|
import com.jtgh.yjpt.dao.common.MyRepository;
|
|
|
import com.jtgh.yjpt.dao.yjgl.zdwxyfb.CgztDao;
|
|
|
import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgEntity;
|
|
|
+import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgsyEntity;
|
|
|
import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgztEntity;
|
|
|
import com.jtgh.yjpt.service.BaseService;
|
|
|
+import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgService;
|
|
|
+import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgsyService;
|
|
|
import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgztService;
|
|
|
|
|
|
@Service
|
|
@@ -18,6 +22,10 @@ public class CgztServiceImp extends BaseService<CgztEntity, Long> implements
|
|
|
|
|
|
@Autowired
|
|
|
private CgztDao cgztDao;
|
|
|
+ @Autowired
|
|
|
+ private CgService cgService;
|
|
|
+ @Autowired
|
|
|
+ private CgsyService cgsyService;
|
|
|
|
|
|
@Override
|
|
|
protected MyRepository<CgztEntity, Long> getDao() {
|
|
@@ -32,4 +40,68 @@ public class CgztServiceImp extends BaseService<CgztEntity, Long> implements
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public CgztEntity saveCgzt(CgztEntity entity){
|
|
|
+ entity.setZt(Constants.CGZT_ZC);
|
|
|
+ if (entity.getCg() != null) {
|
|
|
+ CgsyEntity cgsy = cgsyService.findByCg(entity.getCg());
|
|
|
+ if (cgsy != null) {
|
|
|
+ if (null != cgsy.getZdwd()
|
|
|
+ && !"".equals(cgsy.getZdwd().trim())
|
|
|
+ && null != entity.getWd()
|
|
|
+ && !"".equals(cgsy.getZdwd().trim())
|
|
|
+ && Double.parseDouble(entity.getWd()) > Double
|
|
|
+ .parseDouble(cgsy.getZdwd())) {
|
|
|
+ entity.setZt(Constants.CGZT_YC);
|
|
|
+ }
|
|
|
+ if (null != cgsy.getZxwd()
|
|
|
+ && !"".equals(cgsy.getZxwd().trim())
|
|
|
+ && null != entity.getWd()
|
|
|
+ && !"".equals(cgsy.getZxwd().trim())
|
|
|
+ && Double.parseDouble(entity.getWd()) < Double
|
|
|
+ .parseDouble(cgsy.getZxwd())) {
|
|
|
+ entity.setZt(Constants.CGZT_YC);
|
|
|
+ }
|
|
|
+ if (null != cgsy.getZdyl()
|
|
|
+ && !"".equals(cgsy.getZdyl().trim())
|
|
|
+ && null != entity.getYl()
|
|
|
+ && !"".equals(cgsy.getZdyl().trim())
|
|
|
+ && Double.parseDouble(entity.getYl()) > Double
|
|
|
+ .parseDouble(cgsy.getZdyl())) {
|
|
|
+ entity.setZt(Constants.CGZT_YC);
|
|
|
+ }
|
|
|
+ if (null != cgsy.getZxyl()
|
|
|
+ && !"".equals(cgsy.getZxyl().trim())
|
|
|
+ && null != entity.getYl()
|
|
|
+ && !"".equals(cgsy.getZxyl().trim())
|
|
|
+ && Double.parseDouble(entity.getYl()) < Double
|
|
|
+ .parseDouble(cgsy.getZxyl())) {
|
|
|
+ entity.setZt(Constants.CGZT_YC);
|
|
|
+ }
|
|
|
+ if (null != cgsy.getZdyw()
|
|
|
+ && !"".equals(cgsy.getZdyw().trim())
|
|
|
+ && null != entity.getYw()
|
|
|
+ && !"".equals(cgsy.getZdyw().trim())
|
|
|
+ && Double.parseDouble(entity.getYw()) > Double
|
|
|
+ .parseDouble(cgsy.getZdyw())) {
|
|
|
+ entity.setZt(Constants.CGZT_YC);
|
|
|
+ }
|
|
|
+ if (null != cgsy.getZxyw()
|
|
|
+ && !"".equals(cgsy.getZxyw().trim())
|
|
|
+ && null != entity.getYw()
|
|
|
+ && !"".equals(cgsy.getZxyw().trim())
|
|
|
+ && Double.parseDouble(entity.getYw()) < Double
|
|
|
+ .parseDouble(cgsy.getZxyw())) {
|
|
|
+ entity.setZt(Constants.CGZT_YC);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ entity = cgztDao.save(entity);
|
|
|
+ //发工作提醒
|
|
|
+ if (entity.getCg() != null && entity.getZt().equals(Constants.CGZT_YC)) {
|
|
|
+ cgService.saveGztx(entity);
|
|
|
+ }
|
|
|
+ return entity;
|
|
|
+ }
|
|
|
}
|