Browse Source

git-svn-id: https://192.168.57.71/svn/lyggkj@71 1a6f6e3a-4066-fe46-b609-79c204482ece

ld_liufl 9 years ago
parent
commit
0b0933da52

+ 0 - 11
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/controller/yjgl/zdwxyfb/CgController.java

@@ -45,26 +45,21 @@ import com.jtgh.yjpt.common.SpecificationCreater;
 import com.jtgh.yjpt.common.Utils;
 import com.jtgh.yjpt.controller.BaseController;
 import com.jtgh.yjpt.controller.sgalgl.PoiUtils;
-import com.jtgh.yjpt.dao.task.GztxDao;
 import com.jtgh.yjpt.dao.yjgl.zdwxyfb.CgDao;
 import com.jtgh.yjpt.entity.BaseEntity;
-import com.jtgh.yjpt.entity.auth.UserEntity;
 import com.jtgh.yjpt.entity.common.AccessoryEntity;
 import com.jtgh.yjpt.entity.gkgq.GqEntity;
 import com.jtgh.yjpt.entity.jyr.JyrEntity;
 import com.jtgh.yjpt.entity.jyrxxgl.GksssbEntity;
-import com.jtgh.yjpt.entity.task.Gztx;
 import com.jtgh.yjpt.entity.yjgl.zdwxyfb.CgCountEntity;
 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.entity.yjgl.zdwxyfb.ZbhjjbqkEntity;
-import com.jtgh.yjpt.service.auth.UserService;
 import com.jtgh.yjpt.service.common.AccessoryService;
 import com.jtgh.yjpt.service.gkgq.GqService;
 import com.jtgh.yjpt.service.jyr.JyrService;
 import com.jtgh.yjpt.service.jyrxxgl.GksssbService;
-import com.jtgh.yjpt.service.task.TaskService;
 import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgService;
 import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgsyService;
 import com.jtgh.yjpt.service.yjgl.zdwxyfb.CgztService;
@@ -96,12 +91,6 @@ public class CgController extends BaseController {
 	private JyrService jyrService;
 	@Autowired
 	private GksssbService aqsssbService;
-	@Autowired
-	private GztxDao gztxDao;
-	@Autowired
-	private TaskService taskService;
-	@Autowired
-	private UserService userService;
 	
 
 	@Log(Type.QUERY)

+ 1 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/impl/yjgl/zdwxyfb/CgServiceImp.java

@@ -401,6 +401,7 @@ public class CgServiceImp extends BaseService<CgEntity, Long> implements
 	 * @param entity
 	 * @param jsUser
 	 */
+	@Override
 	public void saveGztx(CgztEntity entity) {
 		CgsyEntity cgsy = cgsyService.findByCg(entity.getCg());
 		String txnr1 = "";

+ 72 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/impl/yjgl/zdwxyfb/CgztServiceImp.java

@@ -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;
+	}
 }

+ 2 - 0
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/service/yjgl/zdwxyfb/CgztService.java

@@ -44,4 +44,6 @@ public interface CgztService {
 	
 	public CgztEntity findByCg(CgEntity cg);
 
+	CgztEntity saveCgzt(CgztEntity entity);
+
 }