Commit 62f375f0 authored by 谢希宇's avatar 谢希宇

Aidea product update by Strive Date 2020-11-21

parent 938056ba
...@@ -108,7 +108,10 @@ ...@@ -108,7 +108,10 @@
allergy, allergy,
symptom, symptom,
open_id, open_id,
consult_id consultId consult_id consultId,
status,
drugs_id drugsId,
address_id addressId
</sql> </sql>
<insert id="save" parameterType="com.cftech.consultsheet.model.ConsultSheet" useGeneratedKeys="true" <insert id="save" parameterType="com.cftech.consultsheet.model.ConsultSheet" useGeneratedKeys="true"
...@@ -177,14 +180,14 @@ ...@@ -177,14 +180,14 @@
) )
</insert> </insert>
<select id="fetchById" parameterType="java.lang.Long" resultMap="com.cftech.consultsheet.model.ConsultSheet"> <select id="fetchById" parameterType="java.lang.Long" resultType="com.cftech.consultsheet.model.ConsultSheet">
SELECT SELECT
<include refid="sqlColumns"/>, d.name pharmacist,e.org_name hospital <include refid="sqlColumns"/>, d.name pharmacist,e.org_name hospital
FROM t_aidea_consult_sheet a FROM t_aidea_consult_sheet a
LEFT JOIN t_qyuser b ON b.id = a.doctor_id LEFT JOIN t_qyuser b ON b.id = a.doctor_id
LEFT JOIN t_qyuser c ON c.id = a.service_id LEFT JOIN t_qyuser c ON c.id = a.service_id
LEFT JOIN t_qyuser d ON d.id = a.past_records LEFT JOIN t_qyuser d ON d.id = a.past_records
LEFT JOIN t_qyuser e ON e.id = a.allergy LEFT JOIN t_orgunit e ON e.id = a.allergy
WHERE a.id = #{id} WHERE a.id = #{id}
</select> </select>
......
...@@ -29,9 +29,6 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -29,9 +29,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -116,10 +113,14 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im ...@@ -116,10 +113,14 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
consultSheet.setConsultId(codingruleUtils.getNumber(consultSheet.getAccountsId(), ConsultSheet.class.getName())); consultSheet.setConsultId(codingruleUtils.getNumber(consultSheet.getAccountsId(), ConsultSheet.class.getName()));
//处理处方单图片 //处理处方单图片
String fileName = mediaUtil.downloadMpMediaToDisk(mpAccountsEntity.getId(), "consultSheet", consultSheet.getPrescription()); if (StringUtils.isNoneBlank(consultSheet.getPrescription())) {
String url = SystemConfig.p.getProperty("QY_DOMAIN") + SystemConfig.p.getProperty("IMAGEURL").replace("{PICFILENAME}", fileName); if (!consultSheet.getPrescription().contains("http")) {
String fileName = mediaUtil.downloadMpMediaToDisk(mpAccountsEntity.getId(), "consultSheet", consultSheet.getPrescription());
String url = SystemConfig.p.getProperty("QY_DOMAIN") + SystemConfig.p.getProperty("IMAGEURL").replace("{PICFILENAME}", fileName);
consultSheet.setPrescription(url);
}
}
consultSheet.setAccountsId(mpAccountsEntity.getId()); consultSheet.setAccountsId(mpAccountsEntity.getId());
consultSheet.setPrescription(url);
if (consultSheetMapper.save(consultSheet) > 0) { if (consultSheetMapper.save(consultSheet) > 0) {
memberProcess(consultSheet.getOpenId(), consultSheet); memberProcess(consultSheet.getOpenId(), consultSheet);
...@@ -127,7 +128,7 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im ...@@ -127,7 +128,7 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
//展示客服二维码 //展示客服二维码
Qyuser serviceCus = qyuserService.fetchById(consultSheet.getServiceId()); Qyuser serviceCus = qyuserService.fetchById(consultSheet.getServiceId());
retObj.put("errorNo", 0); retObj.put("errorNo", 0);
retObj.put("data", serviceCus.getQrcode()); retObj.put("data", serviceCus.getDescription());
retObj.put("errorMsg", "咨询单提交成功,请等待药师审核"); retObj.put("errorMsg", "咨询单提交成功,请等待药师审核");
} else { } else {
retObj.put("errorNo", 1); retObj.put("errorNo", 1);
...@@ -176,31 +177,34 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im ...@@ -176,31 +177,34 @@ public class ConsultSheetServiceImpl extends GenericServiceImpl<ConsultSheet> im
conds.in("o.status", new String[]{"2", "3", "4"});//2 待发货,3:待收货 4:待付款 conds.in("o.status", new String[]{"2", "3", "4"});//2 待发货,3:待收货 4:待付款
int count = orderService.count(conds); int count = orderService.count(conds);
if (count > 0) { //复购 if (count > 0) { //复购
// Conds memberConds = new Conds(); Conds memberConds = new Conds();
// memberConds.equal("del_flag", Constants.DEL_FLAG_0); memberConds.equal("del_flag", Constants.DEL_FLAG_0);
// memberConds.equal("open_id", openid); memberConds.equal("open_id", openid);
// Member member = memberService.fetchSearchByConds(memberConds); Member member = memberService.fetchSearchByConds(memberConds);
// if (member == null) {
// String serviceId = member.getServiceId(); firstCustomerProcess(consultSheet);
// Conds userConds = new Conds(); }
// userConds.equal("t.del_flag", Constants.DEL_FLAG_0);
// userConds.equal("t.id", serviceId); String serviceId = member.getServiceId();
// Qyuser user = qyuserService.fetchSearchByConds(userConds); Conds userConds = new Conds();
// if (user.getPeakVal() > 0) {//客服峰值大于0 userConds.equal("t.del_flag", Constants.DEL_FLAG_0);
// consultSheet.setServiceId(user.getId()); userConds.equal("t.id", serviceId);
// //推送消息 Qyuser user = qyuserService.fetchSearchByConds(userConds);
// } else {//普通轮询 if (user.getPeakVal() > 0) {//客服峰值大于0
// firstCustomerProcess(consultSheet); consultSheet.setServiceId(user.getId());
// } //推送消息
// } else {//普通轮询
// String doctorId = member.getDoctorId();
// userConds.equal("t.id", doctorId);
// user = qyuserService.fetchSearchByConds(userConds);
// if (user.getPeakVal() > 0) {//药师峰值大于0
// consultSheet.setDoctorId(user.getId());
// } else {//普通轮询
firstCustomerProcess(consultSheet); firstCustomerProcess(consultSheet);
//} }
String doctorId = member.getDoctorId();
userConds.equal("t.id", doctorId);
user = qyuserService.fetchSearchByConds(userConds);
if (user.getPeakVal() > 0) {//药师峰值大于0
consultSheet.setDoctorId(user.getId());
} else {//普通轮询
firstCustomerProcess(consultSheet);
}
} else {//首次购买 } else {//首次购买
firstCustomerProcess(consultSheet); firstCustomerProcess(consultSheet);
} }
......
...@@ -273,12 +273,12 @@ public class ConsultSheetController { ...@@ -273,12 +273,12 @@ public class ConsultSheetController {
*/ */
@RequestMapping(value = "/updateData") @RequestMapping(value = "/updateData")
@ResponseBody @ResponseBody
public JSONObject updateData(String consultId, String status, String description ,HttpServletRequest request) { public JSONObject updateData(Long consultId, String status, String description ,HttpServletRequest request) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
ConsultSheet consultSheet = consultSheetService.fetchById(Long.parseLong(consultId)); ConsultSheet consultSheet = consultSheetService.fetchById(consultId);
consultSheet.setDescription(description); consultSheet.setDescription(description);
try { try {
if (StringUtils.isNoneBlank(consultId) && StringUtils.isNoneBlank(status) && StringUtils.isNoneBlank(description)) { if (consultId != null && StringUtils.isNoneBlank(status) && StringUtils.isNoneBlank(description)) {
Integer integer = consultSheetService.updateDate(consultId, status, description); Integer integer = consultSheetService.updateDate(consultId, status, description);
if (integer>0) { if (integer>0) {
//发送审核通过模板消息 //发送审核通过模板消息
...@@ -327,12 +327,12 @@ public class ConsultSheetController { ...@@ -327,12 +327,12 @@ public class ConsultSheetController {
@RequiresPermissions(value = CONSULTSHEET_EDIT) @RequiresPermissions(value = CONSULTSHEET_EDIT)
@RequestMapping("/updateStatus") @RequestMapping("/updateStatus")
@ResponseBody @ResponseBody
public JSONObject updateStatus(String consultId, String status, Long pastRecords, Long allergy, HttpServletRequest request) { public JSONObject updateStatus(Long consultId, String status, Long pastRecords, Long allergy, HttpServletRequest request) {
Long accountId = UserUtils.getmpaccounts(request); Long accountId = UserUtils.getmpaccounts(request);
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
ConsultSheet consultSheet = consultSheetService.fetchById(Long.parseLong(consultId)); ConsultSheet consultSheet = consultSheetService.fetchById(consultId);
try { try {
if (StringUtils.isNoneBlank(consultId) && StringUtils.isNoneBlank(status)) { if (consultId != null && StringUtils.isNoneBlank(status)) {
Integer integer = consultSheetService.updateStatus(consultId, status); Integer integer = consultSheetService.updateStatus(consultId, status);
if (integer > 0){ if (integer > 0){
......
...@@ -108,7 +108,10 @@ ...@@ -108,7 +108,10 @@
allergy, allergy,
symptom, symptom,
open_id, open_id,
consult_id consultId consult_id consultId,
status,
drugs_id drugsId,
address_id addressId
</sql> </sql>
<insert id="save" parameterType="com.cftech.consultsheet.model.ConsultSheet" useGeneratedKeys="true" <insert id="save" parameterType="com.cftech.consultsheet.model.ConsultSheet" useGeneratedKeys="true"
...@@ -177,14 +180,14 @@ ...@@ -177,14 +180,14 @@
) )
</insert> </insert>
<select id="fetchById" parameterType="java.lang.Long" resultMap="com.cftech.consultsheet.model.ConsultSheet"> <select id="fetchById" parameterType="java.lang.Long" resultType="com.cftech.consultsheet.model.ConsultSheet">
SELECT SELECT
<include refid="sqlColumns"/>, d.name pharmacist,e.org_name hospital <include refid="sqlColumns"/>, d.name pharmacist,e.org_name hospital
FROM t_aidea_consult_sheet a FROM t_aidea_consult_sheet a
LEFT JOIN t_qyuser b ON b.id = a.doctor_id LEFT JOIN t_qyuser b ON b.id = a.doctor_id
LEFT JOIN t_qyuser c ON c.id = a.service_id LEFT JOIN t_qyuser c ON c.id = a.service_id
LEFT JOIN t_qyuser d ON d.id = a.past_records LEFT JOIN t_qyuser d ON d.id = a.past_records
LEFT JOIN t_qyuser e ON e.id = a.allergy LEFT JOIN t_orgunit e ON e.id = a.allergy
WHERE a.id = #{id} WHERE a.id = #{id}
</select> </select>
......
...@@ -388,7 +388,11 @@ ...@@ -388,7 +388,11 @@
"aTargets": [6], "aTargets": [6],
"mData": "nickName", "mData": "nickName",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return a; if (a) {
return a.slice(0, 1) + '*' + a.slice(2, 3);
} else {
return null;
}
} }
} }
, ,
...@@ -476,7 +480,7 @@ ...@@ -476,7 +480,7 @@
html += '<li><a href="#springUrl("/a/order/form?id=' + a + '")">添加商品</a></li>'; html += '<li><a href="#springUrl("/a/order/form?id=' + a + '")">添加商品</a></li>';
} }
if (c.status == '1') { if (c.status == '1') {
html += '<li><a onclick="updateStatusSuccess(' + a + ')">订单付款</a></li>'; html += '<li><a onclick="updateStatusSuccess(' + a + ',' + c.openid + ')">订单付款</a></li>';
} }
if (c.status != '4' && c.status != '5') { if (c.status != '4' && c.status != '5') {
html += '<li><a onclick="updateStatus(' + a + ')">订单关闭</a></li>'; html += '<li><a onclick="updateStatus(' + a + ')">订单关闭</a></li>';
...@@ -518,7 +522,7 @@ ...@@ -518,7 +522,7 @@
btntext: "确定", btntext: "确定",
btncanceltext: "取消", btncanceltext: "取消",
success: function () { success: function () {
updateStatu(id, 5); updateStatu(id, null, 5);
}, },
cancel: function () { cancel: function () {
...@@ -527,13 +531,13 @@ ...@@ -527,13 +531,13 @@
}); });
} }
function updateStatusSuccess(id) { function updateStatusSuccess(id, openid) {
Cfapp.confirm({ Cfapp.confirm({
message: "是否确认付款", message: "是否确认付款",
btntext: "确定", btntext: "确定",
btncanceltext: "取消", btncanceltext: "取消",
success: function () { success: function () {
updateStatu(id, 3);//付款待发货 updateStatu(id, openid, 3);//付款待发货
}, },
cancel: function () { cancel: function () {
location.href = "#springUrl('/a/order/list')"; location.href = "#springUrl('/a/order/list')";
...@@ -541,13 +545,14 @@ ...@@ -541,13 +545,14 @@
}); });
} }
function updateStatu(id, status) { function updateStatu(id, openid, status) {
var url = "#springUrl('/a/order/updateStatus')" var url = "#springUrl('/a/order/updateStatus')"
$.ajax({ $.ajax({
url: url, url: url,
type: "GET", type: "GET",
data: {id: id, data: {id: id,
status: status}, openid: openid,
status: status},
success: function (rsp) { success: function (rsp) {
console.log(rsp); console.log(rsp);
if (rsp.errorNo == "0") { if (rsp.errorNo == "0") {
......
...@@ -266,7 +266,6 @@ public class OrderController { ...@@ -266,7 +266,6 @@ public class OrderController {
} catch (IOException e) { } catch (IOException e) {
log.error(e.getMessage()); log.error(e.getMessage());
} }
return list(request, model); return list(request, model);
} }
...@@ -275,18 +274,20 @@ public class OrderController { ...@@ -275,18 +274,20 @@ public class OrderController {
model.addAttribute("isDetail",'y'); model.addAttribute("isDetail",'y');
return orderDetailsController.list(request,model,id); return orderDetailsController.list(request,model,id);
} }
@RequestMapping("/deleteAll") @RequestMapping("/deleteAll")
@ResponseBody @ResponseBody
public JSONObject deleteAll(Long id) { public JSONObject deleteAll(Long id) {
return orderService.deleteAll(id); return orderService.deleteAll(id);
} }
@RequestMapping("/updateStatus") @RequestMapping("/updateStatus")
@ResponseBody @ResponseBody
public JSONObject updateStatus(Long id, String status, HttpServletRequest request) { public JSONObject updateStatus(Long id, String openid, String status, HttpServletRequest request) {
JSONObject rtnJson = new JSONObject(); JSONObject rtnJson = new JSONObject();
Integer integer = orderService.updateStatus(id, status); Integer integer = orderService.updateStatus(id, status);
if (integer>0){ //设置已付款
if (integer > 0){
rtnJson.put("errorNo","0"); rtnJson.put("errorNo","0");
return rtnJson; return rtnJson;
} }
......
...@@ -206,26 +206,26 @@ ...@@ -206,26 +206,26 @@
"mData": "id" "mData": "id"
}, },
{ {
"mData":"classifyName" "mData": "classifyName"
}, },
{ {
"mData":"classifyNumber" "mData": "classifyNumber"
}, },
{ {
"mData":"sort" "mData": "sort"
}, },
{ {
"mData":"parentId" "mData": "parentId"
} }
, ,
{ {
"mData":"parentName" "mData": "parentName"
}, },
{ {
"mData":"whetherRecommend" "mData": "whetherRecommend"
}, },
{ {
"mData":"description" "mData": "description"
}, },
{ {
"mData": "createTime" "mData": "createTime"
...@@ -239,43 +239,35 @@ ...@@ -239,43 +239,35 @@
'targets': [0] 'targets': [0]
}, },
{ {
"aTargets":[4], "aTargets": [4],
"mData":"parentId", "mData": "parentId",
"mRender":function(a, b, c, d){ "mRender": function (a, b, c, d) {
if (a==0){ if (a == 0) {
return "一级"; return "一级";
} }
return "二级"; return "二级";
} }
}, },
{ {
"aTargets":[5], "aTargets": [5],
"mData":"parentName", "mData": "parentName",
"mRender":function(a, b, c, d){ "mRender": function (a, b, c, d) {
if (a==0 || a==null){ if (a == 0 || a == null) {
return ""; return "";
} }
return a; return a;
} }
}, },
{ {
"aTargets":[6], "aTargets": [8],
"mData":"classifyImg",
"mRender":function(a, b, c, d){
return "<img src='"+a+"' style='width: 80px;height: 80px;'>";
}
},
{
"aTargets": [9],
"mData": "createTime", "mData": "createTime",
"mRender": function (a, b, c, d) { "mRender": function (a, b, c, d) {
return formatDates(a, "yyyy-MM-dd HH:mm:ss"); return formatDates(a, "yyyy-MM-dd HH:mm:ss");
} }
}, },
{ {
"aTargets": [10], "aTargets": [9],
"mData": "id", "mData": "id",
"mRender": function (a, b, c, d) {//a表示id对应的值,c表示当前记录行对象 "mRender": function (a, b, c, d) {//a表示id对应的值,c表示当前记录行对象
var html = '#if($shiro.hasPermission("qy:productclassify:edit"))';// var html = '#if($shiro.hasPermission("qy:productclassify:edit"))';//
...@@ -318,7 +310,7 @@ ...@@ -318,7 +310,7 @@
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "#springUrl('/a/productclassify/delete')", url: "#springUrl('/a/productclassify/delete')",
data: {id: data, _csrfheader: csrfheader.value, _csrf: csrftoken.value }, data: {id: data, _csrfheader: csrfheader.value, _csrf: csrftoken.value},
dataType: "json", dataType: "json",
success: function (data) { success: function (data) {
if (data.errorNo == 0) { if (data.errorNo == 0) {
......
...@@ -8,30 +8,30 @@ import java.io.Serializable; ...@@ -8,30 +8,30 @@ import java.io.Serializable;
import java.util.Date; import java.util.Date;
/** /**
* 产品分类 * 产品分类
* *
* @author Buyj * @author Buyj
* @date: 2020-09-22 18:06 * @date: 2020-09-22 18:06
*/ */
@Data @Data
public class Productclassify implements Serializable { public class Productclassify implements Serializable {
/* 主键id */ /* 主键id */
private Long id; private Long id;
/* 分类名称 */ /* 分类名称 */
@ExportConfig(value = "分类名称", width = 100, showLevel = 2) @ExportConfig(value = "分类名称", width = 100, showLevel = 2)
private String classifyName; private String classifyName;
/* 分类编码 */ /* 分类编码 */
@ExportConfig(value = "分类编码", width = 100, showLevel = 2) @ExportConfig(value = "分类编码", width = 100, showLevel = 2)
private String classifyNumber; private String classifyNumber;
/* 分类banner图 */ /* 分类banner图 */
@ExportConfig(value = "分类banner图", width = 100, showLevel = 1) @ExportConfig(value = "分类banner图", width = 100, showLevel = 1)
private String classifyImg; private String classifyImg;
/* 序号 */ /* 序号 */
@ExportConfig(value = "序号", width = 100, showLevel = 2) @ExportConfig(value = "序号", width = 100, showLevel = 2)
private String sort; private String sort;
/* 是否推荐 */ /* 是否推荐 */
@ExportConfig(value = "是否推荐(是/否)", width = 200, showLevel = 2) @ExportConfig(value = "是否推荐(是/否)", width = 200, showLevel = 2)
private String whetherRecommend; private String whetherRecommend;
/** /**
* 父级ID * 父级ID
...@@ -46,26 +46,26 @@ public class Productclassify implements Serializable { ...@@ -46,26 +46,26 @@ public class Productclassify implements Serializable {
* 父级编码 * 父级编码
*/ */
private String parentNumber; private String parentNumber;
/* 所属的账号 */ /* 所属的账号 */
private Long accountsId; private Long accountsId;
/* 删除标识 */ /* 删除标识 */
private boolean delFlag; private boolean delFlag;
/* 状态 */ /* 状态 */
private String status; private String status;
/* 创建时间 */ /* 创建时间 */
private Date createTime; private Date createTime;
/* 更新时间 */ /* 更新时间 */
private Date updateTime; private Date updateTime;
/* 备注 */ /* 备注 */
private String description; private String description;
/* 创建人 */ /* 创建人 */
private Long createBy; private Long createBy;
/* 更新人 */ /* 更新人 */
private Long updateBy; private Long updateBy;
public Productclassify() { public Productclassify() {
this.delFlag = false; this.delFlag = false;
this.status = "0"; this.status = "0";
} }
} }
\ No newline at end of file
...@@ -113,7 +113,7 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi ...@@ -113,7 +113,7 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId); MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId);
List<ProductVO> hotproduct = productclassifyMapper.hotproduct(); List<ProductVO> hotproduct = productclassifyMapper.hotproduct();
if (hotproduct==null){ if (hotproduct==null){
rtnJson.put("errorNO","1"); rtnJson.put("errorNo","1");
rtnJson.put("errorMsg","查询失败"); rtnJson.put("errorMsg","查询失败");
return rtnJson; return rtnJson;
} }
...@@ -122,7 +122,7 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi ...@@ -122,7 +122,7 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi
rtnJson.put("data",hotproduct); rtnJson.put("data",hotproduct);
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
rtnJson.put("errorNO","1"); rtnJson.put("errorNo","1");
} }
return rtnJson; return rtnJson;
...@@ -135,7 +135,7 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi ...@@ -135,7 +135,7 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId); MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId);
List<ProductVO> medicine = productclassifyMapper.medicine(); List<ProductVO> medicine = productclassifyMapper.medicine();
if (medicine==null){ if (medicine==null){
rtnJson.put("errorNO","1"); rtnJson.put("errorNo","1");
rtnJson.put("errorMsg","查询失败"); rtnJson.put("errorMsg","查询失败");
return rtnJson; return rtnJson;
} }
...@@ -144,7 +144,7 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi ...@@ -144,7 +144,7 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi
rtnJson.put("data",medicine); rtnJson.put("data",medicine);
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
rtnJson.put("errorNO","1"); rtnJson.put("errorNo","1");
} }
return rtnJson; return rtnJson;
...@@ -163,7 +163,7 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi ...@@ -163,7 +163,7 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId); MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId);
List<ProductVO> productVOS = productclassifyMapper.productDosage(); List<ProductVO> productVOS = productclassifyMapper.productDosage();
if (productVOS==null){ if (productVOS==null){
rtnJson.put("errorNO","1"); rtnJson.put("errorNo","1");
rtnJson.put("errorMsg","查询失败"); rtnJson.put("errorMsg","查询失败");
return rtnJson; return rtnJson;
} }
...@@ -172,7 +172,7 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi ...@@ -172,7 +172,7 @@ public class ProductclassifyServiceImpl extends GenericServiceImpl<Productclassi
rtnJson.put("data",productVOS); rtnJson.put("data",productVOS);
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
rtnJson.put("errorNO","1"); rtnJson.put("errorNo","1");
} }
return rtnJson; return rtnJson;
......
...@@ -174,17 +174,17 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P ...@@ -174,17 +174,17 @@ public class ProductServiceImpl extends GenericServiceImpl<Product> implements P
try { try {
List<ProductVO> product = productMapper.product(id); List<ProductVO> product = productMapper.product(id);
if (product==null){ if (product==null){
rtnJson.put("errorNO","1"); rtnJson.put("errorNo","1");
rtnJson.put("errorMsg","查询失败"); rtnJson.put("errorMsg","查询失败");
return rtnJson; return rtnJson;
} }
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId); MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(appId);
Log.info("返回结果:"+product); Log.info("返回结果:"+product);
rtnJson.put("errorNO","0"); rtnJson.put("errorNo","0");
rtnJson.put("data",product); rtnJson.put("data",product);
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
rtnJson.put("errorNO","1"); rtnJson.put("errorNo","1");
} }
return rtnJson; return rtnJson;
} }
......
432503199206040032,432503199203056646
\ No newline at end of file
package com.cftech.member.model; package com.cftech.member.model;
import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data; import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
...@@ -44,6 +43,8 @@ public class MemberVO { ...@@ -44,6 +43,8 @@ public class MemberVO {
* 会员编码 * 会员编码
*/ */
private String number; private String number;
/**
* 是否三期患者
*/
private String compan; private String compan;
} }
...@@ -128,7 +128,7 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A ...@@ -128,7 +128,7 @@ public class AddressServiceImpl extends GenericServiceImpl<Address> implements A
} }
MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(address.getAppId()); MpAccountsEntity mpAccountsAppid = mpAccountsService.getMpAccountsAppid(address.getAppId());
newAddress.setOpenId(address.getOpenId()); newAddress.setOpenId(address.getOpenId());
newAddress.setAccountsId(address.getAccountsId()); newAddress.setAccountsId(mpAccountsAppid.getId());
newAddress.setAddressName(address.getAddressName()); newAddress.setAddressName(address.getAddressName());
newAddress.setPhone(address.getPhone()); newAddress.setPhone(address.getPhone());
newAddress.setAddress(address.getAddress()); newAddress.setAddress(address.getAddress());
......
...@@ -70,7 +70,7 @@ public class MobileAddressController { ...@@ -70,7 +70,7 @@ public class MobileAddressController {
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
rtnJson.put("errorNO", "1"); rtnJson.put("errorNo", "1");
} }
return rtnJson; return rtnJson;
......
...@@ -54,7 +54,18 @@ ...@@ -54,7 +54,18 @@
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]--> <![endif]-->
<link rel="stylesheet" href="common/css/uePicPicker.css">
</head> </head>
<style>
.previewImg {
border: 0px;
display: none;
z-index: 999;
max-height: 100%;
max-width: 100%
}
</style>
<!-- END HEAD --> <!-- END HEAD -->
<body class="hold-transition skin-blue sidebar-mini"> <body class="hold-transition skin-blue sidebar-mini">
...@@ -192,6 +203,9 @@ ...@@ -192,6 +203,9 @@
<input type="checkbox" name="sex"/> <input type="checkbox" name="sex"/>
</div> </div>
</div> </div>
<div class="form-group form-md-line-input col-md-12" id="img">
</div>
<!-- <div class="form-group form-md-line-input col-md-4"> <!-- <div class="form-group form-md-line-input col-md-4">
<label>是否可核销</label> <label>是否可核销</label>
<div class="switch"> <div class="switch">
...@@ -262,12 +276,16 @@ ...@@ -262,12 +276,16 @@
<script src="plugins/bootstrap-switch/bootstrap-switch.min.js"></script> <script src="plugins/bootstrap-switch/bootstrap-switch.min.js"></script>
<script src="common/js/cfapp.js"></script> <script src="common/js/cfapp.js"></script>
<script src="plugins/security/sha256.js" type="text/javascript"></script> <script src="plugins/security/sha256.js" type="text/javascript"></script>
<script src="js/jquery.serializejson.js"></script>
<script src="plugins/jquery-validation/js/localization/messages_zh.js"></script>
<script src="plugins/Sortable/Sortable.min.js"></script>
<script src="common/component/uePicPicker.js"></script>
<!-- END PAGE LEVEL PLUGINS --> <!-- END PAGE LEVEL PLUGINS -->
<script> <script>
$().ready(function () { $().ready(function () {
Cfapp.init(); Cfapp.init();
formAdd.init(); formAdd.init();
initPicsSel();
if ($("#loginNameQyUser").val() == null || $("#loginNameQyUser").val() == "") { if ($("#loginNameQyUser").val() == null || $("#loginNameQyUser").val() == "") {
$("#loginNameQyUser").val(""); $("#loginNameQyUser").val("");
} }
...@@ -276,6 +294,48 @@ ...@@ -276,6 +294,48 @@
} }
}); });
var coverPP = null;
var initPicsSel = function () {
var smallimg = "$!{data.img}";
coverPP = new uePicPicker({
tarId: 'img',
title: '栏目小图',
sizeDes: '205*202',
max: 1,
datas: smallimg=='' ? null : smallimg.split(","),
success: null
});
coverPP.init();
};
var img = $("#img").val();
var protocol = window.location.protocol;
var host = window.location.host;
if (img && img != null) {
if (img.substring(0, 7) == "http://") {
$("#previewImg").attr("src", img).show();
} else {
$("#previewImg").attr("src", protocol + '//' + host + img).show();
}
$("#previewImg").siblings("i").remove();
}
/**
* 小图选择
*/
$("#ImgSelect").click(function () {
obj = $(this);
Cfapp.sm({
title: "栏目图选择",
success: function (data) {
obj.find("i").remove();
$("#img").val(data[0]);
$("#previewImg").attr("src", data[0]).show();
}
})
});
var formAdd = function () { var formAdd = function () {
...@@ -344,6 +404,8 @@ ...@@ -344,6 +404,8 @@
}); });
$(".select2").select2(); $(".select2").select2();
$('#orgSelect').on('click', $('#orgSelect').on('click',
function () { function () {
...@@ -496,11 +558,15 @@ ...@@ -496,11 +558,15 @@
$('#isVer').val('1'); $('#isVer').val('1');
} }
var dataJson = $("#myForm").serializeJSON();
var cover = coverPP.getStringValues();
dataJson.img = cover.substring(0, cover.lastIndexOf(','));
if ($("#passwordQyUser").val() != null && $("#passwordQyUser").val() != "") { if ($("#passwordQyUser").val() != null && $("#passwordQyUser").val() != "") {
var password = sha256_digest($("#passwordQyUser").val()); var password = sha256_digest($("#passwordQyUser").val());
$("#passwordQyUser").val(password); $("#passwordQyUser").val(password);
} }
$.post("#springUrl('/a/qyuser/formData')", $("#myForm").serialize(), function (returnobj) { $.post("#springUrl('/a/qyuser/formData')", dataJson, function (returnobj) {
$("#save").attr("disabled", false); $("#save").attr("disabled", false);
if (returnobj.errorNo == 2) { //保存成功 if (returnobj.errorNo == 2) { //保存成功
Cfapp.confirm({ Cfapp.confirm({
......
...@@ -2,83 +2,83 @@ ...@@ -2,83 +2,83 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.cftech.base.org.dao.QyuserMapper"> <mapper namespace="com.cftech.base.org.dao.QyuserMapper">
<resultMap id="resultMap" type="com.cftech.base.org.model.Qyuser"> <resultMap id="resultMap" type="com.cftech.base.org.model.Qyuser">
<id column="id" property="id" /> <id column="id" property="id"/>
<result column="name" property="name" /> <result column="name" property="name"/>
<result column="qrcode" property="qrcode" /> <result column="qrcode" property="qrcode"/>
<result column="avatar" property="avatar" /> <result column="avatar" property="avatar"/>
<result column="mobile" property="mobile" /> <result column="mobile" property="mobile"/>
<result column="email" property="email" /> <result column="email" property="email"/>
<result column="role" property="role" /> <result column="role" property="role"/>
<result column="store_id" property="storeId" /> <result column="store_id" property="storeId"/>
<result column="store_name" property="storeName" /> <result column="store_name" property="storeName"/>
<result column="wxno" property="wxno" /> <result column="wxno" property="wxno"/>
<result column="gender" property="gender" /> <result column="gender" property="gender"/>
<result column="accounts_id" property="accountsId" /> <result column="accounts_id" property="accountsId"/>
<result column="position_id" property="positionId" /> <result column="position_id" property="positionId"/>
<result column="wxuser_id" property="wxuserId" /> <result column="wxuser_id" property="wxuserId"/>
<result column="org_id" property="orgId" /> <result column="org_id" property="orgId"/>
<result column="tag_ids" property="tagIds" /> <result column="tag_ids" property="tagIds"/>
<result column="status" property="status" /> <result column="status" property="status"/>
<result column="create_time" property="createTime" /> <result column="create_time" property="createTime"/>
<result column="update_time" property="updateTime" /> <result column="update_time" property="updateTime"/>
<result column="description" property="description" /> <result column="description" property="description"/>
<result column="del_flag" property="delFlag" /> <result column="del_flag" property="delFlag"/>
<result column="create_by" property="createBy" /> <result column="create_by" property="createBy"/>
<result column="update_by" property="updateBy" /> <result column="update_by" property="updateBy"/>
<result column="user_type" property="userType" /> <result column="user_type" property="userType"/>
<result column="peak_val" property="peakVal" /> <result column="peak_val" property="peakVal"/>
<result column="assigned" property="assigned"/> <result column="assigned" property="assigned"/>
<result column="un_assigned" property="unAssigned"/> <result column="un_assigned" property="unAssigned"/>
</resultMap> </resultMap>
<resultMap id="resultMapVO" type="com.cftech.base.org.model.vo.QyuserVO"> <resultMap id="resultMapVO" type="com.cftech.base.org.model.vo.QyuserVO">
<id column="id" property="id" /> <id column="id" property="id"/>
<result column="avatar" property="avatar" /> <result column="avatar" property="avatar"/>
<result column="qrcode" property="qrcode" /> <result column="qrcode" property="qrcode"/>
<result column="role" property="role" /> <result column="role" property="role"/>
<result column="position_name" property="positionName" /> <result column="position_name" property="positionName"/>
<result column="store_name" property="storeName" /> <result column="store_name" property="storeName"/>
<result column="org_name" property="orgName" /> <result column="org_name" property="orgName"/>
<result column="name" property="name" /> <result column="name" property="name"/>
<result column="mobile" property="mobile" /> <result column="mobile" property="mobile"/>
<result column="wxno" property="wxno" /> <result column="wxno" property="wxno"/>
<result column="email" property="email" /> <result column="email" property="email"/>
<result column="wxuser_id" property="wxuserId" /> <result column="wxuser_id" property="wxuserId"/>
<result column="user_type" property="userType" /> <result column="user_type" property="userType"/>
<result column="gender" property="gender" /> <result column="gender" property="gender"/>
</resultMap> </resultMap>
<sql id="sqlWhere"> <sql id="sqlWhere">
<if test="conds!=null"> <if test="conds!=null">
<trim prefix="WHERE" prefixOverrides="AND|OR"> <trim prefix="WHERE" prefixOverrides="AND|OR">
<foreach collection="conds.conds" index="index" item="cond"> <foreach collection="conds.conds" index="index" item="cond">
${cond.linkType} ${cond.linkType}
<if test="cond.condType == 'EQUAL'">${cond.param} = #{cond.value}</if> <if test="cond.condType == 'EQUAL'">${cond.param} = #{cond.value}</if>
<if test="cond.condType == 'NOTEQUAL'">${cond.param} &lt;&gt; #{cond.value}</if> <if test="cond.condType == 'NOTEQUAL'">${cond.param} &lt;&gt; #{cond.value}</if>
<if test="cond.condType == 'GREATEQUAL'">${cond.param} &gt;= #{cond.value}</if> <if test="cond.condType == 'GREATEQUAL'">${cond.param} &gt;= #{cond.value}</if>
<if test="cond.condType == 'GREATTHAN'">${cond.param} &gt; #{cond.value}</if> <if test="cond.condType == 'GREATTHAN'">${cond.param} &gt; #{cond.value}</if>
<if test="cond.condType == 'LESSEQUAL'">${cond.param} &lt;= #{cond.value}</if> <if test="cond.condType == 'LESSEQUAL'">${cond.param} &lt;= #{cond.value}</if>
<if test="cond.condType == 'LESSTHAN'">${cond.param} &lt; #{cond.value}</if> <if test="cond.condType == 'LESSTHAN'">${cond.param} &lt; #{cond.value}</if>
<if test="cond.condType == 'BETWEEN'">${cond.param} BETWEEN #{cond.startValue} AND <if test="cond.condType == 'BETWEEN'">${cond.param} BETWEEN #{cond.startValue} AND
#{cond.endValue} #{cond.endValue}
</if> </if>
<if test="cond.condType == 'ISNULL'">${cond.param} IS NULL</if> <if test="cond.condType == 'ISNULL'">${cond.param} IS NULL</if>
<if test="cond.condType == 'NOTNULL'">${cond.param} IS NOT NULL</if> <if test="cond.condType == 'NOTNULL'">${cond.param} IS NOT NULL</if>
<if test="cond.condType == 'LIKE'">${cond.param} LIKE #{cond.value}</if> <if test="cond.condType == 'LIKE'">${cond.param} LIKE #{cond.value}</if>
<if test="cond.condType == 'IN'"> <if test="cond.condType == 'IN'">
${cond.param} IN ${cond.param} IN
<foreach item="item" index="index" collection="cond.value" <foreach item="item" index="index" collection="cond.value"
open="(" separator="," close=")"> open="(" separator="," close=")">
#{item} #{item}
</foreach> </foreach>
</if> </if>
</foreach> </foreach>
</trim> </trim>
</if> </if>
</sql> </sql>
<sql id="sqlColumns"> <sql id="sqlColumns">
id, name, qrcode, avatar, mobile, email, role, wxno, gender, accounts_id, id, name, qrcode, avatar, mobile, email, role, wxno, gender, accounts_id,
position_id, store_id, store_name, wxuser_id, org_id, tag_ids, status, create_time, position_id, store_id, store_name, wxuser_id, org_id, tag_ids, status, create_time,
update_time, description, del_flag, create_by, update_by, user_type, peak_val, assigned, un_assigned update_time, description, del_flag, create_by, update_by, user_type, peak_val, assigned, un_assigned
...@@ -90,8 +90,8 @@ ...@@ -90,8 +90,8 @@
t.update_time, t.description, t.del_flag, t.create_by, t.update_by, user_type, peak_val, assigned, un_assigned t.update_time, t.description, t.del_flag, t.create_by, t.update_by, user_type, peak_val, assigned, un_assigned
</sql> </sql>
<insert id="save" parameterType="com.cftech.base.org.model.Qyuser" <insert id="save" parameterType="com.cftech.base.org.model.Qyuser"
keyProperty="id" useGeneratedKeys="true"> keyProperty="id" useGeneratedKeys="true">
insert into t_qyuser insert into t_qyuser
( (
id, name, qrcode, id, name, qrcode,
...@@ -121,7 +121,7 @@ ...@@ -121,7 +121,7 @@
) )
</insert> </insert>
<select id="fetchById" parameterType="java.lang.Long" resultMap="resultMap"> <select id="fetchById" parameterType="java.lang.Long" resultMap="resultMap">
SELECT SELECT
t.id, t.name, t.qrcode, t.avatar, t.mobile, t.email, t.role, t.wxno, t.gender, t.accounts_id, t.id, t.name, t.qrcode, t.avatar, t.mobile, t.email, t.role, t.wxno, t.gender, t.accounts_id,
t.store_id, t.store_name, t.wxuser_id, t.org_id, t.tag_ids, t.status, t.create_time, t.store_id, t.store_name, t.wxuser_id, t.org_id, t.tag_ids, t.status, t.create_time,
...@@ -131,385 +131,387 @@ ...@@ -131,385 +131,387 @@
WHERE t.id=#{id} WHERE t.id=#{id}
</select> </select>
<select id="count" parameterType="java.util.Map" resultType="java.lang.Integer"> <select id="count" parameterType="java.util.Map" resultType="java.lang.Integer">
SELECT COUNT(1) FROM t_qyuser t SELECT COUNT(1) FROM t_qyuser t
left join t_orgunit o on o.id = t.org_id left join t_orgunit o on o.id = t.org_id
left join user u on u.userid=t.id left join user u on u.userid=t.id
<include refid="sqlWhere" /> <include refid="sqlWhere"/>
<if test="orgId > 0"> <if test="orgId > 0">
and instr(o.parent_ids,',${orgId},')>0 and instr(o.parent_ids,',${orgId},')>0
</if> </if>
</select> </select>
<select id="fetchSearchByPage" parameterType="java.util.Map" <select id="fetchSearchByPage" parameterType="java.util.Map"
resultMap="resultMap"> resultMap="resultMap">
SELECT SELECT
t.id, t.name, t.qrcode, t.avatar, t.mobile, t.email, t.role, t.wxno, t.gender, t.accounts_id, t.id, t.name, t.qrcode, t.avatar, t.mobile, t.email, t.role, t.wxno, t.gender, t.accounts_id,
t.store_id, t.store_name, t.wxuser_id, t.org_id, t.tag_ids, t.status, t.create_time, t.store_id, t.store_name, t.wxuser_id, t.org_id, t.tag_ids, t.status, t.create_time,
t.update_time, t.description, t.del_flag, t.create_by, t.update_by,u.username loginName, t.user_type, t.peak_val, t.assigned, t.un_assigned t.update_time, t.description, t.del_flag, t.create_by, t.update_by,u.username loginName, t.user_type,
FROM t_qyuser t t.peak_val, t.assigned, t.un_assigned
left join t_orgunit o on o.id = t.org_id FROM t_qyuser t
left join user u on u.userid=t.id left join t_orgunit o on o.id = t.org_id
<include refid="sqlWhere" /> left join user u on u.userid=t.id
<include refid="sqlWhere"/>
<if test="orgId > 0"> <if test="orgId > 0">
and instr(o.parent_ids,',${orgId},')>0 and instr(o.parent_ids,',${orgId},')>0
</if> </if>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if> <if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if> <if test="limit>0">limit #{offset},#{limit}</if>
</select> </select>
<update id="update" parameterType="com.cftech.base.org.model.Qyuser"> <update id="update" parameterType="com.cftech.base.org.model.Qyuser">
update t_qyuser update t_qyuser
<set> <set>
<if test="id != null"> <if test="id != null">
id = #{id, jdbcType=BIGINT}, id = #{id, jdbcType=BIGINT},
</if> </if>
<if test="name != null"> <if test="name != null">
name = #{name, jdbcType=VARCHAR}, name = #{name, jdbcType=VARCHAR},
</if> </if>
<if test="qrcode != null"> <if test="qrcode != null">
qrcode = #{qrcode, jdbcType=VARCHAR}, qrcode = #{qrcode, jdbcType=VARCHAR},
</if> </if>
<if test="avatar != null"> <if test="avatar != null">
avatar = #{avatar, jdbcType=VARCHAR}, avatar = #{avatar, jdbcType=VARCHAR},
</if> </if>
<if test="mobile != null"> <if test="mobile != null">
mobile = #{mobile, jdbcType=VARCHAR}, mobile = #{mobile, jdbcType=VARCHAR},
</if> </if>
<if test="email != null"> <if test="email != null">
email = #{email, jdbcType=VARCHAR}, email = #{email, jdbcType=VARCHAR},
</if> </if>
<if test="role != null"> <if test="role != null">
role = #{role, jdbcType=VARCHAR}, role = #{role, jdbcType=VARCHAR},
</if> </if>
<if test="wxno != null"> <if test="wxno != null">
wxno = #{wxno, jdbcType=VARCHAR}, wxno = #{wxno, jdbcType=VARCHAR},
</if> </if>
<if test="gender != null"> <if test="gender != null">
gender = #{gender, jdbcType=VARCHAR}, gender = #{gender, jdbcType=VARCHAR},
</if> </if>
<if test="accountsId != null"> <if test="accountsId != null">
accounts_id = #{accountsId, jdbcType=BIGINT}, accounts_id = #{accountsId, jdbcType=BIGINT},
</if> </if>
<if test="positionId != null"> <if test="positionId != null">
position_id = #{positionId, jdbcType=BIGINT}, position_id = #{positionId, jdbcType=BIGINT},
</if> </if>
<if test="storeId != null"> <if test="storeId != null">
store_id = #{storeId, jdbcType=BIGINT}, store_id = #{storeId, jdbcType=BIGINT},
</if> </if>
<if test="storeName != null"> <if test="storeName != null">
store_name = #{storeName, jdbcType=VARCHAR}, store_name = #{storeName, jdbcType=VARCHAR},
</if> </if>
<if test="wxuserId != null"> <if test="wxuserId != null">
wxuser_id = #{wxuserId, jdbcType=VARCHAR}, wxuser_id = #{wxuserId, jdbcType=VARCHAR},
</if> </if>
<if test="orgId != null"> <if test="orgId != null">
org_id = #{orgId, jdbcType=BIGINT}, org_id = #{orgId, jdbcType=BIGINT},
</if> </if>
<if test="tagIds != null"> <if test="tagIds != null">
tag_ids = #{tagIds, jdbcType=VARCHAR}, tag_ids = #{tagIds, jdbcType=VARCHAR},
</if> </if>
<if test="status != null"> <if test="status != null">
status = #{status, jdbcType=VARCHAR}, status = #{status, jdbcType=VARCHAR},
</if> </if>
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime, jdbcType=TIMESTAMP}, create_time = #{createTime, jdbcType=TIMESTAMP},
</if> </if>
<if test="updateTime != null"> <if test="updateTime != null">
update_time=now(), update_time=now(),
</if> </if>
<if test="description != null"> <if test="description != null">
description = #{description, jdbcType=VARCHAR}, description = #{description, jdbcType=VARCHAR},
</if> </if>
<if test="delFlag != null"> <if test="delFlag != null">
del_flag = #{delFlag, jdbcType=TINYINT}, del_flag = #{delFlag, jdbcType=TINYINT},
</if> </if>
<if test="createBy != null"> <if test="createBy != null">
create_by = #{createBy, jdbcType=BIGINT}, create_by = #{createBy, jdbcType=BIGINT},
</if> </if>
<if test="updateBy != null"> <if test="updateBy != null">
update_by = #{updateBy, jdbcType=BIGINT}, update_by = #{updateBy, jdbcType=BIGINT},
</if> </if>
<if test="userType != null"> <if test="userType != null">
user_type = #{userType, jdbcType=VARCHAR}, user_type = #{userType, jdbcType=VARCHAR},
</if> </if>
<if test="peakVal != null"> <if test="peakVal != null">
peak_val = #{peakVal, jdbcType=BIGINT}, peak_val = #{peakVal, jdbcType=BIGINT},
</if> </if>
<if test="assigned != null"> <if test="assigned != null">
assigned = #{assigned, jdbcType=BIGINT}, assigned = #{assigned, jdbcType=BIGINT},
</if> </if>
<if test="unAssigned != null"> <if test="unAssigned != null">
un_assigned = #{unAssigned, jdbcType=BIGINT}, un_assigned = #{unAssigned, jdbcType=BIGINT},
</if> </if>
</set> </set>
where id=#{id,jdbcType=BIGINT} where id=#{id,jdbcType=BIGINT}
</update> </update>
<update id="delete" parameterType="java.lang.Long"> <update id="delete" parameterType="java.lang.Long">
update t_qyuser set del_flag=1 update t_qyuser set del_flag=1
where id=#{id,jdbcType=BIGINT} where id=#{id,jdbcType=BIGINT}
</update> </update>
<select id="fetchSearchVOByPage" parameterType="java.util.Map" <select id="fetchSearchVOByPage" parameterType="java.util.Map"
resultMap="resultMapVO"> resultMap="resultMapVO">
SELECT SELECT
t.id id, t.qrcode qrcode, t.avatar avatar,t.role role, t.id id, t.qrcode qrcode, t.avatar avatar,t.role role,
o.org_name org_name, o.org_name org_name,
t.name name, t.mobile mobile, t.wxno wxno, t.email email,t.description, t.name name, t.mobile mobile, t.wxno wxno, t.email email,t.description,
t.wxuser_id t.wxuser_id
wxuser_id, wxuser_id,
u.username loginName, t.user_type, t.gender, qrcode.ticket qrcode, t.user_type, t.peak_val, t.assigned, t.un_assigned u.username loginName, t.user_type, t.gender, qrcode.ticket qrcode, t.user_type, t.peak_val, t.assigned,
FROM t_qyuser t t.un_assigned
left join t_orgunit o on o.id = t.org_id FROM t_qyuser t
left join user u on u.userid = t.id left join t_orgunit o on o.id = t.org_id
left join t_shop_wxqrcode qrcode on qrcode.bind_id = t.id AND (qrcode.type = '0' or qrcode.type = '1' or qrcode.type = '2') left join user u on u.userid = t.id
<include refid="sqlWhere" /> left join t_shop_wxqrcode qrcode on qrcode.bind_id = t.id AND qrcode.del_flag = '0' AND (qrcode.type = '0' or qrcode.type = '1' or qrcode.type = '2')
<include refid="sqlWhere"/>
<if test="orgId > 0"> <if test="orgId > 0">
and instr(o.parent_ids,',${orgId},')>0 and instr(o.parent_ids,',${orgId},')>0
</if> </if>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if>
</select>
<update id="changeStatus" parameterType="java.util.Map"> <if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
update t_qyuser set status=#{status, jdbcType=VARCHAR} <if test="limit>0">limit #{offset},#{limit}</if>
<include refid="sqlWhere" /> </select>
</update>
<update id="updateStoreInfo" parameterType="java.util.Map"> <update id="changeStatus" parameterType="java.util.Map">
update t_qyuser set status=#{status, jdbcType=VARCHAR}
<include refid="sqlWhere"/>
</update>
<update id="updateStoreInfo" parameterType="java.util.Map">
update t_qyuser update t_qyuser
set role=#{role, jdbcType=VARCHAR}, store_id = #{storeId, jdbcType=BIGINT}, store_name = #{storeName, jdbcType=VARCHAR} set role=#{role, jdbcType=VARCHAR}, store_id = #{storeId, jdbcType=BIGINT}, store_name = #{storeName, jdbcType=VARCHAR}
where id=#{id,jdbcType=BIGINT} where id=#{id,jdbcType=BIGINT}
</update> </update>
<update id="batchUpdate" parameterType="java.util.Map"> <update id="batchUpdate" parameterType="java.util.Map">
update t_qyuser update t_qyuser
<set> <set>
<if test="id != null"> <if test="id != null">
id = #{id, jdbcType=BIGINT}, id = #{id, jdbcType=BIGINT},
</if> </if>
<if test="name != null"> <if test="name != null">
name = #{name, jdbcType=VARCHAR}, name = #{name, jdbcType=VARCHAR},
</if> </if>
<if test="avatar != null"> <if test="avatar != null">
avatar = #{avatar, jdbcType=VARCHAR}, avatar = #{avatar, jdbcType=VARCHAR},
</if> </if>
<if test="mobile != null"> <if test="mobile != null">
mobile = #{mobile, jdbcType=VARCHAR}, mobile = #{mobile, jdbcType=VARCHAR},
</if> </if>
<if test="email != null"> <if test="email != null">
email = #{email, jdbcType=VARCHAR}, email = #{email, jdbcType=VARCHAR},
</if> </if>
<if test="role != null"> <if test="role != null">
role = #{role, jdbcType=VARCHAR}, role = #{role, jdbcType=VARCHAR},
</if> </if>
<if test="wxno != null"> <if test="wxno != null">
wxno = #{wxno, jdbcType=VARCHAR}, wxno = #{wxno, jdbcType=VARCHAR},
</if> </if>
<if test="gender != null"> <if test="gender != null">
gender = #{gender, jdbcType=VARCHAR}, gender = #{gender, jdbcType=VARCHAR},
</if> </if>
<if test="accountsId != null"> <if test="accountsId != null">
accounts_id = #{accountsId, jdbcType=BIGINT}, accounts_id = #{accountsId, jdbcType=BIGINT},
</if> </if>
<if test="positionId != null"> <if test="positionId != null">
position_id = #{positionId, jdbcType=BIGINT}, position_id = #{positionId, jdbcType=BIGINT},
</if> </if>
<if test="storeId != null"> <if test="storeId != null">
store_id = #{storeId, jdbcType=BIGINT}, store_id = #{storeId, jdbcType=BIGINT},
</if> </if>
<if test="storeName != null"> <if test="storeName != null">
store_name = #{storeName, jdbcType=VARCHAR}, store_name = #{storeName, jdbcType=VARCHAR},
</if> </if>
<if test="wxuserId != null"> <if test="wxuserId != null">
wxuser_id = #{wxuserId, jdbcType=VARCHAR}, wxuser_id = #{wxuserId, jdbcType=VARCHAR},
</if> </if>
<if test="orgId != null"> <if test="orgId != null">
org_id = #{orgId, jdbcType=BIGINT}, org_id = #{orgId, jdbcType=BIGINT},
</if> </if>
<if test="tagIds != null"> <if test="tagIds != null">
tag_ids = #{tagIds, jdbcType=VARCHAR}, tag_ids = #{tagIds, jdbcType=VARCHAR},
</if> </if>
<if test="status != null"> <if test="status != null">
status = #{status, jdbcType=VARCHAR}, status = #{status, jdbcType=VARCHAR},
</if> </if>
<if test="createTime != null"> <if test="createTime != null">
create_time = #{createTime, jdbcType=TIMESTAMP}, create_time = #{createTime, jdbcType=TIMESTAMP},
</if> </if>
<if test="updateTime != null"> <if test="updateTime != null">
update_time=now(), update_time=now(),
</if> </if>
<if test="description != null"> <if test="description != null">
description = #{description, jdbcType=VARCHAR}, description = #{description, jdbcType=VARCHAR},
</if> </if>
<if test="delFlag != null"> <if test="delFlag != null">
del_flag = #{delFlag, jdbcType=TINYINT}, del_flag = #{delFlag, jdbcType=TINYINT},
</if> </if>
<if test="createBy != null"> <if test="createBy != null">
create_by = #{createBy, jdbcType=BIGINT}, create_by = #{createBy, jdbcType=BIGINT},
</if> </if>
<if test="updateBy != null"> <if test="updateBy != null">
update_by = #{updateBy, jdbcType=BIGINT}, update_by = #{updateBy, jdbcType=BIGINT},
</if> </if>
<if test="userType != null"> <if test="userType != null">
user_type = #{userType, jdbcType=VARCHAR}, user_type = #{userType, jdbcType=VARCHAR},
</if> </if>
<if test="peakVal != null"> <if test="peakVal != null">
peak_val = #{peakVal, jdbcType=BIGINT}, peak_val = #{peakVal, jdbcType=BIGINT},
</if> </if>
<if test="assigned != null"> <if test="assigned != null">
assigned = #{assigned, jdbcType=BIGINT}, assigned = #{assigned, jdbcType=BIGINT},
</if> </if>
<if test="unAssigned != null"> <if test="unAssigned != null">
un_assigned = #{unAssigned, jdbcType=BIGINT}, un_assigned = #{unAssigned, jdbcType=BIGINT},
</if> </if>
</set> </set>
<include refid="sqlWhere" /> <include refid="sqlWhere"/>
</update> </update>
<!-- 根据人员ID,查询此人所有下级部门及人员 --> <!-- 根据人员ID,查询此人所有下级部门及人员 -->
<select id="getOrgSubordinateUser" parameterType="java.util.Map" <select id="getOrgSubordinateUser" parameterType="java.util.Map"
resultType="com.cftech.base.org.model.vo.QyOrgUserVO"> resultType="com.cftech.base.org.model.vo.QyOrgUserVO">
select a.id,a.name,a.type from( select a.id,a.name,a.type from(
(select id,org_name name,'0' type from (select id,org_name name,'0' type from
t_orgunit org t_orgunit org
where parent_id = #{orgId} where parent_id = #{orgId}
and org.del_flag = 0 and org.del_flag = 0
and org.accounts_id = and org.accounts_id =
#{accountsId} #{accountsId}
<if test="name!=null and name!=''"> <if test="name!=null and name!=''">
and org.org_name like '%${name}%' and org.org_name like '%${name}%'
</if> </if>
) )
UNION ALL UNION ALL
( (
select qyuser.id,qyuser.name,'1' type select qyuser.id,qyuser.name,'1' type
from t_qyuser qyuser from t_qyuser qyuser
left join t_position posi on posi.id = qyuser.position_id left join t_position posi on posi.id = qyuser.position_id
where where
org_id=#{orgId} and qyuser.id!=#{userId} and org_id=#{orgId} and qyuser.id!=#{userId} and
instr(posi.parent_ids,',${positionId},')>0 instr(posi.parent_ids,',${positionId},')>0
and posi.id !=#{positionId} and posi.id !=#{positionId}
and qyuser.accounts_id = #{accountsId} and qyuser.accounts_id = #{accountsId}
and qyuser.del_flag=0 and qyuser.del_flag=0
<if test="name!=null and name!=''"> <if test="name!=null and name!=''">
and qyuser.name like '%${name}%' and qyuser.name like '%${name}%'
</if> </if>
) )a ) )a
order by a.type asc,a.id desc order by a.type asc,a.id desc
<if test="limit>0">limit #{offset},#{limit}</if> <if test="limit>0">limit #{offset},#{limit}</if>
</select> </select>
<!-- 根据人员ID,查询此人所有下级人员 --> <!-- 根据人员ID,查询此人所有下级人员 -->
<select id="getSubordinateUser" parameterType="java.util.Map" <select id="getSubordinateUser" parameterType="java.util.Map"
resultMap="resultMapVO"> resultMap="resultMapVO">
select qyuser.* from t_qyuser qyuser select qyuser.* from t_qyuser qyuser
left join t_position p left join t_position p
on p.id = on p.id =
qyuser.position_id qyuser.position_id
left join t_orgunit o on o.id = left join t_orgunit o on o.id =
qyuser.org_id qyuser.org_id
where where
instr(o.parent_ids,',${orgId},') > 0 instr(o.parent_ids,',${orgId},') > 0
and and
instr(p.parent_ids,',${positionId},') > 0 instr(p.parent_ids,',${positionId},') > 0
and and
p.id!=#{positionId} p.id!=#{positionId}
and and
qyuser.id != #{userId} qyuser.id != #{userId}
and and
qyuser.del_flag = 0 and p.del_flag=0 and qyuser.del_flag = 0 and p.del_flag=0 and
o.del_flag=0 o.del_flag=0
and and
qyuser.accounts_id = #{accountsId} qyuser.accounts_id = #{accountsId}
<if test="name!=null and name !='' ">and qyuser.name like '%${name}%'</if> <if test="name!=null and name !='' ">and qyuser.name like '%${name}%'</if>
<if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if> <if test="sort!=null">ORDER BY ${sort.param} ${sort.type}</if>
<if test="limit>0">limit #{offset},#{limit}</if> <if test="limit>0">limit #{offset},#{limit}</if>
</select> </select>
<!-- 根据选择的部门,查询出所有的人员 --> <!-- 根据选择的部门,查询出所有的人员 -->
<select id="getOrgUserList" parameterType="java.util.Map" <select id="getOrgUserList" parameterType="java.util.Map"
resultMap="resultMap"> resultMap="resultMap">
SELECT SELECT
qyuser.id, qyuser.id,
qyuser. NAME qyuser. NAME
FROM FROM
t_qyuser qyuser t_qyuser qyuser
LEFT JOIN t_position posi ON posi.id = qyuser.position_id LEFT JOIN t_position posi ON posi.id = qyuser.position_id
left join t_orgunit org on org.id = qyuser.org_id left join t_orgunit org on org.id = qyuser.org_id
WHERE WHERE
( (
1=1 and 1=1 and
<foreach item="item" index="index" open="(" close=")" collection="orgIds" separator="or" > <foreach item="item" index="index" open="(" close=")" collection="orgIds" separator="or">
instr(org.parent_ids,'${item}') > 0 instr(org.parent_ids,'${item}') > 0
</foreach> </foreach>
AND instr(posi.parent_ids, ',${positionId},') > 0 AND instr(posi.parent_ids, ',${positionId},') > 0
AND posi.id != ${positionId} AND posi.id != ${positionId}
AND qyuser.accounts_id = #{accountsId} AND qyuser.accounts_id = #{accountsId}
and qyuser.del_flag = 0 and qyuser.del_flag = 0
) )
</select> </select>
<update id="appendTagids" parameterType="java.util.Map"> <update id="appendTagids" parameterType="java.util.Map">
update t_qyuser set tag_ids = concat(IFNULL(tag_ids,''), #{tagIds, update t_qyuser set tag_ids = concat(IFNULL(tag_ids,''), #{tagIds,
jdbcType=VARCHAR}) jdbcType=VARCHAR})
<include refid="sqlWhere" /> <include refid="sqlWhere"/>
</update> </update>
<!-- 根据标签id,查找所有的标签用户 --> <!-- 根据标签id,查找所有的标签用户 -->
<select id="findUsersByTagIds" parameterType="java.util.Map" <select id="findUsersByTagIds" parameterType="java.util.Map"
resultMap="resultMap"> resultMap="resultMap">
SELECT SELECT
<include refid="sqlColumns"/> <include refid="sqlColumns"/>
FROM FROM
t_qyuser t_qyuser
WHERE WHERE
1=1 1=1
AND AND
del_flag = #{delFlag} del_flag = #{delFlag}
AND AND
accounts_id = #{accountsId} accounts_id = #{accountsId}
AND AND
tag_ids REGEXP '#{tagIds}'; tag_ids REGEXP '#{tagIds}';
</select> </select>
<update id="updateUserTerminal" parameterType="java.util.Map"> <update id="updateUserTerminal" parameterType="java.util.Map">
update wx_qy_terminal set sale_account = #{wxUserId} where id in update wx_qy_terminal set sale_account = #{wxUserId} where id in
<foreach item="item" index="index" open="(" close=")" collection="terminals" separator="," > <foreach item="item" index="index" open="(" close=")" collection="terminals" separator=",">
${item} ${item}
</foreach> </foreach>
</update> </update>
<select id="getLogInfo" parameterType="java.util.Map" resultMap="resultMap"> <select id="getLogInfo" parameterType="java.util.Map" resultMap="resultMap">
select b.id,b.name,b.store_id, b.role,c.name store_name,b.qrcode from user a INNER JOIN t_qyuser b on b.id = a.userid select b.id,b.name,b.store_id, b.role,c.name store_name,b.qrcode from user a INNER JOIN t_qyuser b on b.id = a.userid
INNER JOIN t_dc_store c on c.id = b.store_id INNER JOIN t_dc_store c on c.id = b.store_id
where a.id = #{id} and a.delflag = '0' where a.id = #{id} and a.delflag = '0'
</select> </select>
<!-- 获取轮询的人员(药师、医生)且通过峰值排序 --> <!-- 获取轮询的人员(药师、医生)且通过峰值排序 -->
<select id="fetchPollingData" parameterType="java.lang.String" resultMap="resultMap"> <select id="fetchPollingData" parameterType="java.lang.String" resultMap="resultMap">
SELECT t.* FROM t_qyuser t SELECT t.* FROM t_qyuser t
<if test="type=0">t.user_type = '0'</if> <if test="type=0">t.user_type = '0'</if>
<if test="type=1">t.user_type = '1'</if> <if test="type=1">t.user_type = '1'</if>
ORDER BY t.peak_val DESC ORDER BY t.peak_val DESC
</select> </select>
<update id="updateAssigned" parameterType="com.cftech.base.org.model.Qyuser"> <update id="updateAssigned" parameterType="com.cftech.base.org.model.Qyuser">
update t_qyuser update t_qyuser
<set> <set>
<if test="peakVal != null"> <if test="peakVal != null">
peak_val = #{peakVal, jdbcType=BIGINT}, peak_val = #{peakVal, jdbcType=BIGINT},
</if> </if>
<if test="assigned != null"> <if test="assigned != null">
assigned = #{assigned, jdbcType=BIGINT}, assigned = #{assigned, jdbcType=BIGINT},
</if> </if>
<if test="unAssigned != null"> <if test="unAssigned != null">
un_assigned = #{unAssigned, jdbcType=BIGINT}, un_assigned = #{unAssigned, jdbcType=BIGINT},
</if> </if>
</set> </set>
where id=#{id,jdbcType=BIGINT} where id=#{id,jdbcType=BIGINT}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -151,6 +151,9 @@ public class Qyuser implements Serializable { ...@@ -151,6 +151,9 @@ public class Qyuser implements Serializable {
private Long unAssigned; private Long unAssigned;
private String img;
public Qyuser() { public Qyuser() {
this.delFlag = false; this.delFlag = false;
this.peakVal = 0L; this.peakVal = 0L;
......
...@@ -99,10 +99,6 @@ public class QyuserController { ...@@ -99,10 +99,6 @@ public class QyuserController {
Position position = positionService.fetchById(qyuser.getPositionId()); Position position = positionService.fetchById(qyuser.getPositionId());
model.addAttribute("positionName", position.getName()); model.addAttribute("positionName", position.getName());
} }
// if (!StringUtils.isEmpty(qyuser.getStoreId())) {
// Store store = storeService.fetchById(qyuser.getStoreId());
// model.addAttribute("storeName", store.getName());
// }
model.addAttribute("data", qyuser); model.addAttribute("data", qyuser);
model.addAttribute("accountId", qyuser.getAccountsId()); model.addAttribute("accountId", qyuser.getAccountsId());
...@@ -127,7 +123,6 @@ public class QyuserController { ...@@ -127,7 +123,6 @@ public class QyuserController {
try { try {
if (qyuser != null && qyuser.getId() != null) { if (qyuser != null && qyuser.getId() != null) {
Conds conds = new Conds(); Conds conds = new Conds();
conds.equal("t.username", loginNameQyUser); conds.equal("t.username", loginNameQyUser);
conds.equal("t.delflag", 0); conds.equal("t.delflag", 0);
...@@ -141,9 +136,11 @@ public class QyuserController { ...@@ -141,9 +136,11 @@ public class QyuserController {
} }
qyuser.setUpdateBy(userId); qyuser.setUpdateBy(userId);
qyuser.setWxuserId(loginNameQyUser); qyuser.setWxuserId(loginNameQyUser);
//update
// 2017-10-27 取消同步微信企业号标签操作
qyUserUtil.updateQyUser(qyuser); qyUserUtil.updateQyUser(qyuser);
if (!StringUtils.isEmpty(qyuser.getImg())) {
String domainName = SystemConfig.p.getProperty("QY_DOMAIN");
qyuser.setDescription(domainName + qyuser.getImg());
}
qyuserService.update(qyuser); qyuserService.update(qyuser);
if (!StringUtils.isEmpty(loginNameQyUser)) { if (!StringUtils.isEmpty(loginNameQyUser)) {
user.setUsername(loginNameQyUser); user.setUsername(loginNameQyUser);
...@@ -152,8 +149,6 @@ public class QyuserController { ...@@ -152,8 +149,6 @@ public class QyuserController {
user.setPassword(passwordQyUser); user.setPassword(passwordQyUser);
} }
userService.update(user); userService.update(user);
// 2017-10-27 取消同步微信企业号标签操作
// qyTagUtil.syncTag(qyuser);
rtnJson.put("errorNo", 0); rtnJson.put("errorNo", 0);
} else { } else {
Conds conds = new Conds(); Conds conds = new Conds();
...@@ -179,16 +174,16 @@ public class QyuserController { ...@@ -179,16 +174,16 @@ public class QyuserController {
user.setPassword(passwordQyUser); user.setPassword(passwordQyUser);
user.setUsername(loginNameQyUser); user.setUsername(loginNameQyUser);
user.setState("0"); user.setState("0");
if (!StringUtils.isEmpty(qyuser.getImg())) {
String domainName = SystemConfig.p.getProperty("QY_DOMAIN");
qyuser.setDescription(domainName + qyuser.getImg());
}
qyuserService.save(qyuser); qyuserService.save(qyuser);
user.setUserid(qyuser.getId()); user.setUserid(qyuser.getId());
user.setDefaultAccId(UserUtils.getmpaccounts(request)); user.setDefaultAccId(UserUtils.getmpaccounts(request));
userService.save(user); userService.save(user);
//2017-10-27 取消同步微信企业号标签操作 qyTagUtil.syncTag(qyuser);
rtnJson.put("errorNo", 2); rtnJson.put("errorNo", 2);
} }
//取消终端
// String[] terminalStrs = terminalIds.split(",");
// terminalUserService.saveBatchTerminalCommodity(qyuser.getId(), terminalStrs,qyuser.getWxuserId());
} catch (Exception e) { } catch (Exception e) {
rtnJson.put("errorNo", 1); rtnJson.put("errorNo", 1);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment